Bajt 0 #1 Postado 26 Julho, 2009 Parte 1 [ame]http://www.youtube.com/watch?v=SctjeQXDJXU[/ame] Parte 2 [ame]http://www.youtube.com/watch?v=OGdrNV_K558[/ame] [spoiler=CÓDIGO COMPLETO] unit UPrincipal; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; a:integer; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin a:=strToInt(formatdatetime('hh',now)); if (a>=6) and (a<=12) then begin ShowMessage('A hora atual é '+formatdatetime('hh:mm',now)+#10+'Bom Dia!'); end else if (a>=12) and (a<=17) then begin showmessage('A hora atual é '+formatdatetime('hh:mm',now)+#10+'Boa Tarde!'); end else if (a>=18) and (a<=24) then begin showmessage('A hora atual é '+formatdatetime('hh:mm',now)+#10+'Boa Noite!'); end else if (a>=24) and (a<=6) then begin showmessage('A hora atual é '+formatdatetime('hh:mm',now)+#10+'Boa Madrugada!'); end; end; end. Compartilhar este post Link para o post Compartilhar em outros sites
Eventide 7 #2 Postado 28 Julho, 2009 Bem legal cara, mas olhando o código fonte, faltou uma identação ai.. =)~ Obrigado pela contribuição! Compartilhar este post Link para o post Compartilhar em outros sites
Bajt 0 #3 Postado 31 Julho, 2009 Se explicasse melhor eu agradeceria . Compartilhar este post Link para o post Compartilhar em outros sites