CtrInitCounter

This command initializes a counter. Counters store their configurations and states in files.

When creating a counter, specify these characteristics:

  • The name for the counter file. The required .CTR extension is automatically appended to the end of the file name.
  • The initial value. This defaults to 1.
  • The maximum value. This defaults to 999999999.
  • The reset value. This defaults to 1.

CtrInitCounter returns the configured start, max, and reset values.

For example, this command initializes a counter that handles the numbers from 1 to 3:

Input: CtrInitCounter CTR <file name> [1] [3]
Output: 1 3 1

A file named file name.CTR is created by the system in the local directory. To operate on this counter with other CTR procedures, specify a file path that identifies this file without the .CTR extension.

To initialize a counter file with specified parameters, use:

CtrInitCounter tag ?mode? ?start? ?max? ?reset?
  • tag is the counter file path.
  • mode is the file.
  • start is the initial counter value. This defaults to 1.
  • max is the maximum counter value. This defaults to 999999999.
  • reset is the reset counter value. This defaults to 1.