This is an interesting issue.  You can work around it by using the
DROUND.

I.E.
A = DROUND(A, 2)


Michael Rajkowski


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Piers Angliss
Sent: Wednesday, March 29, 2006 1:52 AM
To: u2-users@listserver.u2ug.org
Cc: [EMAIL PROTECTED]
Subject: RE: [U2] RE: UniBasic code that should work

OP doesn't say which database, except that UniBasic suggests UniData and
on
my machine it works fine in Universe but as described in UniData (5.2.3
on
RHL)!

Wide-zero is a Universe-specific feature so wouldn't affect UniData

I'm baffled - adding additional prints to the code suggests that both
variables are of equal length consisting of the same characters, that
A-B =
0 but that A is greater than B.

If you change the assignment of B to B = 4.58 - 4.59 then it works fine,
but
B = 0 - 0.01 still fails

If you step through with the UniBasic debugger everything still appears
the
same, but this time it works correctly !!

Any UniData gurus out there who can suggest an explanation ?

Piers

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Kevin King
Sent: 29 March 2006 01:53
To: u2-users@listserver.u2ug.org
Subject: [U2] RE: UniBasic code that should work


Sounds like Universe and the WIDE0 setting again.  Seems we've seen a
lot of that kind of stuff in the past few months.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, March 28, 2006 5:48 PM
To: u2users
Subject: UniBasic code that should work


Posted on behalf of a colleague who wishes to remain nameless...

UniBasic code that should work

The results of the following code are proving to be troublesome:

      A = 4.57 + (-4.58)
      B = (-0.01)
      PRINT 'TEST ONE: ARE ':A:' AND ':B:' THE SAME? ':
      IF A = B THEN
         PRINT 'YES'
      END ELSE
         PRINT 'NO'
      END

      A = OCONV(A,'MD20')
      B = OCONV(B,'MD20')
      PRINT 'TEST TWO: ARE ':A:' AND ':B:' THE SAME? ':
      IF A = B THEN
         PRINT 'YES'
      END ELSE
         PRINT 'NO'
      END

You would expect both tests to return 'YES', but in fact, only the
second test returns 'YES'.

TEST ONE: ARE -0.01 AND -0.01 THE SAME? NO TEST TWO: ARE -0.01 AND
-0.01 THE SAME? YES

Is there something simple that I am missing?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "u2users" group.
To post to this group, send email to [EMAIL PROTECTED] To
unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/u2users
-~----------~----~----~----~------~----~------~--~---

--

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.3.2/294 - Release Date:
3/27/2006
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to