1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

*

once we have recognized a flag, we need to extract the flag from the argv array, find its entry in the argument table,and then extract the argument value from the argv array

our high level algorithm is:

*

while (not end of argv) {
if (current argv entry is a flag) {
extract the flag from argv
find flag in argument table

} else {extract and store the argument value

}add argument to file name array

}

*

extracting the argument value depends upon the type of the argument, if the type is string, then the argument value must be in the next argv entry

if its a numeric type, the value can be in the current argv entry, or if not there in the next argv entry

the location of the value can be determined by comparing the length of the flag to the length of the argv entry, if they are the same, the value is in the next argv entry, otherwise it is part of the current entry

*

*

March 1, 1999

Page 7

C201/TAM