Interrogating Complex Task Attributes

The following points should be remembered when interrogating the values of complex task attributes.

  • Inquiries about the USERCODE attribute return the usercode only, without the password.

  • Inquiries about the ACCESSCODE attribute return the accesscode only, without the accesscode password.

  • Inquiries about the FAMILY attribute return a value with one of the following forms:

    <target family name> = <primary family name> ONLY 
    <target family name> = <primary family name> OTHERWISE 
    <alternate family name> 
    ""     % EMPTY STRING 
  • Inquiries about the OPTION attribute return a string value that is a list of all the options that are set, separated by commas (,). The options can be listed in any order. Thus, the expression STR := TVAR(OPTION); could return any of the following values, among others:

    "ARRAYS, FILES, LONG" 
    "CODE" 
    "CODE, BDBASE, AUTORM, LONG" 

Example

The following is an example of an expression that can be used to extract the primary family name from the FAMILY attribute:

IF LENGTH(MYSELF(FAMILY)) GTR 0  THEN 
  MYFAMILY := HEAD(DROP(TAIL(MYSELF(FAMILY),NOT "="), 
                          2),NOT " "); 
ELSE MYFAMILY := "DISK"; 

In this example, MYFAMILY is a string variable and MYSELF is the predefined task variable. Any string variable or task variable could be used in their places. Refer to String Expressions for explanations of the HEAD, DROP, and TAIL functions.