Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   treating macro.Value as Number (https://www.kinook.com/Forum/showthread.php?t=4463)

kodakdave 04-16-2010 07:55 AM

treating macro.Value as Number
 
I have two macros, say a=100 and b=99. vbld_iif is used to compare them, as in

[ vbld_iif(Application.Macros(...)("a").Value >
Application.Macros(...)("b").Value, "true", "false")]

and because they are treated as strings this yields false when it shouldn't. I could check for mismatched string lengths and pad with zeroes, but I should not have to. Can I force the Value to be treated as a Number so the comparison works correctly?

kinook 04-16-2010 08:13 AM

Code:

[vbld_IIf(CLng(Application.Macros(...)("a").Value) >
CLng(Application.Macros(...)("b").Value), "true", "false")]

or
Code:

[vbld_IIf(%a% > %b%, "true", "false")]

kodakdave 04-16-2010 08:18 AM

thank you!


All times are GMT -5. The time now is 04:49 AM.


Copyright © 1999-2023 Kinook Software, Inc.