Log in

View Full Version : Amount error



Meanage
07-01-2007, 09:37 AM
Hey, Im trying to get the amount of something as an integer so i can use it not just
if amount(ji-go,1) > 2 then..... like everyone else seems to use it as.

this is what Ive got

Procedure SetUpScript;
begin
SetupSRL;
CashStart:=0;
ChaosStart:=0;
DeathStart:=0;
CashStart : = (Amount('inv',1));
ChaosStart: = (Amount('inv',2));
DeathStart: = (Amount('inv',3));
end;

but it keeps giving me an error.
Failed when compiling
Line 17: [Error] (15042:11): Assignment expected in script

Does anyone know whats wrong? its probly a stupid error because I havnt scripted for ages. Cheers

Pentti
07-01-2007, 09:49 AM
Do not add spaces between ":" and "="
Also you dont need:
CashStart:=0;
ChaosStart:=0;
DeathStart:=0;
Becasue you set the value to them after those three lines, lol.

Killerdou
07-01-2007, 09:49 AM
{.include srl/srl.scar}
{.include srl/srl/misc/amount.scar}
var
cashstart, chaosstart, deathstart : integer;
Procedure SetUpScript;
begin
SetupSRL;
CashStart:=0;
ChaosStart:=0;
DeathStart:=0;
CashStart := Amount('inv',1);
ChaosStart := Amount('inv',2);
DeathStart := Amount('inv',3);
end;

begin
setupscript;
end.

works for me...

Meanage
07-01-2007, 09:54 AM
Cool thanks guys, I thought it would be something dumb like that.

@ Pentti I put that there and the brackets and stuff because I was trying random things to get it to work.