Log in

View Full Version : [ERROR] - Unknown identifier



scrubz
08-06-2012, 12:33 PM
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('mbQAAAHicY2VgYJBmYmDQAmIeINYDYnYgfs bIwHANiK8C8Vcg/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
08-06-2012, 12:34 PM
You didn't declare the variable Chest. Declare it locally:

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

scrubz
08-06-2012, 01:07 PM
Ah ok, it works now but may i ask why would it be declared as a integer if it is a DTM string?

riwu
08-06-2012, 01:11 PM
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
08-06-2012, 01:23 PM
Thank you for clearing that up, +rep for the assistance.

Cheers.