Hi John, Absolutely, there are loads of ways for the check to have been made, but it's more fun to get to the bottom of the problem, what's life without a little challenge here and there. Plus we all learnt something for next time.
Andy -----Original Message----- From: John Solie [mailto:[EMAIL PROTECTED] Sent: 10 March 2005 18:24 To: [email protected] Subject: RE: [U2] [UV] "non-numeric" error after passing (ANS MATCHES '0N' & ANS>0) I'm wondering why y'all are using a ...MATCHES "0N"... Usually, I'll use the NUM() function. The code snippet in one of the first messages in this thread would be: BEGIN CASE CASE NUM(ANS) AND ANS > 0 <more code here> Or is NUM() something that lives only in UniData? :ED JBP TT150 Top of "TT150" in "JBP", 5 lines, 142 characters. *--: P 001: ARAY = 'ABC' 002: NBR = STR(2,512) 003: IF NBR MATCHES '0N' THEN PRINT 'passes MATCH' 004: IF NUM(NBR) THEN PRINT 'passes NUM' 005: PRINT 'ARAY<NBR> = ':ARAY<NBR> Bottom. *--: FIBR Filed "TT150" in file "JBP" unchanged. Compiling Unibasic: /usr/ud/SOURCE/JBP/TT150 in mode 'u'. compilation finished passes MATCH passes NUM ARAY<NBR> = : Best, -- John Solie -- Professional Hospital Supply -- 951-296-2600 > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Piers Angliss > Sent: Thursday, March 10, 2005 4:14 AM > To: [email protected] > Subject: RE: [U2] [UV] "non-numeric" error after passing (ANS > MATCHES '0N' & ANS>0) > > A very long numeric string will do this, see sample code below: > > 0001: ARRAY = '12345' ;* Just so array has a value > 0002: VAR = STR('1',512) > 0003: IF VAR MATCHES "0N" THEN PRINT 'Numeric' > 0004: DUM = ARRAY<VAR> > 0005: END > > >RUN BP T2 > Numeric > Program "T2": Line 4, Nonnumeric data when numeric required. > Zero used. > > It passes the pattern match because each digit is numeric, it > fails the > numeric test because it is too big to handle. > Note 512 is just a guess, I don't know what the actual limit > is - it worked > with around 60 ! > > You say this is a menu processor, perhaps one of your users > rested a book / > pad on a numeric key and generated the necessary huge string > of numbers ? > > hth > > Piers > > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Stevenson, > Charles > Sent: 08 March 2005 23:26 > To: [email protected] > Subject: [U2] [UV] "non-numeric" error after passing (ANS > MATCHES '0N' & > ANS>0) > > 4 times in recent months line these have generated the a set of 4 > runtime errors > "Nonnumeric data when numeric required. Zero used." > as recorded in uv/errlog: > Mon Mar 7 14:04:03 78 wrc63580 Program "MENU.DRIVER": Line 74, > Message[040025] > Mon Mar 7 14:04:03 78 wrc63580 Program "MENU.DRIVER": Line 75, > Message[040025] > Mon Mar 7 14:04:03 78 wrc63580 Program "MENU.DRIVER": Line 291, > Message[040025] > Mon Mar 7 14:04:06 78 wrc63580 Program "MENU.DRIVER": Line 310, > Message[040025] > ------- > u2-users mailing list > [email protected] > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
