SRL Archive - Help

[ERROR] - Unknown identifier


scrubz

2012-08-06 08:33:06

Hi all,

I am in the process of writing my first script, i have an Unknown identifier error when attempting to compile, it is in regards to this line:


[Error] C:\Simba\Scripts\Chest V0.1.simba(77:5): Unknown identifier 'Chest' at line 76

This is the code it is stopping at


repeat
Inc(FailSafe);
O_Debug('CHEST','Disabling The Trap')
(this is line 76) Chest := DTMFromString('mbQAAAHicY2VgYJBmYmDQAmIeINYDYnYgfsbIwHANiK8C8Vcg/gLEwZ4WDKlhugxZ2WkM6RF6YBobYMSCwQAAr2kKOQ==');
Uptext := 'pen Chest';

I have tried searching, but being new to this i can't seem to find what will help me.

Thank you.

riwu

2012-08-06 08:34:28

You didn't declare the variable Chest. Declare it locally:

procedure UrProcedureName;
var
Chest: Integer;
begin
//rest of code
end;

scrubz

2012-08-06 09:07:29

Ah ok, it works now but may i ask why would it be declared as a integer if it is a DTM string?

riwu

2012-08-06 09:11:40

It's DTM from a string (like the name suggests, which means DTM is not a string), DTMs are declared and stored as integer. If you have doubts over what a function returns, just use the function list and check the output result of the function.

scrubz

2012-08-06 09:23:36

Thank you for clearing that up, +rep for the assistance.

Cheers.