Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 24-02-2008
rauros rauros is offline
Miembro
 
Registrado: feb 2008
Ubicación: Alicante - Sax / Sax - Alicante
Posts: 235
Poder: 17
rauros Va por buen camino
Problema con bucle.

Saldudillos. He creado un pequeño programa para abrir una pagina web cada 35 segundos. El problema es que se abren todas casi al inmediato. Os pongo el sistema de bucle: (PD: no hay errores de sintaxis)

Botón que hace empezar:

Código Delphi [-]
procedure TForm1.Button2Click(Sender: TObject);
begin
timer1.Enabled:=True;
timer1.Interval:=1
end;

Bucle de tipo timer:
Código Delphi [-]
procedure TForm1.Timer1Timer(Sender: TObject);
begin
y:=StrToInt(edit21.Text);
if x < y then begin
x:= x + 1;
case x of
1:  ShellExecute(Handle, 'open', PChar(edit1.text), nil, nil, SW_SHOWNORMAL);
2:  ShellExecute(Handle, 'open', PChar(edit2.text), nil, nil, SW_SHOWNORMAL);
3:  ShellExecute(Handle, 'open', PChar(edit3.text), nil, nil, SW_SHOWNORMAL);
4:  ShellExecute(Handle, 'open', PChar(edit4.text), nil, nil, SW_SHOWNORMAL);
5:  ShellExecute(Handle, 'open', PChar(edit5.text), nil, nil, SW_SHOWNORMAL);
6:  ShellExecute(Handle, 'open', PChar(edit6.text), nil, nil, SW_SHOWNORMAL);
7:  ShellExecute(Handle, 'open', PChar(edit7.text), nil, nil, SW_SHOWNORMAL);
8:  ShellExecute(Handle, 'open', PChar(edit8.text), nil, nil, SW_SHOWNORMAL);
9:  ShellExecute(Handle, 'open', PChar(edit9.text), nil, nil, SW_SHOWNORMAL);
10: ShellExecute(Handle, 'open', PChar(edit10.text), nil, nil, SW_SHOWNORMAL);
11: ShellExecute(Handle, 'open', PChar(edit11.text), nil, nil, SW_SHOWNORMAL);
12: ShellExecute(Handle, 'open', PChar(edit12.text), nil, nil, SW_SHOWNORMAL);
13: ShellExecute(Handle, 'open', PChar(edit13.text), nil, nil, SW_SHOWNORMAL);
14: ShellExecute(Handle, 'open', PChar(edit14.text), nil, nil, SW_SHOWNORMAL);
15: ShellExecute(Handle, 'open', PChar(edit15.text), nil, nil, SW_SHOWNORMAL);
16: ShellExecute(Handle, 'open', PChar(edit16.text), nil, nil, SW_SHOWNORMAL);
17: ShellExecute(Handle, 'open', PChar(edit17.text), nil, nil, SW_SHOWNORMAL);
18: ShellExecute(Handle, 'open', PChar(edit18.text), nil, nil, SW_SHOWNORMAL);
19: ShellExecute(Handle, 'open', PChar(edit19.text), nil, nil, SW_SHOWNORMAL);
20: ShellExecute(Handle, 'open', PChar(edit20.text), nil, nil, SW_SHOWNORMAL);
end;
timer1.interval:=35000;
end
else exit;
end;

Nota: También hay un error, que es que cuando acaba de abrir todas las páginas (cuando valor x llega a ser como valor y) no cierra (exit).
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Bucle for de 2 en 2 douglas OOP 9 17-10-2007 15:55:53
bucle infinito emeceuy Varios 10 20-07-2007 20:28:55
Problema en bucle CarmaZone Tablas planas 6 20-01-2006 09:51:20
bucle dentro de un bucle Cosgaya Varios 2 06-06-2005 07:05:16
problema con bucle while do acrophet Varios 1 16-09-2004 14:13:02


La franja horaria es GMT +2. Ahora son las 18:37:59.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi