Pred Function

Purpose

Calculates the first whole number smaller than an integer expression.

Syntax

x = Pred(n)

$ = Pred[$](a$)

x, n:integer expression

Description

Pred(n) returns the first whole number smaller than the integer expression n.

Pred(a$) returns a character whose ASCII value is one less than the first character of a string expression.

Example

OpenW # 1

Print Pred(4 * 11 - 1)    // Prints 42

Local l% = Pred(4 * 11 - 1)

Print l%                  // Prints 42

Print Pred("Hello World") // Prints G

Remarks

Without the optional $ character the function still returns a String data type and not a Variant.

See Also

String, Add(), Sub(), Mul(), Div(), Mod(), Succ()

{Created by Sjouke Hamstra; Last updated: 24/06/2017 by James Gaite}