SRL Archive - OSR Help

Procedure using Text Variable


mat_de_b

2011-06-11 07:40:42

Procedure StateFunc(Var Text: string);
Begin
State := Text ;
End;

Procedure WithdrawLogs;
Begin
StateFunc('Withdrawing Logs');
Withdraw(0,0,0);
End;

Im trying to use a procedure I made called 'StateFunc' (as it was originally a function) to determine what 'state' the script is in.

The procedure, Changes the 'state' variable (a string) to whatever the input variable of the procedure is. It Then runs a progress report so that the state gets printed to smart and into the debug box.

It basically stops me having to keep writing:

State := 'xxx' ;
ProgressReport;

So instead i can just write

StateFunc('xxx');


However currently when it tries to compile it says 'expected variable' and highlights the first 'statefunc' procedure ( the part during the banking procedure not the actual statefunc procedure).

What am i doing wrong?

mat_de_b

2011-06-11 07:46:21

Ok i found the solution.

The Procedure has to be followed by a predetermined string variable, like the one i'm trying to change.

This means that his procedure is pretty much unnecessary, is there any way of changing that?

I mean so that the input can be ('xxx') instead of (Name of String Variable)

masterBB

2011-06-11 08:14:30

fixed
Procedure StateFunc***40;Text: string***41;;
Begin
State := Text ;
End;

Procedure WithdrawLogs;
Begin
StateFunc***40;'Withdrawing Logs'***41;;
Withdraw***40;0,0,0***41;;
End;

mat_de_b

2011-06-11 11:26:08

I'm not going to lie, I'm pretty embarrassed right now. Thank you SO much :D