Jose's Read Only Forum 2023

Purebasic-Tipps and Code => Purebasic Tipps => Topic started by: Israel Vega on May 30, 2015, 03:23:46 AM

Title: Change value of a variable using its name with Runtime feature
Post by: Israel Vega on May 30, 2015, 03:23:46 AM
Is possible change value of a variable in PureBasic...a long time ago I suggested to PowerBasic a feature like this...

Define A$
Runtime A$
A$="ISRAEL"
MessageRequester("VALOR DE A$ :",GetRuntimeString("A$"),0)
SetRuntimeString("A$", "VEGA")
MessageRequester("NUEVO VALOR DE A$ :",GetRuntimeString("A$"),0)
 
 
Title: Re: Change value of a variable using its name with Runtime feature
Post by: Bob Houle 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.