Proyecto

General

Perfil

Descargar (1,26 KB) Estadísticas
| Rama: | Revisión:
23a384b9 Elisa
unit global;

{$mode objfpc}{$H+}

interface
uses
unix,Classes, SysUtils;
type
EDialogos = (Aceptar,SiNo);
TDialogo=Record
mensaje:string;
ClaseDialogo:Edialogos;
respuesta:integer;
end;
var
g_tiempoempleado:integer;
g_mihost, g_hostprofe,g_usuario,g_dirpersonal:string;
TipoDialogo:Tdialogo;
Function HallarDato(Cmd:string):string;
Function Mensaje(texto:string;clase:edialogos):integer;

implementation

uses dialogos;
Function Mensaje(texto:string;clase:edialogos):integer;
begin
tipodialogo.mensaje:=texto;;
tipodialogo.clasedialogo:=clase;
Tfrmdialogos.Create(nil).ShowModal;
result:=tipodialogo.respuesta;
frmdialogos.Free;
end;

function HallarDato(Cmd:string):String;
var
file1: TextFile;
s,t: ansistring;
n: longint;
j:integer;
begin
j:=0;
n:=popen(file1, Cmd, 'r');
if n=-1 then
begin
result:='';
Mensaje('Error al hallar dato',Aceptar);
Exit;
end;
t:='';
while not eof(file1) do begin
Readln(File1,s);
t:=t+s+Chr(10);
inc(j);
end;
pclose(file1);
result := trim(t);
end;
end.