PDA

View Full Version : Characters Input...


BoKirra
2009-03-19, 01:29 AM
Hi ALL,

Supposed I'm entering a few letters while a routine running.

Here is an example at command prompt:
command: Please enter a Grid ID (A~G) :
Just a thought, how do I get routine's warning in command prompt if numbers entered.

Your helps are much appreciated.

aaronic_abacus
2009-03-19, 02:29 AM
(SETQ GRIDID (GETSTRING "\nPlease enter a Grid ID (A~G) : "))

(SETQ GRIDIDAC (ASCII GRIDID))

(IF (OR (AND (> GRIDIDAC 64) (< GRIDIDAC 91)) (AND (> GRIDIDAC 96) (< GRIDIDAC 123)) )
(PROMPT "\nCORRECT, GRIDID LETTER ENTERED!")
(ALERT "CHARATER ENTERED NOT A LETTER!")
);END IF GRIDIDAC

BoKirra
2009-03-19, 11:24 PM
(SETQ GRIDID (GETSTRING "\nPlease enter a Grid ID (A~G) : "))

(SETQ GRIDIDAC (ASCII GRIDID))

(IF (OR (AND (> GRIDIDAC 64) (< GRIDIDAC 91)) (AND (> GRIDIDAC 96) (< GRIDIDAC 123)) )
(PROMPT "\nCORRECT, GRIDID LETTER ENTERED!")
(ALERT "CHARATER ENTERED NOT A LETTER!")
);END IF GRIDIDAC



Thank you very much.
Certainly it works.
ASCII is the thing I haven't learnt.