| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (12 out of 15)

Quantity Function

The quantity function is used to obtain a quantity value from an argument that is either a logical expression or text, as:

Function Description
quantity (truth-value-expression) = (quantity)
Returns a quantity value for a truth-value-expression. Some examples are:
quantity (text-expression) = (quantity)
Extracts any numeric characters found at the beginning of text-expression and returns them as quantity values. Leading spaces are ignored; numbers may begin with a plus sign, a minus sign, or may be in exponential format (contain an e preceding an exponent of ten, by which to multiply the preceding mantissa). If no numeric characters are found at the beginning of text-expression, G2 signals an error. This function does not evaluate an arithmetic expression that may be embedded in the text value (the string enclosed in quotation marks). Some examples are:

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (12 out of 15)

Copyright © 1997 Gensym Corporation, Inc.