| Juan C. Gil 2006-10-31, 7:07 pm |
| I recommend you have a look at The Simple Development Library at
http://simpledevlib.sourceforge.net/,
in particular the white paper
http://simpledevlib.sourceforge.net/SDLWhitePaper.html and. In
particular,
SimpleDevLib incorporates extended argument syntax for procedures (and
methods!) similar to those
provided by OptProc.
For example, consider the following list of arguments:
{-boolflag boolflag {A boolflag}}
{-flag float 1.0 {A flag}}
{ int1 integer {First argument}}
{ int2 integer {Second argument}}
{?int3? integer 999 {Third argument}}
{ args any {Remaining arguments}}
This list of arguments specifies an initial optional flag -boolflag
with no parameter, followed by an optional flag -flag with a float
parameter whose default value is 1.0, followed by two integers
(arguments int1 and int2), optionally followed by an integer whose
default value is 999, optionally followed by an arbitrary number of
arguments with any type. A procedure named foo defined with the above
list of arguments accepts all the following invokations:
# -boolflag -flag int1 int2 int3 args
foo 1 2
foo 1 2 3
foo 1 2 3 4 5 6
foo -boolflag 1 2
foo -boolflag 1 2 3
foo -boolflag 1 2 3 4 5 6
foo -flag 2.0 1 2
foo -flag 2.0 1 2 3
foo -flag 2.0 1 2 3 4 5 6
foo -boolflag -flag 2.0 1 2
foo -boolflag -flag 2.0 1 2 3
foo -boolflag -flag 2.0 1 2 3 4 5 6
Juan Carlos---
|