decode_timebox
Use the decode_timebox
command to convert an internal timebox value that defines when a role is enabled or disabled into a format that can be evaluated. The command converts the internal hexadecimal value for a role timebox to a hexadecimal timebox value format as described in Timebox value format
The command returns a 168-bit value in hexadecimal format that delineates the hours of the week from midnight Sunday to 11 PM Saturday in order from most-significant bit to least-significant bit. If a bit is set to 1, its corresponding hour is enabled for the role. If set to 0, its corresponding hour is disabled.
This command is useful for deciphering the value returned by the get_role_field for the timebox field.
Syntax
decode_timebox strTimeBox
Options
This command takes no options.
Arguments
This command takes the following arguments:
Argument | Type | Description |
strTimeBox |
hex |
A 42-digit hexadecimal timebox value. A value of zero disables all hours of the week. A value of |
Return value
This command returns a decoded hexadecimal value that is the timebox value for a role.
Examples
>select_role test1 >get_role_field timebox FFF7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF >package require ade_lib 1.0 >decode_timebox [grf timebox]
This example returns the decoded 42 hexadecimal that indicates the role is disabled from midnight to one on Sunday:
7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Related Tcl library commands
The following commands perform actions related to this command:
- encode_timebox converts a readable timebox value to an internal timebox format.
- modify_timebox defines an hour of the week and enables or disables that hour in the timebox value.