TIP: Click on subject to list as thread! ANSI
echo: batpower
to: Richard Webb
from: Paul Quinn
date: 2010-01-21 14:45:30
subject: limiting scope of acceptable command line parm

Hi! Richard,

On 21 Jan 10 01:44, you wrote to all:

 RW> Is there any way that you gurus know of to limit the scope
 RW> of acceptable parameters such as is provided in dbase?

Ooh, another dBASE fan!  (I used it recently... ermm, nearly 4 years ago...
to 'join' two tables together when I created the basis for a JamNNTPd
"groups" file. :-)

 RW> I.e. the command line parm given must be numeric or the program
 RW> branches to a block of code that generates an appropriate message then
 RW> ends?
 RW> Just curious.

Mmm.  You still have that NLSS.bat and the required utils?  I used a thingy
called 'IFNUMBER" to do range checking on command-line input...

-----88-----
  :: Test the elements for reasonableness...
    :: Zones #s between 1-5, thanks...
    IFNUMBER %ZONE% smallerthan 1
      IF ERRORLEVEL 1 GOTO ERRMSG_2
    IFNUMBER %ZONE% biggerthan 5
      IF ERRORLEVEL 1 GOTO ERRMSG_2

    :: Net/Region #s between 1-7211, only...
    IFNUMBER %NETREGON% smallerthan 1
      IF ERRORLEVEL 1 GOTO ERRMSG_2
    IFNUMBER %NETREGON% biggerthan 7211
      IF ERRORLEVEL 1 GOTO ERRMSG_2

    :: Node #s between 0-9999 (0=clerical entry)...
    IFNUMBER %NODENUM% smallerthan 0
      IF ERRORLEVEL 1 GOTO ERRMSG_2
    IFNUMBER %NODENUM% biggerthan 9999
      IF ERRORLEVEL 1 GOTO ERRMSG_2
-----88-----

Is that what you had in mind, mate?

Cheers,
Paul.

... A closed mouth gathers no feet...
--- GoldED+/W32 1.1.5-31012
* Origin: Quinn's Post - Maryborough, Queensland, OZ (3:640/384)
SEEN-BY: 633/260 267 640/384 954 1674 712/0 313 848 800/445
@PATH: 640/384 954 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.