PDA

View Full Version : If variable version less than value



NewsArchive
12-04-2010, 02:07 AM
I have a variable that is valued with "9.10" and I issue the following
IF: "IF VARIABLE version less than "9.5". Its result is false. I change
the IF to: "IF VARIABLE version less than "9.50" and the result is true.
Why?


--
Dee Witham
Professional Data Services, Inc

NewsArchive
12-04-2010, 02:07 AM
Even if I change "version less than" to just "less than" it still
doesn't work the correctly.

--
Dee Witham
Professional Data Services, Inc

NewsArchive
12-04-2010, 02:07 AM
Dee,

> I have a variable that is valued with "9.10" and I issue the following
> IF: "IF VARIABLE version less than "9.5". Its result is false. I change
> the IF to: "IF VARIABLE version less than "9.50" and the result is true.
> Why?

Obviously I'm not the SB expert here<g> but I think you're comparing
strings, not numeric values. so a string length of 4, for "9.10", is
always going to be greater than a length of 3, for "9.5", at least I
think that's correct?!<g>

By adding the trailing ZERO you force the lengths to match and then
the alphanumerical comparison returns the value you expect.

Or something like that!

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Enhanced Reporting: http://www.cpcs-inc.com

NewsArchive
12-04-2010, 02:08 AM
Lee - I would agree with that if the IF was checking string lengths but
I assume the IF should be checking the values within the string not the
lengths.

Dee

--
Dee Witham
Professional Data Services, Inc

NewsArchive
12-04-2010, 02:09 AM
Peter - thanks that explained it.

Dee

--
Dee Witham
Professional Data Services, Inc

NewsArchive
12-04-2010, 02:09 AM
See thread in this group from Nov. 7. "How to format [PRODUCTVER] for use
with vucheck.exe".

Peter

NewsArchive
12-04-2010, 02:10 AM
Dee,

> I have a variable that is valued with "9.10" and I issue the following
> IF: "IF VARIABLE version less than "9.5". Its result is false. I change
> the IF to: "IF VARIABLE version less than "9.50" and the result is true.
> Why?

"10" is > "5"

If "9.10" Version Less Than "9.5" is FALSE

"10" is < "50"

If "9.10" Version Less Than "9.50" is TRUE

Friedrich

NewsArchive
12-04-2010, 02:10 AM
Hi Darrel,

> I have a variable that is valued with "9.10" and I issue the following
> IF: "IF VARIABLE version less than "9.5". Its result is false. I change
> the IF to: "IF VARIABLE version less than "9.50" and the result is true.
> Why?

Each part of the version string is evaluated and compared to the other part.
9=9, 5<10, 50>10.

Best regards,

--
ArnĂ³r Baldvinsson - Icetips Alta LLC
Port Angeles, Washington
www.icetips.com - www.buildautomator.com - www.altawebworks.com

Icetips product subscriptions at http://www.icetips.com/subscribe.php