Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: eval() ?  (Read 4595 times)

0 Members and 1 Guest are viewing this topic.

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
eval() ?
« on: March 16, 2003, 03:15:20 PM »

Hi,

does a function like "eval()" exist ? I'm trying to convert something like this:

Code: [Select]
var action = "walkto";
button_walkto.SetImage(...);

to some kind of this:

Code: [Select]
eval("button_"+action).SetImage(...);

or

eval("button_"+action+".SetImage(...);");

thanks for help!
Logged
Mooh!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:eval() ?
« Reply #1 on: March 16, 2003, 03:42:07 PM »

Nope, sorry, there's no eval() function available and it probably never will. It would be quite complicated to implement this and IMHO it's not worth the trouble. The script compiler is completely separated from the engine itself and doesn't even need to be present at runtime...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re:eval() ?
« Reply #2 on: March 16, 2003, 03:49:14 PM »

Ok, I just thought I saw something like that and wondered, it did not work for me.
Logged
Mooh!
 

Page created in 0.049 seconds with 19 queries.