Changes to existing Statements and Functions

ChoiceVar$ = CHOOSE$(7,"ONE", "TWO" ELSE "NUL")

In this case, the ELSE expression "NUL" is returned.

CHOOSE and CHOOSE& also support an optional BIT clause where the selection is based upon the first bit set (lowest to highest) in the specified index. This is particularly valuable when used with an ENUMERATION which also uses the BIT option, to describe a set of attributes for an item in your program.

The CHOOSE$ function now has an optional BITS clause that works in the same general fashion as the BIT clause, except the function may return multiple choices, as a concatenated string, if more than one bit is set. For example:

x$ = CHOOSE$(BITS 5, "Computer ", "Laptop ", "Desktop ")

Since the value 5 consists of 2 bits (the lowest and third-lowest) set, the first and third strings are concatenated and returned to the caller.  In this case, "Computer Desktop " is the result.

 

See Also

New Statements and Functions

New in the IDE

Additional Changes