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  
 
 [ 4 post ] 

 Relevant Pages 

1. Interesting problem comparing strings with integer values...

2. Comparing value in an input field to any value from another file

3. i want to build a comparator to compare voltages such that reference voltage is negative

4. compare a string variable with a string literal

5. split and negative value

6. Negative values in .ini

7. Negative rotation values

8. help reading negative values in data file - test code and test data

9. Thank you - re:help reading negative values in data file

10. How are negative values stored in COMP?

11. why is a negative shift value illegal?

12. Why is time.clock() returning negative float values (on 64bit Digital UNIX Alpha)

 

 
Powered by phpBB® Forum Software