Lim Chee Beng
11-14-2002, 04:02 PM
When usually I compare 2 points in the ME10 macro program statement as.....
IF (P1<>(PNT_XY 2.46 4.13))
.....I found sometimes P1 can be intepreted as long decimal point of "2.46000001,4.13" (can't remember exactly how many zeros) even though it was originally assigned as "2.46,4.13". Consequently the result of comparison is always inconsistent and unpredictable.
The purpose of the comparison is to ensure P1 will be always exactly at location of "2.46,4.13". I also face the same problem when trying to verify 2 variable points are at the same location.
To prevent the problem, sometimes I'm forced to re-program as....
IF ((ROUND (P1*10000)/10000)<>(PNT_XY 2.46 4.13))
.....to truncate the tiny, meaningless and annoying decimal value.
Similar problem happens for floating point variable, I always have to re-program as.....
LET fpv (ROUND (fpv*1000000)/1000000)
.....to truncate the tiny decimal value of fpv variable.
Is there any simple programmatic way or internal ME10 configuration to fix the problem?
:confused:
IF (P1<>(PNT_XY 2.46 4.13))
.....I found sometimes P1 can be intepreted as long decimal point of "2.46000001,4.13" (can't remember exactly how many zeros) even though it was originally assigned as "2.46,4.13". Consequently the result of comparison is always inconsistent and unpredictable.
The purpose of the comparison is to ensure P1 will be always exactly at location of "2.46,4.13". I also face the same problem when trying to verify 2 variable points are at the same location.
To prevent the problem, sometimes I'm forced to re-program as....
IF ((ROUND (P1*10000)/10000)<>(PNT_XY 2.46 4.13))
.....to truncate the tiny, meaningless and annoying decimal value.
Similar problem happens for floating point variable, I always have to re-program as.....
LET fpv (ROUND (fpv*1000000)/1000000)
.....to truncate the tiny decimal value of fpv variable.
Is there any simple programmatic way or internal ME10 configuration to fix the problem?
:confused: