TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: VIRGIL GARNESS
from: CAREY BLOODWORTH
date: 1997-06-17 21:15:00
subject: Passing switches to progr

VG>How is it possible to pass switches to bypass a Switch in a program, say
VG>like from the dos prompt.  I'm trying to make a program that can run on
VG>it's own normally with a menu or run in a batch file with switches to
VG>bypass the menus.
Just check argv & argc in main().  I'd guess that if there are valid
arguments passed on the command line, you could bypass the menu and just
do what needs to be done.
You can either write your own argument processor and use one of the
several getopt() functions that are floating around (including in the C
Snippets release.)
--- QScan/PCB v1.19b / 01-0162
---------------
* Origin: Jackalope Junction 501-785-5381 Ft Smith AR (1:3822/1)

SOURCE: echomail via exec-pc

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™.