Codeunit "Library - Variable Storage"
Library - Variable Storage" provides functions that pass values from test methods to page and message handler methods that are called out of context and cannot be called directly. This provides a flexible way to store values when running tests because you do not need to have specific global variables for each scenario.
Methods
AssertEmpty
Displays an error if the queue is not empty.
procedure AssertEmpty()
AssertFull
Displays an error if the queue is full.
procedure AssertFull()
AssertNotOverflow
Displays an error if adding a value to the queue will cause an overflow.
procedure AssertNotOverflow()
AssertNotUnderflow
Displays an error if there are fewer than zero values in the queue.
procedure AssertNotUnderflow()
AssertPeekAvailable
Indicates whether you can peek at the value in the queue at the given index without dequeing the value. Displays an error if there is a value in the queue at the given index.
procedure AssertPeekAvailable(Index: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Integer |
The position in the queue to test. |
Clear
Removes all values from the queue.
procedure Clear()
Dequeue
Reads the top value from the queue and removes it.
procedure Dequeue(var Variant: Variant)
Parameters
| Name | Type | Description |
|---|---|---|
| Variant | Variant |
Returns the top value read from the queue. |
Peek
Returns the value from a given index in the queue without dequeuing the value.
procedure Peek(var Variant: Variant, Index: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| Variant | Variant |
Returns the value that is stored in the queue. |
| Index | Integer |
The position in the queue from which the value will be read. |
Enqueue
Store one value in to the queue.
procedure Enqueue(Variant: Variant)
Parameters
| Name | Type | Description |
|---|---|---|
| Variant | Variant |
The value to add to the queue. |
Length
Returns the length of the queue.
procedure Length(): Integer
Returns
| Type | Description |
|---|---|
| Integer |
MaxLength
Returns the maximum length of the queue.
procedure MaxLength(): Integer
Returns
| Type | Description |
|---|---|
| Integer |
DequeueText
Reads one value of type Text from the queue and removes it. If the type of the value is not Text an error is displayed.
procedure DequeueText(): Text
Returns
| Type | Description |
|---|---|
| Text |
DequeueDecimal
Reads one value of type Decimal from the queue and removes it. If the type of the value is not Decimal an error is displayed.
procedure DequeueDecimal(): Decimal
Returns
| Type | Description |
|---|---|
| Decimal |
DequeueInteger
Reads one value of type Integer from the queue and removes it. If the type of the value is not Integer an error is displayed.
procedure DequeueInteger(): Integer
Returns
| Type | Description |
|---|---|
| Integer |
DequeueDate
Reads one value of type Date from the queue and removes it. If the type of the value is not Date an error is displayed.
procedure DequeueDate(): Date
Returns
| Type | Description |
|---|---|
| Date |
DequeueDateTime
Reads one value of type DateTime from the queue and removes it. If the type of the value is not DateTime an error is displayed.
procedure DequeueDateTime(): DateTime
Returns
| Type | Description |
|---|---|
| DateTime |
DequeueTime
Reads one value of type Time from the queue and removes it. If the type of the value is not Time an error is displayed.
procedure DequeueTime(): Time
Returns
| Type | Description |
|---|---|
| Time |
DequeueBoolean
Reads one value of type Boolean from the queue and removes it. If the type of the value is not Boolean an error is displayed.
procedure DequeueBoolean(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
PeekText
Returns a value of type Text at the given position in the queue without dequeuing the value. If the type of the value is not Text an error is displayed.
procedure PeekText(Index: Integer): Text
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Integer |
The position in the queue from which the value will be read. |
Returns
| Type | Description |
|---|---|
| Text |
PeekDecimal
Returns a value of type Decimal at the given position in the queue without dequeuing the value. If the type of the value is not Decimal an error is displayed.
procedure PeekDecimal(Index: Integer): Decimal
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Integer |
The position in the queue from which the value will be read. |
Returns
| Type | Description |
|---|---|
| Decimal |
PeekInteger
Returns a value of type Integer at the given position in the queue without dequeuing the value. If the type of the value is not Integer an error is displayed.
procedure PeekInteger(Index: Integer): Integer
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Integer |
The position in the queue from which the value will be read. |
Returns
| Type | Description |
|---|---|
| Integer |
PeekDate
Returns a value of type Date at the given position in the queue without dequeuing the value. If the type of the value is not Date an error is displayed.
procedure PeekDate(Index: Integer): Date
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Integer |
The position in the queue from which the value will be read. |
Returns
| Type | Description |
|---|---|
| Date |
PeekTime
Returns a value of type Time at the given position in the queue without dequeuing the value. If the type of the value is not Time an error is displayed.
procedure PeekTime(Index: Integer): Time
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Integer |
The position in the queue from which the value will be read. |
Returns
| Type | Description |
|---|---|
| Time |
PeekBoolean
Returns a value of type Boolean at the given position in the queue without deaueuing the value. If the type of the value is not Boolean an error is displayed.
procedure PeekBoolean(Index: Integer): Boolean
Parameters
| Name | Type | Description |
|---|---|---|
| Index | Integer |
The position in the queue from which the value will be read. |
Returns
| Type | Description |
|---|---|
| Boolean |