![background image](http://html.mh-extra.com/html/hp/tacl/tacl_programming-manual_2175295061.webp)
Processing Arguments
Developing TACL Routines
107365 Tandem Computers Incorporated
3–5
To process several types of arguments entered in any order, use a #CASE statement.
Use the routine in Figure 3-1 to process zero or more of the following:
File attribute names (defined in ALL)
Numbers
Figure 3-1. Processing Arguments
?SECTION mult_args ROUTINE
#FRAME
#PUSH stat count end
#SET count 0
#SET end 0
[#DEF attributes TEXT |BODY|
Type Size Age Owner Security
]
#OUTPUT Entered arguments were: [#REST]
[#LOOP |DO|
#SET count [#COMPUTE [count] + 1]
[#CASE [#ARGUMENT/VALUE stat/
KEYWORD/WORDLIST [attributes]/ NUMBER END OTHERWISE]
|1|
#OUTPUT Argument [count] is the keyword [stat].
|2|
#OUTPUT Argument [count] is the number [stat].
|3|
#SET end 1
|4|
#OUTPUT *** Invalid argument ***
#SET end 1
]
|UNTIL| (NOT [#MORE]) OR end
]
#UNFRAME
Using #ARGUMENT for Data Within a Program
TACL itself does not provide data type declarations and functions, but you can write a
function that uses #ARGUMENT to determine the type and return the information.
The following routine returns TRUE (not zero) if you pass it a number; otherwise, it
returns FALSE:
?SECTION anumber ROUTINE
#RESULT [#COMPUTE NOT ([#ARGUMENT NUMBER OTHERWISE] - 1)]
Variations on this routine could return TRUE for text or special characters, a number
that reflects a group of argument types, or an index into the entire set of
#ARGUMENT alternatives.