com.livecode.assert | |
Type | module |
Dictionary | LCB |
Library | LiveCode Builder |
Associations | com.livecode.assert |
Summary | Sometimes there are restrictions about how some LCB code can be used correctly. It may only be possible to make it work in a sensible way if is passed a particular range of values, or if the system is in a particular state. These are known as "preconditions" for the code. Many preconditions can be expressed via the LCB type system. For
example, you can declare that the parameters passed to handler must be
particular types of value. For example, when you write Some preconditions can't yet be automatically checked by LCB. An example would be a requirement that a string contains only ASCII characters, or that an array has a particular key. This module provides syntax to assist with explicit precondition checks. |
Description | Sometimes there are restrictions about how some LCB code can be used correctly. It may only be possible to make it work in a sensible way if is passed a particular range of values, or if the system is in a particular state. These are known as "preconditions" for the code. Many preconditions can be expressed via the LCB type system. For
example, you can declare that the parameters passed to handler must be
particular types of value. For example, when you write Some preconditions can't yet be automatically checked by LCB. An example would be a requirement that a string contains only ASCII characters, or that an array has a particular key. This module provides syntax to assist with explicit precondition checks. |
Type | Name | Summary | Syntax |
---|---|---|---|
module | com.livecode.assert | Sometimes there are restrictions about how some LCB code can be used correctly. It may only be possible to make it work in a sensible way if is passed a particular range of values, or if the system is in a particular state. These are known as "preconditions" for the code. Many preconditions can be expressed via the LCB type system. For
example, you can declare that the parameters passed to handler must be
particular types of value. For example, when you write Some preconditions can't yet be automatically checked by LCB. An example would be a requirement that a string contains only ASCII characters, or that an array has a particular key. This module provides syntax to assist with explicit precondition checks. | |
statement | ExpectPrecondition | Check a precondition | expect [that] <Condition> |
- - - | ExpectPreconditionWithReason | Check a precondition, with a reason | expect [that] <Condition> because <Reason> |