SRL Archive - Help and Support

(sigh) more questions


weaselforce

2006-04-06 21:20:56

Procedure BankingWithdraw;
begin
if(inventorycount>0)then
DepositAll;
end else

says there should be a semicolon instead of "else"

its an if then statement…

Jagex_Fagex

2006-04-06 21:24:38

try putting

Procedure BankingWithdraw;
begin
if(inventorycount>0)then
[I]begin[/I]
DepositAll;
end else

i sometimes get that error, and when i put that in, it general works

Neonknight77

2006-04-06 21:25:40

Procedure BankingWithdraw;
begin
if(inventorycount>0)then
DepositAll;
end;

Jagex_Fagex

2006-04-06 21:40:21

^^^ i think he wants to keep it as an if then statment so he can have like

Procedure BankingWithdraw;
begin
if(inventorycount>0)then
DepositAll;
end else
if if(inventorycount<0)then
………..

weaselforce

2006-04-06 22:01:52

mmm thats tasty, thank you. i just thought it wasnt required, o well

Jagex_Fagex

2006-04-06 22:04:50

well, i dunno, normally i don't then i get the error…so i dunno, does it work now?

Bebe

2006-04-06 22:05:57

Procedure BankingWithdraw;
begin
if(inventorycount>0)then
DepositAll
end
else

Should work :)

XxKanexX

2006-04-07 01:34:27


Procedure BankingWithdraw;
begin
if(inventorycount>0)then
DepositAll
else
DoSomethingElse;
end;

You only use begin and ends if you want scar to perform more than 1 function:


begin
if(1 = 1)then
begin
Writeln('First thing');
Writeln('Second thing');
end;
end.
If i only wanted to do the first thing i wouldn't put in a begin and end:

begin
if(1 = 1)then
writeln('First thing');
end.
:)

phantombmx

2006-04-07 01:43:45

haha kane i put a begin-end in there anyway.. just to understand it in the little world that is mine :p :D

XxKanexX

2006-04-07 01:45:46

From: phantombmx
haha kane i put a begin-end in there anyway.. just to understand it in the little world that is mine :p :D

Most people do that. It dosn't make a difference. ;) Either ways fine.

I find that adding a Begin and End even if it's just 1 function makes it more legible anyway. I just learnt that way. :p

phantombmx

2006-04-07 01:57:53

From: XxKanexX
Most people do that. It dosn't make a difference. ;) Either ways fine.

I find that adding a Begin and End even if it's just 1 function makes it more legible anyway. I just learnt that way. :p


yeah same here.. any if-thens or whiles or anything of the sort i always put a begin-end

weaselforce

2006-04-07 02:28:02

yea works great, so weird though, they were all working fine. then POOF!

XxKanexX

2006-04-07 06:21:38

From: weaselforce
yea works great, so weird though, they were all working fine. then POOF!

That tends to happen when you're learning ;)

Just remember though. Don't hesistate to post questions. No matter how many times you ask, someone will always help.

Don't get angry with your scripts either. It just makes things worse. :p