You can use VarGet.
http://www.amibroker.com/f?varget
if( IsNull( VarGet("something" ) ) )
{
// does NOT exist
}
or you can use typeof
if( typeof( Variable ) == "undefined" )
{
printf( "Variable does NOT exist");
}
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: Ton Sieverding
To: [email protected]
Sent: Wednesday, October 21, 2009 9:03 PM
Subject: Re: [amibroker] Does the variable exist ?
Thanks but that's not what I mean Aron. I want to check in AFL if a variable
exitsts or not. So a variable being defined in the program. Let's say you have
a loop that creates variables with VarSet going from AmiP0 thru AmiP9. You
don't know where the loop ends and therefore do not know which variables you
are getting. For that reason you must have a possibility tot check if a
variable exists or else you are getting a syntax error. So there must be an
instruction in AFL that provides this check. Something like IF (
VarExist(AmiP5)) etc. I just don't get the right instruction ...
Regards, Ton.
----- Original Message -----
From: Aron
To: [email protected]
Sent: Wednesday, October 21, 2009 7:22 PM
Subject: Re: [amibroker] Does the variable exist ?
Formula Editor > Edit> Find
On 10/21/2009 6:57 PM, amsiev wrote:
> How do I check in AFL if a variable exists ? Say I have a variable AmiP8
and want to know in the program if this variable exists. What's the AFL
instruction for that ? Should be something like :
> If (VarExist(AmiP8)) etc. But I cannot find it ...
>
> Regards, Ton.
>
>
>
> ------------------------------------
>
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> Yahoo! Groups Links
>
>
>
>