Hi, Dan:
Not to elegant, but this will work, try it.
Regards,
Jim
--- VALIDATE THE PART NUMBER --- CHAR BY CHAR
--- 06-17-24
CLSLABEL START SET VAR VF_TEXT = NULL SET VAR VF_MSG - TEXT
DIALOG 'Enter Part Number -or- Type ''END'' to exit ' VF_TEXT= 20 vEndKey 1
SET VAR VF_LEN INTEGER = (SLEN(.VF_TEXT)) IF VF_LEN = 0 THEN PAUSE 2
USING 'NO INPUT DATA - PLEASE RE-ENTER' GOTO START ENDIF IF VF_TEXT =
'END' THEN RETURN ENDIF
--------------------------------------------------------------- -- GET CHAR
BY CHAR SET VAR VF_POS INTEGER = 1 SET VAR VF_CHAR TEXT = NULL
LABEL GETNEXT IF VF_POS < (.VF_LEN +1) THEN SET VAR VF_CHAR TEXT =
(SGET(.VF_TEXT,1,.VF_POS))
IF VF_CHAR IN (0,1,2,3,4,5,6,7,8,9) THEN --- BUMP POS
COUNT SET VAR VF_POS = (.VF_POS +1) GOTO GETNEXT
ENDIF IF VF_CHAR IN +
(-,A,B,C,D,E,F,G,H,I,J,K.L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) THEN ---
BUMP POS COUNT SET VAR VF_POS = (.VF_POS +1) GOTO GETNEXT
ENDIF --- MUST BE ILLEGAL CHAR SET VAR VF_MSG TEXT =
('PART ' +.VF_TEXT & ' IS INVALID !') PAUSE 2 USING .VF_MSG
GOTO START ENDIF SET VAR VF_MSG TEXT = ('PART ' +.VF_TEXT & ' IS GOOD
!') PAUSE 2 USING .VF_MSG GOTO START
RETURN
On Monday, June 17, 2024 at 12:46:55 PM EDT, 'Dan Goldberg' via RBASE-L
<[email protected]> wrote:
I need to limit a db edit field in a form to only numbers, letters and dash(-).
I am not having much luck trying to figure it out.
I am wondering if anyone else has done this? If so, maybe can you share some
details?
TIA
Dan Goldberg
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/BY3PR19MB5027FBB9B273FA60A5E607CCD4CD2%40BY3PR19MB5027.namprd19.prod.outlook.com.
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/289731415.6990238.1718662592117%40mail.yahoo.com.