Comparing negative string values
Author Message
Comparing negative string values

I just realized that Clarion will determine that -9.55 is greater than -5.55
if both variables are of STRING data type.

-Bob.

Wed, 14 Dec 2005 01:20:29 GMT
Comparing negative string values

Quote:

> I just realized that Clarion will determine that -9.55 is greater than -5.55
> if both variables are of STRING data type.

Given that they are strings, that's what I would expect (ie: look at the ascii
values as strings).

If they are moved to a decimal field, I imagine theyll work fine.

Mark

Wed, 14 Dec 2005 01:53:14 GMT
Comparing negative string values
Yes this is correct for string comparisons

You could do the follow if you like

Result = CHOOSE( ( (String1 * 1) < (String2 * 1) )

TRUE = String1  < String2
FALSE= String1 >= String2

Kevin

Quote:
> I just realized that Clarion will determine that -9.55 is greater
than -5.55
> if both variables are of STRING data type.

> -Bob.

Wed, 14 Dec 2005 03:38:40 GMT
Comparing negative string values
IF (String1 * 1) > (String2 * 1) ... would cause the strings to be converted
to numbers for proper comparison.

--David

Quote:
> I just realized that Clarion will determine that -9.55 is greater
than -5.55
> if both variables are of STRING data type.

> -Bob.

Wed, 14 Dec 2005 04:17:16 GMT

 Page 1 of 1 [ 4 post ]

Relevant Pages