SRL Archive - OSR Help

Unknown declaration


rj

2013-09-28 18:22:49

Meh not to familiar with lape but I am getting a Unknown declaration error :s

{$i Soulsplit/core/SS_GameTab.simba}
{$i Soulsplit/core/SS_Interface.simba}
{$i Soulsplit/core/SS_Inventory.simba}
{$i Soulsplit/core/SS_Minimap.simba}
{$i Soulsplit/core/SS_Prayer.simba}

const
Revision = 0;

type main = record
debugMode:boolean;
end;

function main.UpdateSSInclude:boolean;
begin
end;

procedure main.SetupSSInclude(update, debug:boolean);
begin
if debug then
main.debugMode := true;
Writeln('Setting up Soulsplit include revision ' + ToStr(Revision));
Writeln('Debug mode ' + ToStr(main.debugMode));
if update then
begin
if UpdateSSInclude then
begin
Writeln('There has been a update for the Include!');
TerminateScript;
end;
end;
// SS_inventory.Setup;
end;


Exception in Script: Unknown declaration "debugMode" at line 21, column 9 in file "C:\Simba\Includes\Soulsplit\SSInclude.simba"

How does it not know what debugMode is?

Test script is this

{$i Soulsplit/SSInclude.simba}

begin
main.SetupSSInclude(false, true);
end.

Gu3st...

2013-09-28 19:26:50

It doesn't know what variable named "main" you're reffering to.

To fix your problem, change the line "main.debugMode := true;" to "self.debugMode := true;" (main -> self)

rj

2013-09-28 22:17:51

From: Zyt3x
It doesn't know what variable named "main" you're reffering to.

To fix your problem, change the line "main.debugMode := true;" to "self.debugMode := true;" (main -> self)


Thanks, but having another issue: Exception in Script: Invalid type cast

-.-


here is the include: https://github.com/officerBarbrady/SSInclude

riwu

2013-09-28 22:30:01

From: Officer Barbrady
Thanks, but having another issue: Exception in Script: Invalid type cast

-.-


here is the include: https://github.com/officerBarbrady/SSInclude

Which line did the error occur in?

rj

2013-09-28 22:35:54

From: riwu
Which line did the error occur in?


Not sure that's all the error says :s

Flight

2013-09-28 22:52:28

I didn't include any of your Include but this compiled right up for me:

const
Revision = 0;

type main = record
debugMode:boolean;
end;

procedure main.SetupSSInclude(update, debug:boolean);
begin
if debug then
self.debugMode := true;
Writeln('Setting up Soulsplit include revision ' + ToStr(Revision));
Writeln('Debug mode ' + ToStr(self.debugMode));
if update then
begin
//if UpdateSSInclude then
begin
Writeln('There has been a update for the Include!');
TerminateScript;
end;
end;
// SS_inventory.Setup;
end;

Because in your "main.SetupSSInclude()" procedure it's directly referring to your "main" record so as Zyt3x said you will use self.(attribute) to set a variable within that type.

rj

2013-09-28 22:54:45

From: Flight
I didn't include any of your Include but this compiled right up for me:

const
Revision = 0;

type main = record
debugMode:boolean;
end;

procedure main.SetupSSInclude(update, debug:boolean);
begin
if debug then
self.debugMode := true;
Writeln('Setting up Soulsplit include revision ' + ToStr(Revision));
Writeln('Debug mode ' + ToStr(self.debugMode));
if update then
begin
//if UpdateSSInclude then
begin
Writeln('There has been a update for the Include!');
TerminateScript;
end;
end;
// SS_inventory.Setup;
end;

Because in your "main.SetupSSInclude()" procedure it's directly referring to your "main" record so as Zyt3x said you will use self.(attribute) to set a variable within that type.


lol had a misnamed record :( thanks though