About Variable Types

<< Click to Display Table of Contents >>

Navigation:  Concordance Programming Fundamentals > Declaring and using a Variable >

About Variable Types

Before you declare a variable, you must determine what kind of data you wish to store in that variable. As with most programming languages, a basic CPL variable can contain either some kind of number, or else some kind of text. The following table describes the types of variables supported by CPL.

Type

Description

int

An integer value. The range of values it can store is from -2,147,483,648 to 2,147,483,647.

float

a floating point integer. Unlike an int, a float can store numbers with decimals. It can store a range of values from -2.2E-308 to 1.7E+308.

char

An ASCII character value from the range of -128 to 127.

short

A number value from -32,768 to 32,767.

text

Any text string including database field contents.

Once you have determined what kind of variable you want, you can create the variable by declaring it. For more information, see Declaring a Variable. For more information on variable types, see Data Types in the CPL Language Reference.