when is an error not an error.
|
Rabit Aldrin
Registered User
Join date: 14 Jul 2009
Posts: 7
|
08-14-2009 03:35
I have got a few error messages for apparently no reason at all, at least so far as I can tell. The error console detects errors on lines Line (10,0): Line (15,0): Line (15,56): Line (19,0): Line (23,0): Error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement they're all the same error, but thought i'd unclutter it. The problem is that every one of those errors appears on the commented out header. Even when I delete the header, the errors appear on the same lines which is what leads me to the belief that the compiler is wrong. below is the code, thanks allot for any suggestions. Rabit Aldrin 0. // LSL script generated: Fri Aug 14 11:07:34 GMT Daylight Time 2009 1. 2. integer LMDA_SEPERATOR_LEN = 3; 3. ///////////////////////////////////////////////////////////////////////////////////////////// 4. // Library Multi-Dimensional Array 5. ///////////////////////////////////////////////////////////////////////////////////////////// 6. 7. 8. // Title: Library Multi-Dimensional Array (LMDA_) 9. // Author: ChristopherOmega 10. // 11. // Description: This script allows you to store data in lists as you would in a C++ or 12. // Java multidimensional array. It is a bit more flexible than those language's arrays, 13. // since it allows you to dynamically resize each dimension; You don't have to define 14. // the size of the array before you use it. If you ever ran into the "Runtime Error: 15. // Lists cannot contain lists" message and really needed a list within another, this is 16. // what you can use. 17. // Website: http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryMultidimensionalArray18. // Licence: Creative Commons Public Domain License. 19. // 20. 21. // Generates a random string of length len 22. // from the characters passed to it. 23. string LMDA_randomSeperator(integer len){ 24. integer firstChar = (((integer)llFrand(60)) + 20); 25. if ((len <= 1)) return llUnescapeURL(("%" + ((string)firstChar))); 26. integer lastChar; 27. do { 28. (lastChar = (((integer)llFrand(60)) + 20)); 29. } 30. while ((lastChar == firstChar));
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
08-14-2009 07:59
You must be using a different viewer than any I've used for compiling scripts; I don't remember seeing more than one error per compile (regardless of compiling LSL or Mono).
In any case, consider trying to compile a file that's complete, rather than an unfinished segment.
Add a closing brace to the function, and put a default state at the bottom, like this:
default { }
|
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
|
08-14-2009 08:33
Lear's right. You can't create a program with no default state. Even if you aren't using it, one must be there.
|
Rabit Aldrin
Registered User
Join date: 14 Jul 2009
Posts: 7
|
08-14-2009 09:04
sorry, I forgot to say, the file is complete and there is a default statement, its just that the file's over 200 lines so I didn't want to post it all (or add line numbers manually for so many lines =p) I created the file in LSL plus and the code comes from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryMultidimensionalArrayso it should really be working. I'm using the standard SecondLife viewer... for some reason the attach file link is broken for me, if you think seeing the whole code might be helpful I've uploaded it here: http://rapidshare.com/files/267348813/Library_Multi-Dimensional_Array.txt.htmlthanks for the response though, any other ideas? Rabit
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
Cannot Reproduce the Error
08-14-2009 09:30
Library_Multi-Dimensional_Array.txt Compile Successful! Save complete. Besides that it amuses me that the LSL compiler is always surprised! at my success... it all looks good to me.  What exactly is this 'error console' that you mention? ...and isn't CS0201 a C# error? Strange. 
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
08-14-2009 10:07
Right Pale -- I'm confused by the term "error console" (we normally see compile errors at the bottom of the script edit window), and by the error messages shown. I suspect we have a basic misunderstanding here somewhere. Rabit, exactly how are you entering and compiling this script? Here's what we normally do: In inventory (object or avatar inventory), right-click and "Create new script ". This brings up a script edit window. The text area in this window contains a default "hello avatar" script, which we usually delete. We then type or paste in our code. Without line numbers -- I don't know whether the numbers you pasted are part of your script text or not. They must not be. Then we hit the Save button, and after a moment (or three) we get the results in a white box below the text area of the script edit window. HTH Jeff Yeah, I also find it amusing (and a little bit annoying) that success is surprising to so many programmers. (I've seen this kind of thing in a lot of other places.) As a software engineer for over 30 years, I do understand that it's quite something the first time we get something running, and the exclamation mark is appropriate that first time. It's just the next few thousand times that annoy. 
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-14-2009 10:12
And do not post the line numbers as we would have to remove them anyway.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
08-14-2009 11:22
You're trying to compile the LSL script using Microsoft's C# compiler.  LSL is not C#, despite superficial similarities due to them both being derived from C.
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-14-2009 11:24
From: Argent Stonecutter You're trying to compile the LSL script using Microsoft's C# compiler.  Cool! I THOUGHT I had seen just about every error posted here so far!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
08-14-2009 11:30
Three cheers for Mustelids! (Pale got it right too.)
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
08-14-2009 11:34
Bah, I didn't see Pale's comment. Sorry.
|
Rabit Aldrin
Registered User
Join date: 14 Jul 2009
Posts: 7
|
08-16-2009 11:45
I'll give it a try when I'm back at work tomorow,, I just created a cube and hit the add script button. after hitting save it gave the little blue box under the scripting window "compile error, check console" or something like that.
then double clicking the new icon that appears above the cube when compilation fails brought up the error console/debug window thing...
I'll try creating a new script from the inventory tomorow and see how that goes. thanks all, Rabit
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
08-16-2009 13:24
From: Rabit Aldrin I'll give it a try when I'm back at work tomorow,, I just created a cube and hit the add script button. after hitting save it gave the little blue box under the scripting window "compile error, check console" or something like that. Are you doing this on Second Life or one of the OpenSim-based servers?
|
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
|
08-16-2009 16:37
From: Rabit Aldrin I'll give it a try when I'm back at work tomorow,, I just created a cube and hit the add script button. after hitting save it gave the little blue box under the scripting window "compile error, check console" or something like that.
then double clicking the new icon that appears above the cube when compilation fails brought up the error console/debug window thing...
I'll try creating a new script from the inventory tomorow and see how that goes. thanks all, Rabit Thanks for clarifying. I've never seen anything like that. With all the viewers I've used, compile errors appear in the white box below the script text, not in the error text window. In addition to Argent's question, what viewer are you using? Use Help -> About Second Life and tell us what it says.
|
Rabit Aldrin
Registered User
Join date: 14 Jul 2009
Posts: 7
|
08-17-2009 06:06
I have been running tests and so forth in openSim, mainly because the scripts belong in objects which I havn't quite finished making yet so uploading them to secondlife would be a waste of moneys.
But whe the script is on a cube in SL, and when I copy the script from my inventory instead of creating it directly in the object it works perfectly...
Thanks for all the help Rabit
|
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
|
08-17-2009 06:51
From: Rabit Aldrin I have been running tests and so forth in openSim, mainly because the scripts belong in objects which I havn't quite finished making yet so uploading them to secondlife would be a waste of moneys. There's no cost to uploading scripts to SL, if that's what you mean. You can also work in the beta grid and get L$5000 funny money when you connect.
|