SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : Metastock 6.0 for Window -- Ignore unavailable to you. Want to Upgrade?


To: bdog who wrote (2145)6/26/1998 4:31:00 PM
From: Craig DeHaan  Read Replies (1) | Respond to of 4056
 
Bdog,

Is it possible to modify a variable in an if, then, else statement?

Yes.
Using your example rearrange it as:

Mtest1:=If(C>5,10,5);
Mtest2:=If(Mtest1>7,14,-22);
Mtest3:=If(Mtest2>0,....etc.);
Mtest*;

You can work around the data array assignment in arguments by using individual "mtest" output to further modify and define a final indicator in steps. What do you have in mind?

Craig



To: bdog who wrote (2145)6/27/1998 4:55:00 PM
From: Paul Beattie  Read Replies (2) | Respond to of 4056
 
bdog,

You can't modify a variable in an if statement. You can use an if to conditionally set the values in an array variable.
Why don't you use:

mtest1:=if(C>5,10,5);
mtest1

Paul