Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

compiler bug

Jasmin Summers
Registered User
Join date: 16 Feb 2006
Posts: 23
06-04-2006 11:54
is there a limit to how many variables someone can declare?

I have about 20 in 1 script to keep track of different information like profit, money in, money out etc but when ever i try to add one more, i get a syntax error.

Here are some screens:

COMPILES:
http://save-host.com/bug/compiles.jpg

DOESN't COMPILE:
http://save-host.com/bug/doesntcompile.jpg

You will see that adding 3 new variables causes a syntax error when there is no syntax error. There are no duplicate variable names or anything like that. The only reason I can think of this happening is because there are too many variable declarations but still, that seem's a bit odd.


edit: ahh this is so frustrating! When ever i try to add a variable to something like ....

play(integer score, integer a, integer b)
{
//...code omitted
}

...it says syntax error aswell but when ever i left it as...

play(integer score)
{
//...code omitted
}

.. it compiles! Again, there are no duplicate variables (and if there was then it wouldn't report a syntax error, it would say "Name previously declared within scope";) Why is this happening??
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
06-04-2006 12:01
Where it compiles, add a llOwnerSay(llGetFreeMemory()); in state entry.
How much is left?
Jasmin Summers
Registered User
Join date: 16 Feb 2006
Posts: 23
06-04-2006 12:03
3797
Jasmin Summers
Registered User
Join date: 16 Feb 2006
Posts: 23
06-04-2006 12:06
memory left is 3797


an empty script with only

default
{
state_entry()
{
llOwnerSay((string)llGetFreeMemory());
}
}


gives 16172 so there should still be enough memory for 3 more variables. What ever this is measured in, 1 variable only takes 10 off of the free memory count and if it was out of memory it wuold stack heap right?

btw u forgot to turn it into a string, u can't say integers ;)
Adriana Caligari
Registered User
Join date: 21 Apr 2005
Posts: 458
06-04-2006 14:27
Try splitting the script in two or reducing it somehow

I had similar quite a while back - added a new condition and bam syntax error where there was none.

It turned out to be the physical size of the script - I rationalized it and took out a lot of the llOwnerSay debugs i used and suddenly the new statement fit in and compiled perfectly.
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
06-04-2006 15:33
From: Jasmin Summers

btw u forgot to turn it into a string, u can't say integers ;)


Meh. At least you knew what I mean, I know some people who'd be like, "do what now?"

From: Adriana Caligari
Try splitting the script in two or reducing it somehow

I had similar quite a while back - added a new condition and bam syntax error where there was none.

It turned out to be the physical size of the script - I rationalized it and took out a lot of the llOwnerSay debugs i used and suddenly the new statement fit in and compiled perfectly.


That might be it. Take out or shorten unneeded comments too.
Sean Gorham
Stopped making sense
Join date: 5 Mar 2005
Posts: 229
06-04-2006 15:43
From: Draco18s Majestic
Take out or shorten unneeded comments too.

Comments don't take up memory in a compiled script. Leave the comments in. Six months from now you'll need them. :D
_____________________
COOL GEAR BY GORHAM
Clothing, Animations, Gadgets and More!
Serpent Isle | Magenta | Manhunt Mall | Sylvina
SLBoutique | SL Exchange
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
06-04-2006 22:02
From: Sean Gorham
Comments don't take up memory in a compiled script. Leave the comments in. Six months from now you'll need them. :D

They do take space in the uncompiled script though, which is possibly where the problem is. I also had a problem with the length of a script, even though there was memory available, very similar to this and Adriana's problems.
_____________________
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
06-04-2006 22:41
Hence why I said unnessesary comments.