Data Types

Data Types

Explain™ has fundamental data types which describe simple values. It also has more complicated data types such as VECTORS and CLASSES which are described elsewhere. Explain has the following fundamental data types:

INDEX

REAL

BITS

BOOL

STRING

NIL

The fundamental types can be manipulated directly as in most high-level computer languages. The idea of data type encapsulates several different issues:

  • How are data stored?
  • What are the allowed values?

BOOL = TRUE or FALSE

  • How can values be retrieved or modified? e.g.,

A = A + 1 A.SetValue(3.0,TRUE)

  • How are constants represented in the script? For example,

TRUE(BOOL constant) 5 (INDEX constant) 17.3E5 (REAL constant)

  • What operations can be performed on the data? For example,

1 – 3 TRUE eq FALSE 0xFFFFFFFF xor 0xAF143

  • Where can you use data of a given type?

Sleep(“Gamry”) ; illegal because Sleep() needs INDEX

Data types are defined for constants, variables, the results of expressions ( e.g., A eq B has type BOOL), and the return values of function calls. Parameter usage is described under each individual function.