Aztec® Programming Language
Version 1.1 Alpha 2

Copyright © 2010-2017, Aztec Development Group, All Rights Reserved

Download Aztec

Search        Contact Us

These are the good old days.

- Carly Simon

 

aztec.system.bool

public enum expose bool { false, true }

Base

bool

The bool class is a primitive class which represents an enumeration class with two values, true and false. A bool object is treated as a value by default, and can be used directly in some expressions. The bool class is defined with the 'expose' keyword, indicating that the two values, false and true, can be used directly as a public identifier without prefacing it with "bool." (which is also valid).

 

All conditional expressions in the Aztec Language return a value of type 'bool' (e.g. the expressions in the 'if' and 'while' statements).

 

The bool instance methods, VM global methods and Compiler Methods can be used to perform useful operations on boolean data types. Each type of method has a separate column in the following method table with a link to the appropriate method description.

 

Note that many of the methods and constants in these tables are based on the standard enumeration methods and constants defined for every enumeration. The 'bool' class also has some methods which are specific to this class.

bool Methods

Compiler
Global
Instance/Shared
Description
-
-
Constructor for the 'bool' class to initialize with a bool value
- - bool() Constructor for the 'bool' class to initialize with an int value
- - bool() Constructor for the 'bool' class to initialize with a string value
- - Bool(), Enum() Shared methods to return the bool/enumeration value that matches the specified index
- - Bool(), Enum() Shared methods to return the bool/enumeration value that matches the specified name
CompilerBoolStr(), CompilerEnumStr() BoolStr() Str() Returns a string representation of the bool value ('true' or 'false')
CompilerBoolIndex(), CompilerEnumIndex() BoolIndex() Index() Returns the one based internal index for the bool value (false=1,true=2)
CompilerInc() - Inc() Increments the enumeration value based on internal index and returns new enum value
CompilerDec() - Dec() Decrements the enumeration value based on internal index and returns new enum value

bool Constants

Constant Data Item Data Type Value
bool.MaxValue bool true
bool.MinValue bool false
bool.NumValues int 2

Derived Classes

See Also

 


bool()

public method bool(bool InitValue = false)

Parameters

InitValue

Initial value for the bool object, with a default of false

Return Value

None

Description

This is one of the constructors for the 'bool' class, invoked automatically by the VM during dynamic allocation of a bool object, if the constructor arguments match this method. It is only available for dynamic allocation and not for initialization of bool variables.

 

This constructor takes a boolean value as a parameter to initialize the object. A default of 'false' is used if the parameter is not provided.

 

bool Class


bool()

public method bool(int InitIndex)

Parameters

InitIndex

Initial index value for the bool object

Return Value

None

Description

This is one of the constructors for the 'bool' class, invoked automatically by the VM during dynamic allocation of a bool object, if the constructor arguments match this method. It is only available for dynamic allocation and not for initialization of bool variables.

 

This constructor takes an integer value as a parameter to initialize the object, which represents the index of the enumeration value. For the 'bool' class, the index must be either 1 (false) or 2 (true). If the index value is not valid, the boolean object is set with an index of 1 (false).

 

bool Class


bool()

public method bool(string InitEnumText)

Parameters

InitEnumText

String representing one of the bool enumeration values ('false' or 'true')

Return Value

None

Description

This is one of the constructors for the 'bool' class, invoked automatically by the VM during dynamic allocation of a bool object, if the constructor arguments match this method. It is only available for dynamic allocation and not for initialization of bool variables.

 

This constructor takes a string value as a parameter to initialize the object, which represents the text/name of the enumeration value. For the 'bool' class, the text must either be 'false' or 'true'. If the string is not valid, the boolean object is set with a value of false.

 

bool Class


Bool(), Enum()

public method<bool> shared Bool(int EnumIndex)

public method<bool> shared Enum(int EnumIndex)

Parameters

EnumIndex

Enumeration index value

Return Value

Returns boolean enumeration value that matches the specified index

Description

These shared methods take a one based enumeration index and return the corresponding bool/enumeration value corresponding to the index. For the bool class, this index must be either 1 (false) or 2 (true). If the index is not valid, it returns a value of false.

 

bool Class


Bool(), Enum()

public method<bool> shared Bool(string EnumText)

public method<bool> shared Enum(string EnumText)

Parameters

EnumText

String representing one of the bool enumeration values ('false' or 'true')

Return Value

Returns boolean enumeration value that matches the specified enumeration text

Description

These shared methods take an enumeration name and return the corresponding bool/enumeration value corresponding to the text. For the bool class, the two valid names are 'false' and 'true'. If the text does not match any of the valid items for the enumeration, the first enumeration value is returned (false in this case).

 

bool Class


Str()

public method<string> Str()

Parameters

None

Return Value

Returns the string representation of bool value

Description

This instance method returns the string representation of the internal bool value. If the value is true, the method returns "true" and if false, it returns "false".

 

