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

Re: [amibroker] How to tell if a variable is defined?



PureBytes Links

Trading Reference Links

Title: Re: [amibroker] How to tell if a variable is defined?

You can use varget(), it returns NULL (EMPTY) when not initialized.


//VarSet("Test",999); // uncomment to see NULL disappear.

Title = "Test Value: "+VarGet("Test");


best regards,

herman



Friday, January 23, 2009, 5:53:14 PM, you wrote:


> Hello,


> I am building a program in a modular way with #includes.  I would like

> modules to contain all their needed variables included as default  

> values, but I would like let the values be pre-defined to override the

> defaults.  I know how to do this with static variables since an  

> undefined static variable will return a null or "" depending on the  

> type.  However, I wanted to do this with regular variables and I did  

> not want to define them all ahead of time (like explicitly assigning  

> them null to use the default).  That way I can add functionality to an

> #include file without having to worry about changing all the old  

> programs that use it to add the new variables.


> For instance using a hypothetical isDefined() function:


> myVar1 = myOverrideValue;



> // #include starts here:


> if( not isDefined( myVar1 ) { myVar1 = DefaultValue1; } // this one is

> overridden

> if( not isDefined( myVar2 ) { myVar2 = DefaultValue2; } // this one is

> not


> ... AFL stuff


> // #include ends


> I  would appreciate any ideas.


> Thanks,

> Dennis



> ------------------------------------


> **** IMPORTANT ****

> This group is for the discussion between users only.

> This is *NOT* technical support channel.


> *********************

> TO GET TECHNICAL 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


> *********************************

> Yahoo! Groups Links


> <*> To visit your group on the web, go to:

>     http://groups.yahoo.com/group/amibroker/


> <*> Your email settings:

>     Individual Email | Traditional


> <*> To change settings online go to:

>     http://groups.yahoo.com/group/amibroker/join

>     (Yahoo! ID required)


> <*> To change settings via email:

>     mailto:amibroker-digest@xxxxxxxxxxxxxxx 

>     mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx


> <*> To unsubscribe from this group, send an email to:

>     amibroker-unsubscribe@xxxxxxxxxxxxxxx


> <*> Your use of Yahoo! Groups is subject to:

>     http://docs.yahoo.com/info/terms/



__._,_.___

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL 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

__,_._,___