Delphi - Ayuda urgente

 
Vista:

Ayuda urgente

Publicado por MANY (46 intervenciones) el 06/10/2011 17:22:25
Tengo este problema


if codigo.text = ' ' then
begin
------
-----
-----

else
begin
-----
--
-------
end

quiero saber de que manera puedo suspender el recorrido de mi programa sin tener que usar else.

ejemplo

if codigo.text = 1
begin
----
---
ponder aqui regresar al formulario sin que el control ejecute los comandos que continuan.

end;


es decir que no entre aqui

if codigo.text = ' ' then
begin
------
-----
-----

else
begin
-----
--
-------
end
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 65
Oro
Ha mantenido su posición en Delphi (en relación al último mes)
Gráfica de Delphi

Ayuda urgente

Publicado por E.T. (1244 intervenciones) el 06/10/2011 17:41:43
Existe para este caso, precisamente: Exit;

Exits from the current procedure.

Unit

System

Category

flow control routines

Delphi syntax:

procedure Exit;

Description

In Delphi, the Exit procedure immediately passes control away from the current procedure. If the current procedure is the main program, Exit causes the program to terminate.

Exit will cause the calling procedure to continue with the statement after the point at which the procedure was called.

Note: Exit passes control away from the current procedure, not merely the current block. But Exit does not violate the flow of control dictated by a try..finally construct; if Exit is called inside the try clause, the finally clause is still executed.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar