Lee Ludd
Scripted doors & windows
Join date: 16 May 2005
Posts: 243
|
06-13-2005 19:52
The following code fragment won't compile if (tag == "disallow"  { item = llListFindList(user_list, [value]); if (item > -1) user_list = llDeleteSubList (user_list, item, item); } I get the message "ERROR : Syntax error:, with the cursor sitting just in front of the last mention of the variable "item" in the last line. The variables are all properly declared. Can anybody spot what I'm doing wrong here?
|
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
|
06-13-2005 20:18
It compiles fine for me. Maybe the problem is elsewhere? I do notice you have a space between llDeleteSubList and the brackets following it. That should compile okay though.
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
06-13-2005 21:12
From: Lee Ludd if (tag == "disallow"  { item = llListFindList(user_list, [value]); if (item > -1) user_list = llDeleteSubList (user_list, item, item); } If I would put down this code, I would do like this. if (tag == "disallow") { item = llListFindList(user_list, [value]); if (item > -1) { user_list = llDeleteSubList (user_list, item, item); } } I'm not sure if it needs or not.
_____________________
 Seagel Neville 
|
Lee Ludd
Scripted doors & windows
Join date: 16 May 2005
Posts: 243
|
06-14-2005 04:09
The actual coded is formatted as you suggest. I don't know how to display it in a forum message that way.
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
06-14-2005 06:42
I mean, I guess you need brackets after second if-statement though... 
_____________________
 Seagel Neville 
|
cell Neutra
That's L$50k please
Join date: 26 Sep 2004
Posts: 28
|
06-14-2005 11:54
theoretically brackets aren't needed in if/else if only one command line is used. However, I almost always put them because I have come across compilers that will actually cause an error without them when it shouldn't. In most cases though, that shouldnt need brackets. I'm just posting on forums cause I'm bored btw =)
Rayve Mendicant cell Neutra Pushing The Limits
|
Seagel Neville
Far East User
Join date: 2 Jan 2005
Posts: 1,476
|
06-14-2005 18:03
Hello cell, I appreciate your beeing bored.  You clarified it and I learned. Thank you. 
_____________________
 Seagel Neville 
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
06-14-2005 20:33
It's possible if your logic is very complex that you have run out of memory in the compiler which will produce random placed errors.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|