API Buffer Options

API buffer options are stored in the ApiBufferOptions class. All options are disabled by default when a new API buffer is created with the CreateApiBuffer function.

API buffer options can be set with the SetOptions function. To obtain the options that are set for an API buffer channel, use the GetOptions function.

The API buffer options are explained below.

Stop on Error

When the stopOnError option is enabled, the API buffer will stop execution and move to the Stop state when an API function that is executed from that buffer returns an error (when the return value is anything other than None). The returned error will be stored in the error log (see API Buffer Statuses).

Execution may be resumed from the next API function in the buffer with the Execute function.

When the stopOnError option is disabled, the API buffer will continue execution regardless of whether the API function executed from the buffer returned an error or not.

Auto Rewind

When the autoRewind option is enabled, the API buffer will automatically rewind when the last API function in the buffer is executed (as if the Rewind function is called).

The ApiBuffer::Wait or ApiBuffer::Sleep functions finish executing only when their respective conditions are satisified. If the last API function in the buffer is one of these functions, the API buffer will rewind after its condition is satisfied.

If the Rewind function cannot be executed, this option will not rewind the buffer. This occurs if API functions that are stored in the buffer are executed and then subsequently overwritten by API functions that are later added to the buffer. To prevent this, API functions should not be added to the API buffer after executing the API buffer when using this option. If this occurs, reset the API buffer with the Clear function.

When the autoRewind option is disabled, the API buffer will not rewind when the last API in the buffer is executed.

Stop on Last Block

When the stopOnLastBlock option is enabled, the API buffer will move to the Stop state when the last API function in the buffer is executed (as if the Halt function is called). If an API function is subsequently added to the buffer, it will not be executed until the Execute function is called again.

This option will not prevent the API buffer from changing to the Active state if the Execute function is called when the API buffer is empty.

When the stopOnLastBlock option is disabled, the API buffer will remain in the Active state after the last API in the buffer is executed. If an API function is subsequently added to the buffer, it will be executed immediately.