Cita:
Empezado por Delphius
Y bueno ya que andamos... también podemos usar otra variante (aprovechando el Memo): abrir un archivo que contenga estos datos.
E incluso podemos eliminar el timer y aún asi hacer que cada 35 segundos se visite una página. ¿O no ixMike  ?
Saludos,
|
y también hacer un programa sin ventana, que lea de un archivo los datos, tanto las páginas como el tiempo de espera. Sería algo así: dos archivos, MiniUnidad.pas, y MuestraPaginas.dpr
Código Delphi
[-]
unit MiniUnidad;
interface
const
SW_SHOWNORMAL = 1;
function ShellExecute(hWnd: Integer; Operation, FileName, Parameters,
Directory: PChar; ShowCmd: Integer): Integer; stdcall;
procedure Sleep(dwMilliseconds: Integer); stdcall;
function StrToInt(const S: String): Integer;
implementation
function ShellExecute; external 'shell32.dll' name 'ShellExecuteA';
procedure Sleep; external 'kernel32.dll' name 'Sleep';
function StrToInt(const S: String): Integer;
var n, r, m: integer;
begin
r:=0;
m:=1;
for n:=Length(S) downto 1 do
begin
Inc(r, (Ord(S[n])-48)*m);
m:=m*10;
end;
Result:=r;
end;
end.
Código Delphi
[-]
program MuestraPaginas;
uses MiniUnidad;
var
F: TextFile; L: String; T: Integer;
begin
AssignFile(F, ParamStr(0)+'.txt'); Reset(F);
ReadLn(F, L);
T:=StrToInt(L);
while not EOF(F) do
begin
ReadLn(F, L);
ShellExecute(0, 'open', PChar(L), nil, nil, SW_SHOWNORMAL);
Sleep(T);
end;
CloseFile(F);
end.
No lo he comprobado, pero debería funcionar.
Salu2
