ok, so in my absence i have completely forgotten cases.. i cannot dl tutorial.exe as teh site is down.. anyone wanna go through it with me please?
ok, so in my absence i have completely forgotten cases.. i cannot dl tutorial.exe as teh site is down.. anyone wanna go through it with me please?
SCAR Code:Case Boolean Of
True : Begin Wait(1) End;
False : Begin Wait(1) End;
End; // end the case
SCAR Code:Case Integer Of :
0: Begin Wait(1) End;
1: Begin Wait(1) End;
2: Begin Wait(1) End; // etc
End;
SCAR Code:Case String Of
'hi' : Begin Wait(1) End;
'lol' : Begin Wait(1) End;
End;
Boolean can be any boolean, same for integer and string
The best way to contact me is by email, which you can find on my website: http://wizzup.org
I also get email notifications of private messages, though.
Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
Documentation | Source | Simba Bug Tracker on Github and Villavu )
My (Blog | Website)
theres also this lesser known method. normally case statments only suppost a value being the same as the variable, in other words, using the =. but with this you can use < and >
Code:program New; const check=2; begin case true of check=5:writeln('check is equil to 5') check>5:writeln('check is bigger then 5') check<5:writeln('check is smaller than 5') end end.
Join the Official SRL IRC channel. Learn how to Here.
or instead of doing:
(As you can see they result in the same values.)Code:case s of 'we': i:= 1; 're': i = 1; end;
You can use commers to make it alot nicer.
Code:case s of 'we', 're': i:= 1; end;
There are currently 1 users browsing this thread. (0 members and 1 guests)