bool Class


BoolStr(), EnumStr

public method<string> BoolStr(bool Value)

public method<string> EnumStr(bool Value)

Parameters

Value

Bool value to be converted to a string

Return Value

Returns the string representation of bool value

Description

These global methods return the string representation of the bool value. If the value is true, the methods return "true" and if false, they return "false".

 

Global Method


CompilerBoolStr(), CompilerEnumStr()

public method<string> compiler CompilerBoolStr(bool Value)

public method<string> compiler CompilerEnumStr(bool Value)

Parameters

Value

Bool value to be converted to a string

Return Value

Returns the string representation of bool value

Description

These compiler methods return the string representation of the bool value. If the value is true, the methods return "true" and if false, they return "false".

 

These methods can be used dynamically during the compile process at the module level, class level and inside compiler methods. They can also be used within expressions in non-compiler methods. When the expression is processed by the compiler, the compiler method is invoked and the result is treated as a constant within the expression.

 

Compiler Method


Index()

public method<int> Index()

Parameters

None

Return Value

Returns the one based index of the bool value

Description

This instance method returns the one based index of the internal bool value. If the bool value is false, the index is one and if true, the index is two.

 

bool Class


BoolIndex(), EnumIndex()

public method<int> BoolIndex(bool Value)

public method<int> EnumIndex(bool Value)

Parameters

Value

Bool value to get index of

Return Value

Returns the one based index of the bool value

Description

These global methods return the one based index of the bool value. If the bool value is false, the index is one and if true, the index is two.

 

Global Method


CompilerBoolIndex(), CompilerEnumIndex()

public method<int> compiler CompilerBoolIndex(bool Value)

public method<int> compiler CompilerEnumIndex(bool Value)

Parameters

Value

Bool value to get index of

Return Value

Returns the one based index of the bool value

Description

These compiler methods return the one based index of the bool value. If the bool value is false, the index is one and if true, the index is two.

 

These methods can be used dynamically during the compile process at the module level, class level and inside compiler methods. They can also be used within expressions in non-compiler methods. When the expression is processed by the compiler, the compiler method is invoked and the result is treated as a constant within the expression.

 

Compiler Method


Inc()

public method<bool> Inc()

Parameters

None

Return Value

Returns the incremented bool value

Description

This instance method increments the internal bool value based on index and returns the result. If the internal bool value is false, the incremented value becomes true. If the bool value is already true, the increment operation will cause an OverflowException to be fired.

 

This method modifies the internal bool object.

 

bool Class


Inc()

public method<bool> Inc(bool Value)

Parameters

Value

Bool value to be incremented

Return Value

Returns the incremented bool value

Description

This global method increments the specified bool value based on index and returns the result. If the bool value is false, the incremented value becomes true. If the bool value is already true, the increment operation will cause an OverflowException to be fired.

 

This method does not modify the source bool object.

 

Global Method


CompilerInc()

public method<bool> compiler CompilerInc(bool ref Value)

Parameters

Value

Reference to bool value to be incremented

Return Value

Returns the incremented bool value

Description

This compiler method increments the specified bool value based on index and returns the result. If the bool value is false, the incremented value becomes true. If the bool value is already true, the increment operation will not be performed and a value of true will be returned.

 

This method modifies the source bool object.

 

This method can be used dynamically during the compile process at the module level, class level and inside compiler methods. It can also be used within expressions in non-compiler methods. When the expression is processed by the compiler, the compiler method is invoked and the result is treated as a constant within the expression.

 

Compiler Method


Dec()

public method<bool> Dec()

Parameters

None

Return Value

Returns the decremented bool value

Description

This instance method decrements the internal bool value based on index and returns the result. If the internal bool value is true, the decremented value becomes false. If the bool value is already false, the decrement operation will cause an OverflowException to be fired.

 

This method modifies the internal bool object.

 

bool Class


Dec()

public method<bool> Dec(bool Value)

Parameters

Value

Bool value to be decremented

Return Value

Returns the decremented bool value

Description

This global method decrements the specified bool value based on index and returns the result. If the bool value is true, the decremented value becomes false. If the bool value is already false, the decrement operation will cause an OverflowException to be fired.

 

This method does not modify the source bool object.

 

Global Method


CompilerDec()

public method<bool> compiler CompilerDec(bool ref Value)

Parameters

Value

Reference to bool value to be decremented

Return Value

Returns the decremented bool value

Description

This compiler method decrements the specified bool value based on index and returns the result. If the bool value is true, the decremented value becomes false. If the bool value is already false, the decrement operation will not be performed and a value of false will be returned.

 

This method modifies the source bool object.

 

This method can be used dynamically during the compile process at the module level, class level and inside compiler methods. It can also be used within expressions in non-compiler methods. When the expression is processed by the compiler, the compiler method is invoked and the result is treated as a constant within the expression.

 

Compiler Method

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec