Ir para conteúdo
Fórum Script Brasil

Eder

Membros
  • Total de itens

    1.002
  • Registro em

  • Última visita

Tudo que Eder postou

  1. JOnas...quando achava que não tinha mais jeito...já estava disposta a desinstalar o delphi e instalar tudo de novo...ai dei a ultima cartada...peguei todos os arquivos da Unit do rxlib e copia pra pasta Lib do delphi e não é que funcionou....acho que tinha algum arquivo que tava faltando....la dentro.. As vezes um chute ....da certo.....rs. valeu Carinha muito grato a ajuda.. abraços t+ :)
  2. Ola..Jonas...Feliz Ano Novo. carinha: R.: Eu desinstalei e não mudou nada.... :( 2 - vai ate o diretorio onde tem as Units do RxLib e procura por DateUtil.pas e faz a correção declarando 'MakeStr' e recompila o programa e troca a dcu do RXControls na pasta Lib do delphi R.: mas..aonde eu declaro o MakeStr ??? e ai você diz que: recompila o programa e troca a dcu do RxControls na pasta lib do Delphi ...não entendi direito..pordes dar uma explicadinha.... segue abaixo a unit DateUtils pra você me dizer aonde eu altero Grato {*******************************************************} { } { Delphi VCL Extensions (RX) } { } { Copyright (c) 1995, 1996 AO ROSNO } { Copyright (c) 1997, 1998 Master-Bank } { } {*******************************************************} unit DateUtil; {$I RX.INC} {$B-,V-,R-,Q-} interface function CurrentYear: Word; function IsLeapYear(AYear: Integer): Boolean; function DaysPerMonth(AYear, AMonth: Integer): Integer; function FirstDayOfPrevMonth: TDateTime; function LastDayOfPrevMonth: TDateTime; function FirstDayOfNextMonth: TDateTime; function ExtractDay(ADate: TDateTime): Word; function ExtractMonth(ADate: TDateTime): Word; function ExtractYear(ADate: TDateTime): Word; function IncDate(ADate: TDateTime; Days, Months, Years: Integer): TDateTime; function IncDay(ADate: TDateTime; Delta: Integer): TDateTime; function IncMonth(ADate: TDateTime; Delta: Integer): TDateTime; function IncYear(ADate: TDateTime; Delta: Integer): TDateTime; function ValidDate(ADate: TDateTime): Boolean; procedure DateDiff(Date1, Date2: TDateTime; var Days, Months, Years: Word); function MonthsBetween(Date1, Date2: TDateTime): Double; function DaysInPeriod(Date1, Date2: TDateTime): Longint; { Count days between Date1 and Date2 + 1, so if Date1 = Date2 result = 1 } function DaysBetween(Date1, Date2: TDateTime): Longint; { The same as previous but if Date2 < Date1 result = 0 } function IncTime(ATime: TDateTime; Hours, Minutes, Seconds, MSecs: Integer): TDateTime; function IncHour(ATime: TDateTime; Delta: Integer): TDateTime; function IncMinute(ATime: TDateTime; Delta: Integer): TDateTime; function IncSecond(ATime: TDateTime; Delta: Integer): TDateTime; function IncMSec(ATime: TDateTime; Delta: Integer): TDateTime; function CutTime(ADate: TDateTime): TDateTime; { Set time to 00:00:00:00 } type TDateOrder = (doMDY, doDMY, doYMD); TDayOfWeekName = (Sun, Mon, Tue, Wed, Thu, Fri, Sat); TDaysOfWeek = set of TDayOfWeekName; { String to date conversions } function GetDateOrder(const DateFormat: string): TDateOrder; function MonthFromName(const S: string; MaxLen: Byte): Byte; function StrToDateDef(const S: string; Default: TDateTime): TDateTime; function StrToDateFmt(const DateFormat, S: string): TDateTime; function StrToDateFmtDef(const DateFormat, S: string; Default: TDateTime): TDateTime; function DefDateFormat(FourDigitYear: Boolean): string; function DefDateMask(BlanksChar: Char; FourDigitYear: Boolean): string; {$IFDEF WIN32} function FormatLongDate(Value: TDateTime): string; function FormatLongDateTime(Value: TDateTime): string; {$ENDIF} const DefaultDateOrder = doDMY; {$IFDEF USE_FOUR_DIGIT_YEAR} var FourDigitYear: Boolean; {$ELSE} function FourDigitYear: Boolean; {$ENDIF USE_FOUR_DIGIT_YEAR} const CenturyOffset: Byte = 60; {$IFDEF WIN32} NullDate: TDateTime = {-693594} 0; {$ELSE} NullDate: TDateTime = 0; {$ENDIF} implementation uses SysUtils, {$IFDEF WIN32} Windows, {$ENDIF} Consts, StrUtils; function IsLeapYear(AYear: Integer): Boolean; begin Result := (AYear mod 4 = 0) and ((AYear mod 100 <> 0) or (AYear mod 400 = 0)); end; function DaysPerMonth(AYear, AMonth: Integer): Integer; const DaysInMonth: array[1..12] of Integer = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); begin Result := DaysInMonth[AMonth]; if (AMonth = 2) and IsLeapYear(AYear) then Inc(Result); { leap-year Feb is special } end; function FirstDayOfNextMonth: TDateTime; var Year, Month, Day: Word; begin DecodeDate(Date, Year, Month, Day); Day := 1; if Month < 12 then Inc(Month) else begin Inc(Year); Month := 1; end; Result := EncodeDate(Year, Month, Day); end; function FirstDayOfPrevMonth: TDateTime; var Year, Month, Day: Word; begin DecodeDate(Date, Year, Month, Day); Day := 1; if Month > 1 then Dec(Month) else begin Dec(Year); Month := 12; end; Result := EncodeDate(Year, Month, Day); end; function LastDayOfPrevMonth: TDateTime; var D: TDateTime; Year, Month, Day: Word; begin D := FirstDayOfPrevMonth; DecodeDate(D, Year, Month, Day); Day := DaysPerMonth(Year, Month); Result := EncodeDate(Year, Month, Day); end; function ExtractDay(ADate: TDateTime): Word; var M, Y: Word; begin DecodeDate(ADate, Y, M, Result); end; function ExtractMonth(ADate: TDateTime): Word; var D, Y: Word; begin DecodeDate(ADate, Y, Result, D); end; function ExtractYear(ADate: TDateTime): Word; var D, M: Word; begin DecodeDate(ADate, Result, M, D); end; function IncDate(ADate: TDateTime; Days, Months, Years: Integer): TDateTime; var D, M, Y: Word; Day, Month, Year: Longint; begin DecodeDate(ADate, Y, M, D); Year := Y; Month := M; Day := D; Inc(Year, Years); Inc(Year, Months div 12); Inc(Month, Months mod 12); if Month < 1 then begin Inc(Month, 12); Dec(Year); end else if Month > 12 then begin Dec(Month, 12); Inc(Year); end; if Day > DaysPerMonth(Year, Month) then Day := DaysPerMonth(Year, Month); Result := EncodeDate(Year, Month, Day) + Days + Frac(ADate); end; procedure DateDiff(Date1, Date2: TDateTime; var Days, Months, Years: Word); { Corrected by Anatoly A. Sanko (2:450/73) } var DtSwap: TDateTime; Day1, Day2, Month1, Month2, Year1, Year2: Word; begin if Date1 > Date2 then begin DtSwap := Date1; Date1 := Date2; Date2 := DtSwap; end; DecodeDate(Date1, Year1, Month1, Day1); DecodeDate(Date2, Year2, Month2, Day2); Years := Year2 - Year1; Months := 0; Days := 0; if Month2 < Month1 then begin Inc(Months, 12); Dec(Years); end; Inc(Months, Month2 - Month1); if Day2 < Day1 then begin Inc(Days, DaysPerMonth(Year1, Month1)); if Months = 0 then begin Dec(Years); Months := 11; end else Dec(Months); end; Inc(Days, Day2 - Day1); end; function IncDay(ADate: TDateTime; Delta: Integer): TDateTime; begin Result := ADate + Delta; end; function IncMonth(ADate: TDateTime; Delta: Integer): TDateTime; begin Result := IncDate(ADate, 0, Delta, 0); end; function IncYear(ADate: TDateTime; Delta: Integer): TDateTime; begin Result := IncDate(ADate, 0, 0, Delta); end; function MonthsBetween(Date1, Date2: TDateTime): Double; var D, M, Y: Word; begin DateDiff(Date1, Date2, D, M, Y); Result := 12 * Y + M; if (D > 1) and (D < 7) then Result := Result + 0.25 else if (D >= 7) and (D < 15) then Result := Result + 0.5 else if (D >= 15) and (D < 21) then Result := Result + 0.75 else if (D >= 21) then Result := Result + 1; end; function IsValidDate(Y, M, D: Word): Boolean; begin Result := (Y >= 1) and (Y <= 9999) and (M >= 1) and (M <= 12) and (D >= 1) and (D <= DaysPerMonth(Y, M)); end; function ValidDate(ADate: TDateTime): Boolean; var Year, Month, Day: Word; begin try DecodeDate(ADate, Year, Month, Day); Result := IsValidDate(Year, Month, Day); except Result := False; end; end; function DaysInPeriod(Date1, Date2: TDateTime): Longint; begin if ValidDate(Date1) and ValidDate(Date2) then Result := Abs(Trunc(Date2) - Trunc(Date1)) + 1 else Result := 0; end; function DaysBetween(Date1, Date2: TDateTime): Longint; begin Result := Trunc(Date2) - Trunc(Date1) + 1; if Result < 0 then Result := 0; end; function IncTime(ATime: TDateTime; Hours, Minutes, Seconds, MSecs: Integer): TDateTime; begin Result := ATime + (Hours div 24) + (((Hours mod 24) * 3600000 + Minutes * 60000 + Seconds * 1000 + MSecs) / MSecsPerDay); if Result < 0 then Result := Result + 1; end; function IncHour(ATime: TDateTime; Delta: Integer): TDateTime; begin Result := IncTime(ATime, Delta, 0, 0, 0); end; function IncMinute(ATime: TDateTime; Delta: Integer): TDateTime; begin Result := IncTime(ATime, 0, Delta, 0, 0); end; function IncSecond(ATime: TDateTime; Delta: Integer): TDateTime; begin Result := IncTime(ATime, 0, 0, Delta, 0); end; function IncMSec(ATime: TDateTime; Delta: Integer): TDateTime; begin Result := IncTime(ATime, 0, 0, 0, Delta); end; function CutTime(ADate: TDateTime): TDateTime; begin Result := Trunc(ADate); end; function CurrentYear: Word; {$IFNDEF WIN32} assembler; {$ENDIF} {$IFDEF WIN32} var SystemTime: TSystemTime; begin GetLocalTime(SystemTime); Result := SystemTime.wYear; end; {$ELSE} asm MOV AH,2AH INT 21H MOV AX,CX end; {$ENDIF} { String to date conversions. Copied from SYSUTILS.PAS unit. } procedure ScanBlanks(const S: string; var Pos: Integer); var I: Integer; begin I := Pos; while (I <= Length(S)) and (S[I] = ' ') do Inc(I); Pos := I; end; function ScanNumber(const S: string; MaxLength: Integer; var Pos: Integer; var Number: Longint): Boolean; var I: Integer; N: Word; begin Result := False; ScanBlanks(S, Pos); I := Pos; N := 0; while (I <= Length(S)) and (Longint(I - Pos) < MaxLength) and (S[I] in ['0'..'9']) and (N < 1000) do begin N := N * 10 + (Ord(S[I]) - Ord('0')); Inc(I); end; if I > Pos then begin Pos := I; Number := N; Result := True; end; end; function ScanChar(const S: string; var Pos: Integer; Ch: Char): Boolean; begin Result := False; ScanBlanks(S, Pos); if (Pos <= Length(S)) and (S[Pos] = Ch) then begin Inc(Pos); Result := True; end; end; {$IFDEF RX_D3} procedure ScanToNumber(const S: string; var Pos: Integer); begin while (Pos <= Length(S)) and not (S[Pos] in ['0'..'9']) do begin if S[Pos] in LeadBytes then Inc(Pos); Inc(Pos); end; end; {$ENDIF} function GetDateOrder(const DateFormat: string): TDateOrder; var I: Integer; begin Result := DefaultDateOrder; I := 1; while I <= Length(DateFormat) do begin case Chr(Ord(DateFormat[I]) and $DF) of {$IFDEF RX_D3} 'E': Result := doYMD; {$ENDIF} 'Y': Result := doYMD; 'M': Result := doMDY; 'D': Result := doDMY; else Inc(I); Continue; end; Exit; end; Result := DefaultDateOrder; { default } end; function ExpandYear(Year: Integer): Integer; var N: Longint; begin Result := Year; if Result < 100 then begin N := CurrentYear - CenturyOffset; Inc(Result, N div 100 * 100); if (CenturyOffset > 0) and (Result < N) then Inc(Result, 100); end; end; function ScanDate(const S, DateFormat: string; var Pos: Integer; var Y, M, D: Integer): Boolean; var DateOrder: TDateOrder; N1, N2, N3: Longint; begin Result := False; Y := 0; M := 0; D := 0; DateOrder := GetDateOrder(DateFormat); {$IFDEF RX_D3} if ShortDateFormat[1] = 'g' then { skip over prefix text } ScanToNumber(S, Pos); {$ENDIF RX_D3} if not (ScanNumber(S, MaxInt, Pos, N1) and ScanChar(S, Pos, DateSeparator) and ScanNumber(S, MaxInt, Pos, N2)) then Exit; if ScanChar(S, Pos, DateSeparator) then begin if not ScanNumber(S, MaxInt, Pos, N3) then Exit; case DateOrder of doMDY: begin Y := N3; M := N1; D := N2; end; doDMY: begin Y := N3; M := N2; D := N1; end; doYMD: begin Y := N1; M := N2; D := N3; end; end; Y := ExpandYear(Y); end else begin Y := CurrentYear; if DateOrder = doDMY then begin D := N1; M := N2; end else begin M := N1; D := N2; end; end; ScanChar(S, Pos, DateSeparator); ScanBlanks(S, Pos); {$IFDEF RX_D3} if SysLocale.FarEast and (System.Pos('ddd', ShortDateFormat) <> 0) then begin { ignore trailing text } if ShortTimeFormat[1] in ['0'..'9'] then { stop at time digit } ScanToNumber(S, Pos) else { stop at time prefix } repeat while (Pos <= Length(S)) and (S[Pos] <> ' ') do Inc(Pos); ScanBlanks(S, Pos); until (Pos > Length(S)) or (AnsiCompareText(TimeAMString, Copy(S, Pos, Length(TimeAMString))) = 0) or (AnsiCompareText(TimePMString, Copy(S, Pos, Length(TimePMString))) = 0); end; {$ENDIF RX_D3} Result := IsValidDate(Y, M, D) and (Pos > Length(S)); end; function MonthFromName(const S: string; MaxLen: Byte): Byte; begin if Length(S) > 0 then for Result := 1 to 12 do begin if (Length(LongMonthNames[Result]) > 0) and (AnsiCompareText(Copy(S, 1, MaxLen), Copy(LongMonthNames[Result], 1, MaxLen)) = 0) then Exit; end; Result := 0; end; procedure ExtractMask(const Format, S: string; Ch: Char; Cnt: Integer; var I: Integer; Blank, Default: Integer); var Tmp: string[20]; J, L: Integer; begin I := Default; Ch := UpCase(Ch); L := Length(Format); if Length(S) < L then L := Length(S) else if Length(S) > L then Exit; J := Pos(MakeStr(Ch, Cnt), AnsiUpperCase(Format)); if J <= 0 then Exit; Tmp := ''; while (UpCase(Format[J]) = Ch) and (J <= L) do begin if S[J] <> ' ' then Tmp := Tmp + S[J]; Inc(J); end; if Tmp = '' then I := Blank else if Cnt > 1 then begin I := MonthFromName(Tmp, Length(Tmp)); if I = 0 then I := -1; end else I := StrToIntDef(Tmp, -1); end; function ScanDateStr(const Format, S: string; var D, M, Y: Integer): Boolean; var Pos: Integer; begin ExtractMask(Format, S, 'm', 3, M, -1, 0); { short month name? } if M = 0 then ExtractMask(Format, S, 'm', 1, M, -1, 0); ExtractMask(Format, S, 'd', 1, D, -1, 1); ExtractMask(Format, S, 'y', 1, Y, -1, CurrentYear); Y := ExpandYear(Y); Result := IsValidDate(Y, M, D); if not Result then begin Pos := 1; Result := ScanDate(S, Format, Pos, Y, M, D); end; end; function InternalStrToDate(const DateFormat, S: string; var Date: TDateTime): Boolean; var D, M, Y: Integer; begin if S = '' then begin Date := NullDate; Result := True; end else begin Result := ScanDateStr(DateFormat, S, D, M, Y); if Result then try Date := EncodeDate(Y, M, D); except Result := False; end; end; end; function StrToDateFmt(const DateFormat, S: string): TDateTime; begin if not InternalStrToDate(DateFormat, S, Result) then raise EConvertError.CreateFmt({$IFDEF RX_D3} SInvalidDate {$ELSE} LoadStr(SInvalidDate) {$ENDIF}, [S]); end; function StrToDateDef(const S: string; Default: TDateTime): TDateTime; begin if not InternalStrToDate(ShortDateFormat, S, Result) then Result := Trunc(Default); end; function StrToDateFmtDef(const DateFormat, S: string; Default: TDateTime): TDateTime; begin if not InternalStrToDate(DateFormat, S, Result) then Result := Trunc(Default); end; function DefDateFormat(FourDigitYear: Boolean): string; begin if FourDigitYear then begin case GetDateOrder(ShortDateFormat) of doMDY: Result := 'MM/DD/YYYY'; doDMY: Result := 'DD/MM/YYYY'; doYMD: Result := 'YYYY/MM/DD'; end; end else begin case GetDateOrder(ShortDateFormat) of doMDY: Result := 'MM/DD/YY'; doDMY: Result := 'DD/MM/YY'; doYMD: Result := 'YY/MM/DD'; end; end; end; function DefDateMask(BlanksChar: Char; FourDigitYear: Boolean): string; begin if FourDigitYear then begin case GetDateOrder(ShortDateFormat) of doMDY, doDMY: Result := '!99/99/9999;1;'; doYMD: Result := '!9999/99/99;1;'; end; end else begin case GetDateOrder(ShortDateFormat) of doMDY, doDMY: Result := '!99/99/99;1;'; doYMD: Result := '!99/99/99;1;'; end; end; if Result <> '' then Result := Result + BlanksChar; end; {$IFDEF WIN32} function FormatLongDate(Value: TDateTime): string; var Buffer: array[0..1023] of Char; SystemTime: TSystemTime; begin {$IFDEF RX_D3} DateTimeToSystemTime(Value, SystemTime); {$ELSE} with SystemTime do begin DecodeDate(Value, wYear, wMonth, wDay); DecodeTime(Value, wHour, wMinute, wSecond, wMilliseconds); end; {$ENDIF} SetString(Result, Buffer, GetDateFormat(GetThreadLocale, DATE_LONGDATE, @SystemTime, nil, Buffer, SizeOf(Buffer) - 1)); Result := TrimRight(Result); end; function FormatLongDateTime(Value: TDateTime): string; begin if Value <> NullDate then Result := FormatLongDate(Value) + FormatDateTime(' tt', Value) else Result := ''; end; {$ENDIF WIN32} {$IFNDEF USE_FOUR_DIGIT_YEAR} function FourDigitYear: Boolean; begin Result := Pos('YYYY', AnsiUpperCase(ShortDateFormat)) > 0; end; {$ENDIF} {$IFDEF USE_FOUR_DIGIT_YEAR} initialization FourDigitYear := Pos('YYYY', AnsiUpperCase(ShortDateFormat)) > 0; {$ENDIF} end.
  3. Ola... Depois de alguns dias sem mexer em algumas programas, hoje deparei com um erro na Suite RxLib, o problema é que não mexi em nada..e agora fui compilar um programa e deu o erro nesta UNIT: Unit da Rxlib: unit DateUtil; erro: J := Pos(MakeStr(Ch, Cnt), AnsiUpperCase(Format)); erro: [Error] DateUtil.pas(485): Undeclared identifier: 'MakeStr' alguém poderia me dizer uma maneira de corrigir este erro??? pelo que me lembro não mexi em nada que possa ter afetada a suite rxlib Grato
  4. R.: sem problemas...também só volto dia 2....até lá :D R.: Felizmente não faltou não.....hehehe, mas deu uma trovoada daquelas, mora na Fortaleza.....é de vez enquando é bom trabalhar....rs...brincadeirinha.. :blush: R.: Pra você também tudo de bom... :D t+
  5. R.: Opa....deu certo os dois códigos valeu Grato t+ :)
  6. beleza..isto mesmo... só que eu uso o componente XiButton1(botão). e ele não aceita o comando: XiButton1.click; verifiquei e ele não usa o comando CLICK :blush: Mas beleza...vou usar o componente BUTTON mesmo. valeu muito grato
  7. Ola... Como faço pra executar num botão a execução de outro botão exemplo: quero no button3 dar um click, e ai executar o comando do Onclick do Button1 e Button2 ao mesmo tempo.. vi isto uma vez num forum mas não to me lembrando como fazer. tentei assim mas não da certo: :unsure: button1.OnClick; Grato :)
  8. R.: Design_Time R.: ok.....mas não sei como fazer isto...sendo que só vou repetir o valor do edit anterior, quando de um enter no campo sem digitar nada. R.: Não há Impressão...apenas é um form de conferencia de valores....bem simples...sem impressão alguma.. R.: eu tenho tudo pronto...exceto esta parte...que estou pedindo ajuda, e não to conseguindo resolver...na verdade o usuário já usa o aplicativo há muito tempo, e ele me pediu pra ver se da pra imprementar, pois as vezes ele tem que somar varios valores iguais.....e ai é um saco...e concordo com ele...é muito chato...rs.. muito Grato...Micheus... Forte Abraço....final de semana vejo sua resposta lá de casa....aqui na empresa fecho meu expediente...rs... t+ ;)
  9. Ola... Tenho que montar uma somatório de 84 edit´s, tipo uma calculadora, porem somar os 84 edit´s. mas tipo....se o usuario digitar no edit1 = 10,00 e se a proxima soma(edit2) for também 10,00 ele não precisasse digitar de novo 10,00 e sim um simples ENTER(tipo calculadora)...o edit2 copiaria o valor do edit 1 para o edit2, algo assim. Como poderia fazer este processo já que são 84 edit´s... Obs: tenho que mostrar os 84 edit´s, este processo serve pra conferência de valores, por isto deve ser travalhado com os 84 edit´s, pois caso o somatório não bater com a documentação, o usuario podera tirar as vias de documentos com os 84 edit´s e tentar achar o furo da soma. Grato F E L I Z 2 0 0 8
  10. Eder

    Memo + *.ini

    Oba...na verdade estas duas funcões achei na net.... e no meu caso resolveu... valeu.... ;) Grato
  11. Eder

    Memo + *.ini

    R.: certo.....coloquei um (=) junto ficando assim: while I =< Length(S) do ai deu certo ;) R.: opa....sem problemas.... o usuario neste caso digita a relação de emails...a qual ele quer gravar...e ai quando fecha o form e grava num *.ini quando ele abre o programa, esta lá a listinha dos emails, pois ele retorna a lista atraves do OnCreate do form. a finalidade total do processo...é como este programinha fica em duas filiais da empresa...e como não quero lidar com tabelas....então ele grava no ini....o processo de guardar os emails é porque são mtos emails...então ele usa esta lista pra emails programados...ou seja..tal hora ele passa determinados emails...para os usuarios que estão cadastrados nesta lista(Memo). Mas..beleza....Obrigado pela dica. Se não nos comunicar-mos de novo Um FELIZ NATAL pra você e sua Família......Um grande ano de 2008 ...mta Saúde e Paz.....que em 2008 você e outros colaboradores do forum possam ter esta disponibilidade e vontade em ajudar pessoas mais inexperientes(como eu), e até mesmo outros profissionais. valeu...Obrigado por todas as ajudas que você me deu este 2007, que não foram poucas...hehehe. Forte Abraço. :D
  12. Eder

    Memo + *.ini

    Ola....eu uso este procedimento pra gravar dados de um memo pra um *.ini function EncodeString(S: string): string; var I: integer; begin Result := ''; for I := 1 to Length(S) do if (S[I] in [#13, #10, #35]) then Result := Result + '#' + IntToStr(Ord(S[I])) else Result := Result + S[I]; end; function DecodeString(S: string): string; var I: integer; begin Result := ''; I := 1; while I < Length(S) do begin if (S[I] = '#') then begin Result := Result + Chr(StrToInt(Copy(S, I + 1, 2))); Inc(I, 2); end else Result := Result + S[I]; Inc(I); end; end; No OnClose: Neste caso ele pega os dados do Memo e Grava no *.INI procedure TFormEmail.FormClose(Sender: TObject; var Action: TCloseAction); var ini: TInifile; //declarar variavel begin Ini:= Tinifile.Create(ExtractFilePath(Application.ExeName) + 'config.Ini'); // vai pegar o ini onde o executavel esta //email´s ini.WriteString('dados', 'EMAILSV', EncodeString(Memo1.Lines.Text)); ini.WriteString('dados', 'EMAILRM', EncodeString(Memo2.Lines.Text)); ini.WriteString('dados', 'EMAILSO', EncodeString(Memo3.Lines.Text)); ini.WriteString('dados', 'EMAILCV', EncodeString(Memo4.Lines.Text)); ini.free; end; No OnCreate: quando o programa é aberto ele pega os dados do *.ini e manda pros memos. procedure TFormEmail.FormCreate(Sender: TObject); var ini: TInifile; //declarar variavel begin Ini:= Tinifile.Create(ExtractFilePath(Application.ExeName) + 'Config.Ini'); // vai pegar o ini onde o executavel esta //EMAIL´S Memo1.Lines.Text:= DecodeString(ini.readstring('dados','EMAILSV','')); Memo2.Lines.Text:= DecodeString(ini.readstring('dados','EMAILRM','')); Memo3.Lines.Text:= DecodeString(ini.readstring('dados','EMAILSO','')); Memo4.Lines.Text:= DecodeString(ini.readstring('dados','EMAILCV','')); ini.Free;// liberar o arquivo end; Agora vem o probleminha.....tudo funciona acima....mas quando ele abre o programa nos memos sempre acaba comendo UMA LETRA. Exemplo quando fecho o problema ta assim um memo: quando abro o programa aparece assim no memo: notem que falta o R do BR Tem alguma maneira de corrigir?? Grato
  13. Eder

    (Resolvido) RxTrayIcon

    Ok..Resolvido.... Tou usando: hide; //esconder show; //mostrar Grato a todos :D
  14. Eder

    (Resolvido) RxTrayIcon

    http://scriptbrasil.com.br/forum/index.php?showtopic=111884 R.:Opa Churc...isto mesmo...valeu; :D Churc....carinha voltando aquele assunto anterior.... quando uso este comando: Application.Minimize; quando abro o programa e depois click no minimizar.....ele minimiza legal.....fica no Tray o icone certinho do jeito que queria...mas quando. maximizo ele abre certinho e ai se clicko no botão de novo de MINIMIZAR ou no minizar mesmo(cando direito do form)...ai ele fica no Tray e também na barra (só queria que ficasse no Tray). resumindo ele só fico no Tray quando é executado pela primeira vez .....as outras vezes ele não esconde mais... Sabes como contornar esta situação? Haaa....Jonas...vi seu recado..beleza.. :D Grato
  15. Eder

    (Resolvido) RxTrayIcon

    Pelo que recordo voce usa Delphi versao inferior a 5 né, deve ser por isso! R.: sim D4 Mas ai me lembrei que tenho instalada a Suite da RxLib e na paleta RXTools tem um componente chamado: AppEvents e ai fechou ...fiz o que você explicou..e beleza, funcionou certinho. valeu Churc...só pra fechar..... Na RxTrayIcon1 tipo eu coloquei assim: RxTrayIcon1.Hint:='Chegou Arquivo!!'; Tem como abrir o Hint automatico(balão) tipo o MSN?? muito Grato :D
  16. Eder

    (Resolvido) RxTrayIcon

    Oba...Churc R.: Carinha não achei este componente......procurei em todas as paletas... :(
  17. Ola...eu tou usando o componente da RXLIB RxTrayIcon1 e funciona perfeito.. Mas não to conseguindo o seguinte quando o eu clicko no Tray e chama o aplicativo na tela...e depois eu gostaria de clickar num botão e deixar novamente ele no Tray (somente lá). eu tava usando o comando num botão: Application.Minimize; mas ai fica feio..... Gostaria de deixar somente no Tray Grato
  18. Pessoal valeu as dicas......ajudou bastante. :D Grato
  19. Ola. tem como eu verificar se existe em uma pasta?? tipo assim: if FileExists('c:\teste\teste.rtf') then begin showmessage('existe!!'); end else showmessage('não existe!!'); end; só que neste caso não sei o nome do arquivos....eu só queria saber se na pasta c:\teste existe algum arquivo não importa o nome. Tem como?? Grato
  20. R.: Beleza...mas compilou...rs. é isto que tava intrigado.. valeu..Cherc...Agradecido t+ :D
  21. Ola..pessoal Tou tentando copiar arquivos de uma pasta pra outra mas não ta funcionando... tenho duas strings: ArqOrigem (local de origem) ArqDestino(local de Destino). quando tento copiar da erro que tratei abaixo IF CopyFile('ArqOrigem','ArqDestino',False)THEN BEGIN SHOWMESSAGE('Arquivo copiado com Sucesso.'); end ELSE SHOWMESSAGE('ERRO AO COPIAR Arquivo '); END; se eu usar assim funciona(sem trabalhar com variaveis): alguém sabe me dizer porque não copia?? Grato
  22. Oi Eder ... voce pode fazer desta maneira, salvando o QR em outros formatos Na clausula uses, acrescente a unit QRExport CODE QuickReport.ExportToFilter(TQRHTMLDocumentFilter.Create('c:\teste.html')); // Exportando para HTML QuickReport.ExportToFilter(TQRAsciiExportFilter.Create('c:\teste.doc')); //Exportando para DOC ou TXT QuickReport.ExportToFilter(TQRXLSFilter.Create('c:\teste.xls')); //Exportando para XLS R.: opa...este eu já sabia...mesmo assim valeu....fica aqui a post pra quem tem dúvida. ou pode salvar o QR nativo Coloque um SaveDialog no seu form (Palheta Dialogs) CODE if SaveDialog.execute then begin QuickRep1.prepare; QuickRep1.printer.save(SaveDialog.filename); end R: este é quem queria mesmo....... sem o SaveDialog assim direto é o que tou precisando: QuickRep1.prepare; QuickRep1.printer.save('C:\TESTE.QRP'); valeu...Grato. Abraços t+ :D
  23. Ola.. Tem como eu salvar em *.qrp um relatorio do quickreport sem passar pelo preview?? tipo pra salvar eu tenho hoje que primeiro usar este comando: Quickrep1.preview; e depois usar a paleta pra salvar em qrp tem como eu salvar em QRP sem passar pelo Preview?? Grato
  24. Eder

    (Resolvido) While

    Opa....valeu..pessoal deu certo muito Grato........ t+ :D
  25. Ola... tou com um probleminha num while se eu não usar esta linha aqui..o while funciona certinho: if (Table1STATUS.AsString = 'SIM') then Mas COMO eu preciso colocar um filtro no while este abaixo: if (Table1STATUS.AsString = 'SIM') then dizendo que é só pra processar a Table1Status = 'SIM' mas ai ele não processa e da erro... segue codigo abaixo do while. Table1.Refresh; Table1.First; // vai para o início da tabela While not Table1.eof do begin if (Table1STATUS.AsString = 'SIM') then begin CLIENTES:=EditCnpjPag.text; Arq_jpg:=EditNomeGuerra.text+'.jpg'; Aguarde.caption:=EditRazaoSocial.text+' - '+EditCnpjPag.Text; // TXT := 'Select sigla_ctrc, situacao_ctrc, data_emissao, '+ 'kg_calculo, valor_n_fiscal, frete_peso, frete_valor, '+ 'vlr_icms, despacho, valor_frete, contador '+ 'FROM CTRC Where (SITUACAO_CTRC <> "C") Order by Data_Emissao'; //COMO PAGADOR aguarde.visible:=true; aguarde.Update; Form3.Query1.Close; Cursor := crDefault; Form3.Query1.SQL.Text := Txt; Cursor := crSQLWait; Form3.Query1.Open; Application.ProcessMessages; // TXTMeses := 'SELECT sum(KG_CALCULO) as TOTPESO, '+ 'sum(VALOR_N_FISCAL) as TOTVM, '+ 'sum(FRETE_PESO) as TOTFPESO, '+ 'sum(FRETE_VALOR) as TOTFVALOR, '+ 'sum(DESPACHO) as TOTDESPACHO, '+ 'sum(VLR_ICMS) as TOTICMS, '+ 'sum(VALOR_FRETE) as TOTFRETE, '+ 'sum(CONTADOR) as TOTQTDCTRC '+ 'FROM CTRC '+ 'where extract(month from DATA_EMISSAO)=:pMes '+ 'and extract(year from DATA_EMISSAO)=:pAno '+ 'and (SITUACAO_CTRC <> "C") '+ 'and PAG_cnpj=:pCliente '; Form3.QRYMESES.SQL.Text := TxtMeses; Application.ProcessMessages; // FORM3.CLIENTE.Caption:='Cliente: '+EditRazaoSocial.text + ' - Cnpj/Cpf: '+EditCnpjPag.Text+' - CLIENTE PAGADOR'; Form3.quickrep1.Prepare; QrpToImg_Aut(FORM3.QuickRep1,'C:\DADOS\',1); //Exporta o Quick para JPG Application.ProcessMessages; Table1.Next; end; free; Timer1.Enabled:=false;//desativa contador Showmessage('OK... PROCESSADOS TODOS OS CLIENTES'); end; end; Grato
×
×
  • Criar Novo...