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:
> For other support material please check also:
> *********************************
> Yahoo! Groups Links
> <*> To visit your group on the web, go to:
> <*> Your email settings:
> Individual Email | Traditional
> <*> To change settings online go to:
> (Yahoo! ID required)
> <*> To change settings via email:
> <*> To unsubscribe from this group, send an email to:
> <*> Your use of Yahoo! Groups is subject to: