flag

flag — converts between history flag values and names.

Synopsis

       
(flag flag_value)
(flag flag_name...)
	

Parameters

flag_value

An unsigned 4-byte decimal or hexadecimal (0xNNNN) value.

flag_name

One or more flag names, as defined below.

Returns

One of the following:

(flag flag_value flag_name ...)
(flag flag_value)
(error "Flag flag_name not defined")

Description

This support command provides a utility for converting between history flag values and their names. If a flag_value is specified, then the command returns the names of the flags corresponding to each bit that is set. The command (flag 0xFFFF) will return the names of all the flag bits. If one or more flag names are specified, then the value returned is the bit-OR of each of the specified flags. However if any of the flags is undefined, the error message will be returned.

The command can be used to provide a human-readable form for the flag value obtained through the describe command, whose documentation shows the flags currently defined.

Example

[sh]$ lsend Hist
Hist> (describe p3)
(describe p3 "./data" "p3" ".dat" 2 "./data/p301.dat" 0x102 nil 100 "p3")
Hist> (flag 0x102)
(flag 0x102 HIST_REGISTERED HIST_DEADBAND_PRIOR)
Hist> (flag HIST_DEADBAND HIST_DEADBAND_TIMELIMIT)
(flag 0x44)
Hist> (flag NON_EXISTANT)
(flag "Flag NON_EXISTANT not defined")