Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-16-2010, 07:55 AM
kodakdave kodakdave is online now
Registered User
 
Join Date: 04-14-2010
Posts: 12
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?
Reply With Quote
  #2  
Old 04-16-2010, 08:13 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Code:
[vbld_IIf(CLng(Application.Macros(...)("a").Value) >
CLng(Application.Macros(...)("b").Value), "true", "false")]
or
Code:
[vbld_IIf(%a% > %b%, "true", "false")]
Reply With Quote
  #3  
Old 04-16-2010, 08:18 AM
kodakdave kodakdave is online now
Registered User
 
Join Date: 04-14-2010
Posts: 12
thank you!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 08:34 PM.


Copyright © 1999-2023 Kinook Software, Inc.