Dan,
have a look at the function (SSTRIPI(source, chars))
It could look like this:
SET VAR vsstripi = (SSTRIPI('3935 Old William Penn Highway, 15668','
abcdefghijklmnopqrstuvwxyz01234567890-'))
if (slen(vsstripi)) > 0 then
-- pause message
endif
Regards
Tony
Op 18-06-2024 om 15:01 schreef 'Dan Goldberg' via RBASE-L:
Hmm thx jim I will give it a try.
Thx
Dan Goldberg
*From:*'jim schmitt' via RBASE-L <[email protected]>
*Sent:* Monday, June 17, 2024 3:17 PM
*To:* 'Dan Goldberg' via RBASE-L <[email protected]>
*Subject:* [EXTERNAL] Re: [RBASE-L] - restricting a db edit to certain
characters
Hi, Dan:
Not to elegant, but this will work, try it.
Regards,
Jim
--- VALIDATE THE PART NUMBER
--- CHAR BY CHAR
--- 06-17-24
CLS
LABEL 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
<https://groups.google.com/d/msgid/rbase-l/BY3PR19MB5027FBB9B273FA60A5E607CCD4CD2%40BY3PR19MB5027.namprd19.prod.outlook.com?utm_medium=email&utm_source=footer>.
--
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
<https://groups.google.com/d/msgid/rbase-l/289731415.6990238.1718662592117%40mail.yahoo.com?utm_medium=email&utm_source=footer>.
--
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/BY3PR19MB5027A968FA7AE3A7964B635BD4CE2%40BY3PR19MB5027.namprd19.prod.outlook.com
<https://groups.google.com/d/msgid/rbase-l/BY3PR19MB5027A968FA7AE3A7964B635BD4CE2%40BY3PR19MB5027.namprd19.prod.outlook.com?utm_medium=email&utm_source=footer>.
--
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/d612004f-a7ee-4afe-981d-2055249355f1%40cio-bv.nl.