Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Seperating If-statements?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I just cant find out how to use more then 1 If-statement in the same procedure...ex:

If bla-bla Then
Do this;
end;

<This is what I dont know>

If bla-bla-bla Then
Do that;
end;

(It´s the same thing as &quot;EndIf&quot; in VB)

Thanks in adv. :)
 
if blabla = true then
dothis
else
dothat;


another construction is case

case option of
bla: do_this;
blabla : do_that;
blablabla: do_that_also
else do_nothing_at_all;
end; //case}

There is no endif in Delphi or Pascal. We work with begin & end

In your form write if or case, highlight it, press F1 and be enlighted by the built in help file

Regards

S. van Els
SAvanEls@cq-link.sr
 
Alternatively try code :
If Bla-bla then
DoThis;
Else if Bla-Bla-Bla then
DoThat;
Else
DoSomethingElse;

Steve
 
Hi Stoppel,

Try it like this :

IF blablablablabla THEN
BEGIN

command1
command2
command3
command4
etc ....
END
ELSE
BEGIN

command1
command2
command3
command4
etc ....
END Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
Be a nice guy 'n press that little ol' button
VVV---(this one) for me ;-)
 
i would go with the switch statement above. it is easier coded, easier read and more efficient than using multiple if statement.

default can be used as the ultimate exception at the end.

case option of
1:
2:
3:

Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top