Focal Point
Amper variables as numeric

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4391048331

April 07, 2005, 05:46 PM
Lloyd
Amper variables as numeric
HI Guys, Iam trying to create a amper variable to substitute the BY HIGHEST verb in my fex but it's not working for me....

I use this code before my define table


-* SET
-SET &TOP_# = IF &TOP_N.EVAL GT '0O' THEN &TOP_N ELSE &TOP_N.EVAL * -1;
-SET &BY_BY = IF EDIT(&TOP_N.EVAL) GT 'O0' THEN 'BY HIGHEST ' ELSE 'BY LOWEST ';
-SET &HI_LO = &BY_BY | '&TOP_#.EVAL' | ' TOTAL TY_MTD NOPRINT' ;
-? &HI_LO
no matter what I try it only takes the else clause, how do you evaluate amper varibales as numeric?

This message has been edited. Last edited by: <Mabel>,
April 07, 2005, 06:14 PM
<Pietro De Santis>
Assuming &TOP_N is always numeric:


-SET &ECHO=ALL;
-SET &TOP_N = -16;

-SET &TOP_# = IF &TOP_N GT 00 THEN &TOP_N ELSE (-1 * &TOP_N);
-SET &BY_BY = IF &TOP_N GT 00 THEN 'BY HIGHEST ' ELSE 'BY LOWEST ';
-SET &HI_LO = &BY_BY | &TOP_# | ' TOTAL TY_MTD NOPRINT' ;
-TYPE &HI_LO
It looks like your '0O' is a zero and an O - is this intentional?

This message has been edited. Last edited by: <Mabel>,
April 07, 2005, 06:55 PM
Lloyd
NO that wasn't intentional and I did'nt even realize it. Originally it was just the 0, but it kept giving me errors at the '* -1'. But changed the code and used the ABS funtion and it worked fine.
April 08, 2005, 05:50 AM
<JG>
with regard the * -1 It needs to be coded as *(-1)
or in your actual code (-1*(&TOP_N ))