|
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
|
03-07-2008 09:52
Forgive me if this has been covered before, or if I'm wrong about this, but it seems to me that there is no way of specifying variables with a scope that covers all events in a state, but not other states. If I'm wrong, please tell me how, as I keep wanting to do this.
So we're either forced into using global variables (ugh, I hated those two words before I even met LSL) or variables within an event (or lower); there is no way of localising variables that span all events in the current state.
If there a good reason for not implementing this? After all, I certainly find that some data is used at that level. It seems to make sense.
|
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
03-07-2008 09:54
Yep. You get locals and you get globals - nothing in between. From: Barrington John If there a good reason for not implementing this? After all, I certainly find that some data is used at that level. It seems to make sense. Cory Linden originally wrote the LSL language over lunch one day. There's a few things that are a little crusty on it. Don't get me started about the lack of switch/case..
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
|
Barrington John
Yorkshire guy
Join date: 17 Nov 2007
Posts: 119
|
03-07-2008 11:22
From: Meade Paravane Yep. You get locals and you get globals - nothing in between. Ah, that's a shame. But thanks for the confirmation. From: Meade Paravane Don't get me started about the lack of switch/case.. Yes, while I agree with you completely, let's not go down the LSL-bashing road yet again!
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
03-07-2008 16:52
at a guess, to be simpler to users not familiar with programming, or possibly because states aren't meant to control data, but event types...
although some of the choices for what events/functions will cross states makes that confusing, as timers cross, even set in another state, but listens don't, presumably dataserver/http type event/function pairs will, though there is little need or use, I'm not sure about target events, or sensor repeats...
I blieve any asynchonus event/function pair will cross states, and a few exceptions, like timers, are tied to the global level, while most others are tied to the state as you'd expect in a model that uses states to control available events...
granted it was supposedly written over a weekend (or was it a week, I forget?)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|