Author Topic: Change value of a variable using its name with Runtime feature  (Read 2924 times)

0 Members and 1 Guest are viewing this topic.

Offline Israel Vega

  • Newbie
  • *
  • Posts: 22
  • User-Rate: +0/-0
Is possible change value of a variable in PureBasic...a long time ago I suggested to PowerBasic a feature like this...
Code: [Select]
Define A$
Runtime A$
A$="ISRAEL"
MessageRequester("VALOR DE A$ :",GetRuntimeString("A$"),0)
SetRuntimeString("A$", "VEGA")
MessageRequester("NUEVO VALOR DE A$ :",GetRuntimeString("A$"),0)
 
 

Offline Bob Houle

  • Newbie
  • *
  • Posts: 41
  • User-Rate: +3/-3
  • "It was too lonely at the top."
Re: Change value of a variable using its name with Runtime feature
« Reply #1 on: May 30, 2015, 04:20:35 PM »
Yes Israel... works as you say... with variables, constants and procedures.

These objects can be manipulated using their string reference, even when the program is compiled.

This feature allows things like adding a small realtime scripting language to the program, allowing easy modification of exposed variables, using runtime constants values.