4 delimiters, Delimiters – Rice Lake iRite IDE User Manual

Page 15

Advertising
background image

920i

Programming Reference - Language Syntax

11

To be the best by every measure

Real Constants:

A real constant is an integer constant immediately followed by a decimal point and another

integer constant. Real constants conform to the requirements of IEEE-754 for double-precision floating point
values. When the compiler “sees” a number in the format n.n then a real constant is created. The value .56 will
generate a compiler error. Instead compose real constants between –1 and +1 with a leading zero like this: 0.56
and –0.667. The following gives examples of situations where a real constant is used:

rLength := 9.25;

if rValue <= 0.004 then

sResultString := RealToString(98.765);

rLogResult := Log(345.67);

String Constants:

A string constant is a sequence of printable characters delimited by quotation marks (double

quotes, " "). The maximum length allowed for a string constant is 1000 characters, including the delimiters.
The following gives examples of situations where a string constant (or string literal) is used:

sUserPrompt := "Please enter the maximum barrel weight:";

WriteLn(iPrinter, "Production Report (1st Shift));

if sUserEntry = "QUIT" then

DisplayStatus("Thank You!");

3.1.4

Delimiters

Delimiters include all tokens other than identifiers and keywords, including the arithmetic operators listed below:

>=

<=

<>

:=

<>

=

+

*

/

.

,

;

:

(

)

[

]

"

Delimiters include all tokens other than identifiers and keywords. Below is a functional grouping of all of the
delimiters in

iRite

.

Punctuation

Parentheses

() (open and close parentheses) group expressions, isolate conditional expressions, and indicate function
parameters:

iFarenheit := ((9.0/5.0) * iCelcius) + 32; -- enforce proper precedence

if (iVal >= 12) and (iVal <= 34) or (iMaxVal > 200) -- conditional expr.

EnableSP(5); -- function parameters

Brackets

[ ] (open and close brackets) indicate single and multidimensional array subscripts:

type CheckerBoard is array [8, 8] of recSquare;

iThirdElement := aiValueArray[3];

Comma

The comma(,) separates the elements of a function argument list and elements of a multidimensional array:

type Matrix is array [4,8] of integer;

GetFilteredCount(iScale, iCounts);

Semicolon

The semicolon (;) is a statement terminator. Any legal

iRite

expression followed by a semicolon is interpreted as

a statement. Look around at other examples, it’s used all over the place.

Colon

The colon (:) is used to separate an identifier from its data type. The colon is also used in front of the equal sign
(=) to make the assignment operator:

function GetAverageWeight(iScale : integer) : real;

iIndex : integer;

csCopyright : constant string := "2002 Rice Lake Weighing Systems";

Advertising
This manual is related to the following products: