I just made an interesting discovery (after about an hour of hard debugging). Macro Scheduler completely ignores the following statement, and gives no error message indicating that it has done so:
If>SheetMarketCap>400.0*ComptdMarketCap
where ComptdMarketCap is a variable.
Therefore one must write:
If>SheetMarketCap>{400.0*%ComptdMarketCap%}
Has any one else noticed this. Thanks!
If statement problematic if it contains a multiply
Moderators: Dorian (MJT support), JRL
-
- Pro Scripter
- Posts: 56
- Joined: Sun May 11, 2008 9:39 pm
If statement problematic if it contains a multiply
May you have a blessed day!
Michael D Fitzpatrick
Reg. US Patent Agent
Michael D Fitzpatrick
Reg. US Patent Agent
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Hi,
This is correct and as documented. Please see the help file topic for "If" where it says:
Let>testVal=400*ComptdMarketCap
If>SheetMarketCap>testVal
or
If>SheetMarketCap>{400&%ComptdMarketCap}
This is correct and as documented. Please see the help file topic for "If" where it says:
So you could do:The expression can be simple (legacy), or complex.
Complex Expressions
The expression must be contained within curly braces "{" and "}". String literals must be delimited with double quotes ("), e.g.:
"string". Variables must be delimited with % symbols, e.g.: %VarA%.
Several types of operators and functions can be used with complex expressions. For more details see Complex Expressions.
Simple Expressions
Simple expressions can contain only two parts separated by one of the following operators:
= Equals
> Greater than
Not Equal
Let>testVal=400*ComptdMarketCap
If>SheetMarketCap>testVal
or
If>SheetMarketCap>{400&%ComptdMarketCap}
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 56
- Joined: Sun May 11, 2008 9:39 pm
Hi Marcus:
Thanks! I think you meant:
"or
If>SheetMarketCap>{400*%ComptdMarketCap} " (*; not &)
Also, perhaps for the next update of the manual, it could be explained under what circumstances a complex expression must be used in an IF statement. May you have a blessed day.
Thanks! I think you meant:
"or
If>SheetMarketCap>{400*%ComptdMarketCap} " (*; not &)
Also, perhaps for the next update of the manual, it could be explained under what circumstances a complex expression must be used in an IF statement. May you have a blessed day.
May you have a blessed day!
Michael D Fitzpatrick
Reg. US Patent Agent
Michael D Fitzpatrick
Reg. US Patent Agent
Hi evangelmike,evangelmike wrote:Also, perhaps for the next update of the manual, it could be explained under what circumstances a complex expression must be used in an IF statement. May you have a blessed day.
I have wondered that myself... but on re-reading the existing Help File entry for IF, you'll find these statements:
From the above, you can infer that the following would not qualify as a simple expression:out-takes from the existing Help File entry for the If> statement wrote: If>expression[,true_label_name[,false_label_name]]
statements
[ [Else
else statements]
Endif ]
The expression can be simple (legacy), or complex.
Simple expressions can contain only two parts separated by one of the following operators:
= Equals
> Greater than
Not Equal
Values in the expression can be numeric or string values, or variables containing such values.
SheetMarketCap>400.0*ComptdMarketCap
SheetMarketCap is OK as it is a single value to the left of the SheetMarketCap>{400*%ComptdMarketCap%}
//do something
ELSE
//do something else
ENDIF[/quote]
Thanks and take care
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -