Greetings,
I am trying to use pattern matching to invalidate strings that may contain an asterisk *. Any other character is valid. I want to use pattern matching if at all possible. I must be able to detect and display an error if one is encountered. Is there such a thing as a logical NOT within Databasic pattern matching?
Can someone suggest a way to do this using pattern matching?
For instance, all of the following should produce an error:
Chris Long
RA Services
IF INDEX(VARIABLE,’*’,1) THEN
PRINT ‘AN * EXIST …..’
PRINT ‘INSERT HERE ALL THE OTHERS FUNCTIONS/COMMANDS THAT APPLIES …..’
END ELSE
PRINT ‘AN * DOES NOT EXIST …..’
PRINT ‘INSERT HERE ALL THE OTHERS FUNCTIONS/COMMANDS THAT APPLIES …..’
END
OR
IF INDEX(VARIABLE,’*’,1) ELSE
PRINT ‘AN * DOES NOT EXIST …..’
PRINT ‘INSERT HERE ALL THE OTHERS FUNCTIONS/COMMANDS THAT APPLIES …..’
END
Note :
· Assumes that VARIABLE is that or a Dynamic Array with the content that has the value being checked
· There are , of course , several other ways of doing it but this set of instructions over here has done the job for us in the past.
Saludos,
José
======================
José P. Junco-Ivern
Rovira Biscuit Corporation
Rovira Foods, Inc.
Urb. Buena Vista
619 Ave. La Ceiba
Ponce, PR 00717-1901
Tel : 787-844-8585 ext 2115
Office Desk Direct No. : 787-651-2462
Fax : 787-848-7176
jju...@rovira.com
=======================
--
You received this message because you are subscribed to the Google Groups "Reality" group.
To post to this group, send email to reality-...@googlegroups.com.
To unsubscribe from this group, send email to reality-databa...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/reality-database?hl=en.
José,
Thank you for the speedy response.
The goal is to be able to use pattern matching, or to write specific code that will modify a pattern so that it will be consistent with our other validation rules.
Something like,
Datum = “ABC*,123”
pattern = “!0X’*’0X”
IF datum MATCHES pattern THEN CRT “Error: asterisk found”
Chris Long
RA Services
One note of suggestion , with the INDEX function one has more flexibility in the sense that it doesn’t require the ‘searched sub-string’ to be in any specific pattern or position and after that one can use the CONVERT / CHANGE / …. functions to remove the ‘*’ from the string. If that is what this is all about. Just ‘Food For Thought’. Have A Nice Day.
Darren Wragg
Application Development
T: 01353 650 900
E: dwr...@cromwells.co.uk
W: www.cromwells.co.uk
Cromwell Business Systems Ltd
King’s View House
3 Bartholomew’s Walk
Cambridgeshire Business Park
Ely, Cambridgeshire CB7 4EA
***Private and Confidential Notice***
The information contained in this e-mail is intended for the named recipient(s) only. It may contain privileged and confidential information and if you are not the intended recipient(s) you must not copy, distribute or take any action or reliance on it. If you have received this e-mail in error, please notify the sender immediately by using the e-mail address.