Top  Previous  Next


The OPTION() function returns or changes the setting of an option flag.






OPTION(optno, value)




optnois the option flag number to be tested.


valueis the new state to be applied to the option.



The OPTION() function returns the state of the option identified by optno. If optno is out of range, the function returns False.


The two argument form of the function sets the option state and returns the old state.


Option key values are defined in the SYSCOM KEYS.H record.


A negative optno value can be used to retrieve or set all options. Used in the single argument form of the OPTION() function, this returns a character string that represents the complete set of option values. Using this string in the two argument form of the function reverts all options to the saved state, returning the previous state. A null value string turns off all options. Application programs must not make any assumptions about the structure of the returned option string and must not alter its value.





old.state = option(OPT$DIR.SEL.OMIT.HIDDEN, 1)

selectv fv to files

void option(OPT$DIR.SEL.OMIT.HIDDEN, old.state)


The above code fragment sets the DIR.SEL.OMIT.HIDDEN option for the following SELECTV operation and then restores the previous state of the option.



options = option(-1)

void option(OPT$DIR.SEL.OMIT.HIDDEN, 1)

selectv fv to files

void option(-1, options)


The above code fragment is an alternative way to achieve the same result. In this form, the code between the two uses of the negative optno could set or clear many options. The final line would restore the state as at the start of this example.



See also: