Herman -
I was just checking the board and saw your post. I might be
missing
something in what you want, but it seems like the following would
do
the trick. It was a quick copy/paste from something that I had
-
function VarSelect( Varstr, Varnum )
{
return VarGet(
StrExtract( StrReplace( Varstr, " ", "" ), Varnum ) );
}
Here's a
little test program (Scan) to demo its use -
x = 1;
y = C;
z =
"A";
Buy = Sell = Short = Cover = 0;
for ( i = 0; i <= 3; i++
)
_TRACE( "Var = " + VarSelect( "x, y,Z", i ) );
BTW - note that
variables in Amibroker are really "variants", and
therefore the same
function can return scalars, arrays, strings.