Ver Mensaje Individual
  #5  
Antiguo 04-07-2007
gabrielkc gabrielkc is offline
Miembro
 
Registrado: jun 2007
Ubicación: Chihuahua Mexico
Posts: 118
Reputación: 17
gabrielkc Va por buen camino
Existe otra forma de usar las funciones cuando solo la vas a llamar desde un procedimiento

Código Delphi [-]
procedure TfrmEtiquetas.AbrirpuertoClick(Sender: TObject);
  Function TfrmEtiquetas.LeePeso(var peso: double) : boolean;
  var
  buff : string;
  intentos : integer;
  lectura_correcta : boolean;
  begin
   buff := 'P'+chr(13)+chr(10);
   PesoPort.WriteText(buff);
   //Una espera inicial de .3 segundos
   sleep(300);
   intentos := 0;
   etc etc etc...
  end;

var Var_boolean:Boolean;
begin
 if OHAUS.Checked then
  begin
   showmessage('Código para OHAUS');
   Var_boolean:=LeePeso(peso);   
  end;
end;
Responder Con Cita