Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Is dynamic assignment possible?

Muddy Buchanan
Recovering Recluse
Join date: 29 Jan 2007
Posts: 31
11-14-2007 15:25
By which I mean, is it possible to assign a value to a variable that is referenced in another variable? Other languages tend to have either an "eval" function to force a dereference, or
individual utility functions. Something like:

integer llSetFloatByName(string var_name, float value);

would do the trick, but I can't find anything similar.

Apologies in advance if this is an FAQ, but I've not found an answer in the usual places.
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
11-14-2007 15:29
From: Muddy Buchanan
By which I mean, is it possible to assign a value to a variable that is referenced in another variable? Other languages tend to have either an "eval" function to force a dereference, or
individual utility functions. Something like:

integer llSetFloatByName(string var_name, float value);

would do the trick, but I can't find anything similar.

Apologies in advance if this is an FAQ, but I've not found an answer in the usual places.


There is no eval-like statement. You can sort of kind of simulate it by having several other scripts in your object, and sending a link message to a given one which could be directed by the value of a variable. But it's hard to justify going through the trouble when some if-else statements could do the job instead.
Muddy Buchanan
Recovering Recluse
Join date: 29 Jan 2007
Posts: 31
11-14-2007 15:54
Thanks for the speedy response. At least I can stop searching now. It looks as if I'm going to have to make a few compromises in programming style. I normally avoid multi-branched conditionals wherever possible,
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
11-14-2007 20:13
yea ... heres what you do

take all knowledge of proper programing and burn it

then take really long makeshift framework and squash it into less than 16 k

course the advantage is the same as building, you get really good at optimizing