How to manage Alphanumeric variables

Discussions about CSEntry
Post Reply
MarcOlivier
Posts: 13
Joined: November 20th, 2016, 5:54 am

How to manage Alphanumeric variables

Post by MarcOlivier »

I have a matter.
I created an alpha on which I would like to make a restriction on it such that it will not be possible to enter both numbers and letters. I would like when it enter both numbers and letters an error message appears.
I would like it will be enter either only number or only letter
Thanks to help me to solve it
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: How to manage Alphanumeric variables

Post by khurshid.arshad »

Dear MarcOlivier;
Maybe it works for you.

Code: Select all

if poschar("0123456789", $)=1 then
		if poschar("abcdefghijklmnopqrstuvwxyz",tolower($))>1 then
			errmsg ("message 1: you can not etnter alpha");
			reenter;
		else
		endif;
	elseif poschar("abcdefghijklmnopqrstuvwxyz", tolower($))=1 then
		if poschar("0123456789",$)>1 then
			errmsg ("message 2: you can not enter number");
			reenter;
		else
		endif;
	endif
a.
MarcOlivier
Posts: 13
Joined: November 20th, 2016, 5:54 am

Re: How to manage Alphanumeric variables

Post by MarcOlivier »

Thank you very much.
It works perfectly :D
Post Reply