modify_timebox

Use the modify_timebox command to modify a timebox value that defines the hours of a week when a role is enabled or disabled. The command defines an hour of the week and then enables or disables that hour in the timebox value. This command is very useful in the set_role_field ADEdit command when setting the timebox field.

Execute this command multiple times on a timebox value to set more than one hour in the value.

For more information about the timebox value format, read the Timebox value format.

Syntax

modify_timebox strTimeBox day hour avail

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 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF enables all hours of the week.

day

integer

Required. The day of the week when the hour occurs. 0=Sunday, 1=Monday, and so on to 6=Saturday.

hour

integer

Required. The hour of the day to enable or disable. Takes a value from 0 to 23. 0 is from midnight to 1 AM, 1 is from 1 AM to 2 AM, and so on to 23, which is from 11 PM to midnight.

avail

integer

Required. Whether to enable or disable the specified hour. 0=disable; all other values=enable.

Return value

This command returns a hexadecimal value that is the timebox value after enabling or disabling the specified hour of the week.

Examples

set tb 000000000000000000000000000000000000000000
set tb [modify_timebox $tb 6 23 1]

This example returns the modified timebox value:

800000000000000000000000000000000000000000

Related Tcl library commands

The following commands perform actions related to this command:

  • decode_timebox converts an internal timebox value to a decipherable format.
  • encode_timebox converts a readable timebox value to an internal timebox format.