Category : C++ Source Code
Archive   : CMDL.ZIP
Filename : FLAG.CPP
File: FLAG.CPP Copyright 1992 by Dlugosz Software
part of the CMDL package for command-line parsing
cmdl_flag class
This version may be used freely, with attribution.
***************************************************************/
#include "usual.h"
#include "cmdl.h"
#include "scanner.h"
/* /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ */
bool cmdl_flag::scan (cmdlscan& s)
{
if (!prelude()) return FALSE;
switch (s.thischar()) {
case '+':
++s;
value= TRUE;
return TRUE;
case '-':
++s;
value= FALSE;
return TRUE;
case '=':
error= NoValue;
return FALSE;
default:
value= TRUE;
return TRUE;
}
}
/* /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ */
void cmdl_flag::report_error()
{
switch (error) {
case NoValue:
foutput ("use:\n@ or @+ will turn on.\n@- will turn off.\n");
break;
default:
cmdl::report_error();
}
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/