Variable substitution in Job Control ?
Moderators: chulett, rschirm, roy
Variable substitution in Job Control ?
Is there any way to substitute a variable name with its value in a job control ? (Some kind of eval function)
Example :
varA = "test"
varB = "varA"
I need to get varC = "test" by calling something like varC = eval(varB)
Example :
varA = "test"
varB = "varA"
I need to get varC = "test" by calling something like varC = eval(varB)
Damien
That functionality doesn't exist in BASIC, one can use "LIT" for constants, but those are evaluated at compile-time and not run-time.
You can work around the problem by using an array or dynamic array.
e.g.
or
You can work around the problem by using an array or dynamic array.
e.g.
Code: Select all
Variables = ''
Variables<1> = "test"
Variables<2> = "1"
NewValue = Variables<Variables<2>>
Code: Select all
DIM Variables(10)
MAT Variables = ''
Variables(1) = "test"
Variables(2) = "1"
NewValue = Variables(Variables(2))
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Craig - he means take the value of a variable as a variable name and assign that variable's value; sort of a like a variable being a pointer to the value of another.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
If it is any consolation, my initial answer was identical to yours, but I managed to edit it quickly...
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Re: Variable substitution in Job Control ?
dcoueron wrote:Is there any way to substitute a variable name with its value in a job control ? (Some kind of eval function)
Example :
varA = "test"
varB = "varA"
I need to get varC = "test" by calling something like varC = eval(varB)
I think,, u need to write routines
Pandu Dhanawade