| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | globally parse command line parameters |
Hello all!
TIme for another possibly elementary question.
I have a batch which I use to enter data into a file for
a radio network I manage. MOst stations who report into
this network have a defined function or represent a defined
entity.
I've done a bunch of changes to how the monthly report of
this network's activity is submitted, allowing a batch file
to do it automagically at the first of the month if all days of previous
month are represented.
%1 is the only command line parameter that is going to have
anything consistent, and that's the call sign of the
operator who was the control station for the session being
entered.
There are eleven other "words" might be issued on the
command line, which would indicate any additional duties
performed by the control station.
NO controller will ever fill all eleven at once, not
possible as many are geographically referenced .
I know I can play the old game as in
if %1==n goto nov
if %1==p goto papa
if %1==q goto quebec
....
You get the idea.
DO the whole list, then do the same for %2. But that gets
rather long and cumbersome.
I'll first check to see if %9 was defined, then %8, etc. sO we've got that
covered. But, it would be nice if I could
just define branches if any other command line parm than %1
is defined.
HEre's a bit of an example to illustrate what I'm getting at if it isn't
clear from the above.
The name of this batch is cr.bat, short and sweet for
central area net report .
SO today my friend LEon will be the control station. HE'll
also most likely handle a variety of other functions. fOr
example, he'll handle five. so today my command line would
appear as
cr wb5zed n p q d 5
TOmorrow he'll again be control, but he won't handle as
many.
so you might see:
cr wb5zed d 5
After the command line is entered and return is pressed of
course we use HOrst's logecho to get a first line of a text
file that has a time and date stamp.
Now, for today when my buddy Leon was control we're wanting
a report output which looks like this.
*** text in parentheses not included in actual output.
wb5zed november (corresponds with n parm above)
wb5zed papa (corresponds with P comm line parm above)
wb5zed quebec (corresponds with q above)
wb5zed digital: (corresponds with d parm above)
*wb5zed rn5: (corresponds with 5 above)
TOmorrow Leon won't be handling all of those, so after
command line is processed we open our created file for
editing. I'll know from the report LEon provided me which
stations handled the additional functions.
I just don't want to have to repeat those if %1== statements for %2 for the
same values basically.
Any quick and dirty way to get around it?
maybe shift?
I still want to make use of the parameter entered as %1
though.
Regards,
Richard
--- timEd 1.10.y2k+
* Origin: Radio REscue net operations BBS (1:116/901)SEEN-BY: 10/1 3 34/999 120/228 123/500 128/2 140/1 222/2 226/0 249/303 250/306 SEEN-BY: 261/20 38 100 1381 1404 1406 1410 1418 266/1413 280/1027 320/119 SEEN-BY: 393/68 396/45 633/104 260 267 285 640/954 690/682 734 712/0 313 848 SEEN-BY: 800/432 801/161 189 2222/700 2320/100 105 200 2905/0 @PATH: 116/901 3634/12 123/500 261/38 633/260 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™.