[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: How to implement: VarSelect( var1, var2, var3, ... , Varn, n);



PureBytes Links

Trading Reference Links

Bruce -
 
Wow!  One line of code. Granted the functions are nested but I see you can't resist. (;>
 
Thanks for posting this.
Joe L.  
 
----- Original Message -----
From: bruce1r
Sent: Wednesday, February 06, 2008 10:11 AM
Subject: [amibroker] Re: How to implement: VarSelect( var1, var2, var3, ... , Varn, n);

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.

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___