rj
2014-01-03 00:06:44
Why am I getting a unknown identifier error?

How is it not finding init?

How is it not finding init?
2014-01-03 00:06:44

2014-01-03 03:01:18
2014-01-03 07:06:45
2014-01-03 10:41:14
2014-01-03 12:35:03
From: Officer Barbrady
@Kasi;
the inventory var is declined in inventory.simba, and it's not finding it because I tired to do writeln(inventory.slots) and I got unknown identifier
@bgs5;
I changed the name of screen to init to mainscreen.init (because mainscreen was the name of the var pointing to screen, mistake on my part) and it the error still showed up on the line below.
I also changed it up inventory.startup or mainscreen.startup with the same error so I'm pretty sure it's not including the file or something
2014-01-03 12:44:07
From: Brandon
You're going to have to show more code that a screenshot. I doubt anyone at all can tell what is going on based off just that snippet. We cannot see the declaration of any variables.
{$I RSPS/srlRSPS.Simba}
var
myServer:_rsps_server;
begin
myServer.init(720, 'CloudIn');
writeln(myServer.getupText);
writeln(inventory.count);
end. 2014-01-04 14:59:20
2014-01-04 15:03:44
From: Kasi
@Officer Barbrady;
It is finding it, its finding two different things called inventory. No idea what two things, but my guess is something to do with the file name too, Couldn't be bothered searching all your include for another variable called inventory (shouldn't be as it would give of Duplicate identifier error). Quick fix = rename line 16 in inventory.simba to something else e.g (inventory : rsps_inventory; = inventory1 : rsps_inventory;)
2014-01-04 15:09:00
From: Officer Barbrady
Now I'm getting access violation -.-
Exception in Script: Runtime error: "Access violation"
going to be hard to find
From: nielsie95
Compiler directivesUsed like {$Align 4} to align record fields on 4 bytes (this means a record with only a byte field is still 4 bytes long). This is added for compatibility with external records.
- a, align - To determine how records are aligned
- c, assertions - Compile assertions
- b, booleval - Short circuit boolean evaluation
- m, memoryinit - Initialize all variables to zero
- x, extendedsyntax - Allow statements outside of regular blocks
- f, autoinvoke - Allow invocation of methods without explicit parenthesis
- s, scopedenums - Do not add enums to the scope (access through enum.field)
Used like {$B+}, {$B-} or {$B ON}, {$B OFF}.
2014-01-04 15:18:32
From: Kasi
Learn Compiler Directives.
Parenthesis
mainscreen started!
starting!
Outline set!
Starting setup procedure
Setting length
Exploded box
Exception in Script: Runtime error: "Access violation"with self do
begin
Writeln('starting!');
outline := 131072;
Writeln('Outline set!');
setUp(IntToBox(568, 213, 717, 458));
Writeln('Box array set!');
bounds := intToBox(568, 213, 717, 458);
Writeln('Bounds set!');
name := '724 inventory';
end; setUp(IntToBox(568, 213, 717, 458));
procedure rsps_inventory.setUp(b:tbox);
begin
Writeln('Starting setup procedure');
setLength(self.slots, 28);
Writeln('Setting length');
self.slots := self.explodeBox(b, 7, 4);
Writeln('Exploded box');
end; 2014-01-04 15:47:48
From: Officer Barbrady
But cannot reach this part
bounds := intToBox(568, 213, 717, 458);
2014-01-04 16:25:19
From: Kasi
is "bounds" a member of rsps_inventory.
Edit: how did you get your test script to compile? i'm debugging blind here. don't have any RSPS to test your include on. AFAIK your test script should of error'd out on writeln(myServer.getupText);
type
rsps_interface = record
name:string;
close:TPoint;
bounds:TBox;
end; {$I RSPS/srlRSPS.Simba}
var
myServer:_rsps_server;
begin
myServer.init(720, 'CloudIn');
writeln(myServer.getupText);
writeln(inventory.count);
end.
2014-01-05 09:57:23
{$I RSPS/srlRSPS.Simba}
var
myServer:_rsps_server;
begin
myServer.init(720, 'CloudIn');
writeln(myServer.getupText());
writeln(inventory.count);
writeln(inventory.bounds);
end.
Compiled successfully in 327 ms.
mainscreen started!
starting!
Outline set!
Starting setup procedure
Setting length
Exploded box
Box array set!
Bounds set!
Inventory started!
. .. :e - -s--s-
0
{X1 = 568, Y1 = 213, X2 = 717, Y2 = 458}
Successfully executed.
2014-01-05 11:15:21
From: Kasi
@Officer Barbrady;
Works fine for me.
{$I RSPS/srlRSPS.Simba}
var
myServer:_rsps_server;
begin
myServer.init(720, 'CloudIn');
writeln(myServer.getupText());
writeln(inventory.count);
writeln(inventory.bounds);
end.
Compiled successfully in 327 ms.
mainscreen started!
starting!
Outline set!
Starting setup procedure
Setting length
Exploded box
Box array set!
Bounds set!
Inventory started!
. .. :e - -s--s-
0
{X1 = 568, Y1 = 213, X2 = 717, Y2 = 458}
Successfully executed.
2014-01-05 14:59:21
From: Officer Barbrady
Ahh I see you did the uptext differently -.-