Ver Mensaje Individual
  #4  
Antiguo 07-02-2008
cmm07 cmm07 is offline
Miembro
 
Registrado: nov 2007
Posts: 526
Reputación: 17
cmm07 Va por buen camino
no te entendí mucho pero si lo que quieres decir es pasarlo a numerico quedaría así

Código Delphi [-]
procedure TForm1.Timer1Timer(Sender: TObject);
function stripped(stripchar : char; str : string) : string;
var
  tmpstr : string;
begin
  tmpstr := str;
  while pos(stripchar, tmpstr) > 0 do
    delete(tmpstr, pos(stripchar, tmpstr), 1);
  stripped := tmpstr;
end;

var
Hora: Integer;
begin
LReloj2.Text := FormatDateTime('hh:mm',Time);
Hora:= StrToInt(Stripped(':', LReloj2.Text));
 If Hora >= 1200 then
begin
Button1.Caption:= 'Registrar la Entrada de la Tarde';
   end
else
Button1.Caption:= 'Registrar la Entrada de la Mañana';
end;


mas corto el codigo:

Código Delphi [-]
var
Hora: Integer;
begin
LReloj2.Text:= FormatDateTime('hh:mm',Time);
Hora:= StrToInt(Copy(LReloj2.Text, 0, 2)+Copy(LReloj2.Text, 4, 5));
 If Hora >= 1200 then
begin
Button1.Caption:= 'Registrar la Entrada de la Tarde';
   end
else
Button1.Caption:= 'Registrar la Entrada de la Mañana';

si es así entonces no necesitaria ese LReloj2.

*recuerda colocar eso en un timer y esto en un form en oncreate:

Código Delphi [-]
Timer1.Enabled:= True;
Timer1.Interval:= 1;

Última edición por cmm07 fecha: 07-02-2008 a las 17:01:57.
Responder Con Cita