Ir para conteúdo
Fórum Script Brasil

escobar

Membros
  • Total de itens

    21
  • Registro em

  • Última visita

Sobre escobar

  • Data de Nascimento 30/12/1969

Contatos

  • MSN
    escobar@megasistema.com.br
  • Website URL
    http://
  • ICQ
    9094497

Perfil

  • Location
    Ribeirão Preto
  • Interests
    programação, DELPHI, PHP, Clipper, ASM<br>banco de dados: MySQL<br>sistemas: Windows, LINUX

escobar's Achievements

0

Reputação

  1. Não funciona o comando "Assign(MyBMP)"; não tem no TICONImage só no TJPEGImage
  2. au alimento um LABEL... com dois digitos, dai eu crio um BMP do label fica bom, mas agora preciso transformar este BMP em ICON... será que alguém pode me ajudar ?
  3. Odeio quando isso acontece... a função tava incompleta na pagina, mas tinha um arquivo com ela completinha, ai desculpem a falha... Private Function diferença_datas(Dtini As Date, Dtfin As Date) If IsNull(Dtini) Or Dtini > Now Or Dtini > Dtfin Then MsgBox "Data inválida !", vbCritical, "Data Inválida" Exit Function End If diferenca = Dtfin - Dtini xAnos = diferenca / 365.25 anos = Int(xAnos) xMeses = (xAnos - anos) * 12 meses = Int(xMeses) dias = DateDiff("d", DateSerial(DatePart("yyyy", Dtini) + anos, _ DatePart("m", Dtini) + meses, Day(Dtini)), Dtfin) If dias = 30 Then dias = 0 End If If meses = 12 Then meses = 0 anos = anos + 1 End If If anos > 1 Then anos = anos & " anos " Else anos = anos & " ano " End If If meses > 1 Then meses = meses & " meses " Else meses = meses & " mês " End If If dias > 1 Then dias = dias & " dias " Else dias = dias & " dias " End If diferença_datas = anos & meses & dias End Function
  4. agora se aguem quizer fazer um trem bom mesmo... rsrsrs... da uma olhadinha neste endereço ai e monta a função... rsrsrs...
  5. ta em visual-basic e num sei se funciona porque nunca testei, facil de converter para delphi...... Private Function diferença_datas(Dtini As Date, Dtfin As Date) 1 If IsNull(Dtini) Or Dtini > Now Or Dtini > Dtfin Then 2 MsgBox "Data inválida !", vbCritical, "Data Inválida" 3 Exit Function 4 End If 5 diferenca = Dtfin - Dtini 6 xAnos = diferenca / 365.25 7 anos = Int(xAnos) 8 xMeses = (xAnos - anos) * 12 9 meses = Int(xMeses) 10 dias = DateDiff("d", DateSerial(DatePart("yyyy", Dtini) + anos, _ DatePart("m", Dtini) + meses, Day(Dtini)), Dtfin)
  6. é isso mesmo s3c, se pedir o tempo entre 5 anos = 60 meses... acho o que ele quer é tempo decorrido, tipo, tantos anos, meses, dias, horas, minutos, segundos... heheheh como eu só precisava do tempo em anos, a minha já matou a pau...
  7. aqui tem um componente que uso para saber a idade em anos e funciona beleza.. component....DTCalc.pas ---------------------------------------- {*************************************************************} { DateTime Calculator component for Delphi 16/32 } { Version: 1.3 } { Author: Aleksey Kuznetsov } { E-Mail: info@utilmind.com } { Home Page: http://www.utilmind.com } { Created: May, 12, 1999 } { Modified: August, 3, 1999 } { Legal: Copyright (c) 1999, UtilMind Solutions } {*************************************************************} { TDTCalc (in English) } { Component for calculation of amount of years, months, days, } { hours, minutes, seconds and miliseconds past between two } { time intervals. } {*************************************************************} { TDTCalc (in Russian) } { Êîìïîíåíòà äëÿ âû÷èñëåíèÿ êîëè÷åñòâà ëåò, ìåñÿöåâ, äíåé, } { ÷àñîâ, ìèíóò, ñåêóíä è ìèëèñåêóíä ïðîøåäøèõ ìåæäó äâóìÿ } { îòðåçêàìè âðåìåíè. } {*************************************************************} { PROPERTIES: } { StartTime, EndTime: TDateTime; - Range of time interval. } { READ ONLY PROPERTIES: } { Years: LongInt } { Months: LongInt } { Days: LongInt } { Hours: LongInt } { Minutes: LongInt } { Seconds: LongInt } { MSeconds: LongInt } {*************************************************************} { Please see demo program for more information. } {*************************************************************} { IMPORTANT NOTE: } { This software is provided 'as-is', without any express or } { implied warranty. In no event will the author be held } { liable for any damages arising from the use of this } { software. } { Permission is granted to anyone to use this software for } { any purpose, including commercial applications, and to } { alter it and redistribute it freely, subject to the } { following restrictions: } { 1. The origin of this software must not be misrepresented, } { you must not claim that you wrote the original software. } { If you use this software in a product, an acknowledgment } { in the product documentation would be appreciated but is } { not required. } { 2. Altered source versions must be plainly marked as such, } { and must not be misrepresented as being the original } { software. } { 3. This notice may not be removed or altered from any } { source distribution. } {*************************************************************} unit DTCalc; interface uses {$IFDEF Win32} Windows, {$ELSE} WinTypes, WinProcs, {$ENDIF} SysUtils, Classes; type TDTCalc = class(TComponent) private FStartTime, FEndTime: TDateTime; FYears, FMonths, FDays, FHours, FMinutes, FSeconds, FMSeconds: LongInt; procedure SetStartTime(Value: TDateTime); procedure SetEndTime(Value: TDateTime); procedure Calculate; public published property StartTime: TDateTime read FStartTime write SetStartTime; property EndTime: TDateTime read FEndTime write SetEndTime; property Years: LongInt read FYears; property Months: LongInt read FMonths; property Days: LongInt read FDays; property Hours: LongInt read FHours; property Minutes: LongInt read FMinutes; property Seconds: LongInt read FSeconds; property MSeconds: LongInt read FMSeconds; end; procedure Register; implementation {$R *.RES} procedure TDTCalc.SetStartTime(Value: TDateTime); begin FStartTime := Value; Calculate; end; procedure TDTCalc.SetEndTime(Value: TDateTime); begin FEndTime := Value; Calculate; end; procedure TDTCalc.Calculate; var e: Extended; TempStr: String; procedure Truncate(var Value: LongInt); begin try Value := Trunc(e); except Value := -1; end; end; begin e := MSecsPerDay * (FEndTime - FStartTime); Truncate(FMSeconds); TempStr := IntToStr(FMSeconds); if TempStr[Length(TempStr)] = '9' then inc(FMSeconds); e := e / 1000; Truncate(FSeconds); e := e / 60; Truncate(FMinutes); e := e / 60; Truncate(FHours); e := e / 24; Truncate(FDays); FMonths := Trunc((FEndTime - FStartTime) / 30.4375); FYears := Trunc((FEndTime - FStartTime) / 365.25); end; procedure Register; begin RegisterComponents('ESC', [TDTCalc]); end; end. ------------------------------------------ como usar o componente ------------------------------------------ DTCalc1.StartTime := dataset.FieldByName('nascimento').AsDateTime; DTCalc1.EndTime := now; dataset.FieldByName('idade').AsInteger := DTCalc1.Years; --------------------------------------------
  8. FIELD FORNECEDOR MUSTA HAVE A VALUE O campo FORNECEDOR "TEM QUE TER UM VALOR!!!!!"!!!!!.... ve onde voce preenche os campos pois você esta deixando este campo em branco e ele precisa de um valor... abraços...
  9. Boa dica... mas se for pra jogar para o MEMO... memo1.lines.LoadFromFile( 'c:\dirname\filename.txt');
  10. escobar

    Url No Webbrowser

    Um jeito facil e rápido... mas voce também pode dar uma olhada nas funções ExtractFileDir() ExtractFileDrive() ExtracFileExt() ExtractFileName() ExtractFilePath() ExtractRelativePath() ExtractShortPathName() e montar algo que leia o PATH que você esta e configure uma string com o caminho... // abaixo um exemplo simples e pratico (meio gambiara mas bem pratico... ) var str_path : string; begin memo1.lines.loadfromfile('path.txt'); str_path := memo1.lines.text; frmAjuda.WebBrowser1.Navigate(str_path+'ajuda6.htm'); end; -------------------------------- conteudo do arquivo path.txt c:/projetos/Carla/Terraco/ --------------------------------
  11. TFormChannel = class(TForm) FormStyle = fsMDIChild;
  12. Bom num sei se entendi... mas... Para criar um arquivo em outra maquina, (se estivermos falando de dois micros e criar o arquivo na outra maquina atraves da rede), voce precisa compartilhar o diretório e mapea-lo na outra maquina, ou apenas indicar o caminho da rede para onde você quer que o arquivo seja criado... tipo: \\maquina\dircompartilhado\diretorio\nomearquivo.txt var F: TextFile; begin AssignFile(F, '\\maq\dircomp\diretorio\NEWFILE.$$$'); Rewrite(F); Writeln(F, 'Just created file with this text in it...'); CloseFile(F); end; agora num sei, , se era isso que voce queria, seja mais especifica se não for isso...
  13. O código que coloquei acima, esqueci de mencionar que este código esta dentro do OnShow do FormMDI-Pai
  14. Tenho uma aplicação DELPHI que quando inicio a aplication no FORMPai, na hora do ONSHOW criou umas 4 MDIChild, mas gostaria que elas ficassem invisiveis, alguém sabe como fazer isso ? Tentei "F_MDIChild.Visible := false", mas na hora que a aplicação inicia, ele diz "Cannot hide an MDI Child Form." isso tanto faz com o VISIBLE ou HIDE, alguém sabe de uma outra forma ??
  15. Voce pode criar chaves no registro para expirar dai trinta dias. Voce pega a data atual, soma 30 salva, ai cada vez que ele abrir o programa o programa salva a data atual e compara para ver se venceu, ai se ele tentar voltar a data já num vai virar pois você também testa a data que voce grava todo dia... e assim vai...
×
×
  • Criar Novo...