All CAIE standard functions are in UPPER CASE. All non-official functions are UpperCamelCase.
QPow
: quick powerQPow(x : REAL, n : INTEGER) RETURNS REAL
Min
: smaller value between twoMin(x : REAL, y : REAL) RETURNS REAL
Max
: larger value between twoMax(x : REAL, y : REAL) RETURNS REAL
Abs
: absolute valueAbs(x : REAL) RETURNS REAL
Sum
: get the sum of an arraySum(BYREF arr : ARRAY, BYVAL start : INTEGER, end : INTEGER) RETURNS REAL
PI
π
Sort
: shell sortSort(BYREF arr : ARRAY, BYVAL left : INTEGER, right : INTEGER)
QuickSort
quick sortQuickSort(BYREF a : ARRAY, BYVAL low : INTEGER, high : INTEGER)
Split
: truncate a stringSplit(s : STRING, sep : STRING) RETURNS ARRAY
Lcase
: to lower caseLcase(s : STRING) RETURNS STRING
Ucase
: to upper caseUcase(s : STRING) RETURNS STRING
Trim
: remove blanks at the beginning and the end of a stringTrim(s : STRING) RETURNS STRING
TrimStart
: remove blanks at the beginning of a stringTrimStart(s : STRING) RETURNS STRING
TrimEnd
: remove blanks at the end of a stringTrimEnd(s : STRING) RETURNS STRING
ArrayFromString
: returns an array of characters of a stringArrayFromString(s : STRING) RETURNS ARRAY
Contains
: if thetarget
string is contained in a strings
Contains(s : STRING, target : STRING) RETURNS BOOLEAN
Join
: join a array of string together with seperationJoin(sep : STRING, BYREF list : ARRAY, start : INTEGER, end : INTEGER) RETURNS STRING
Reverse
: return a new string in reverse orderReverse(s : STRING) RETURNS STRING
Replace
: replace stringfrom
in strings
to a string namedto
Replace(s : STRING, from : STRING, to : STRING) RETURNS STRING
EndsWith
: if a strings
ends with a stringsuffix
EndsWith(base : STRING, suffix : STRING) RETURNS BOOLEAN
StartsWith
: if a strings
starts with a stringprefix
StartsWith(base : STRING, prefix : STRING) RETURNS BOOLEAN
STR_TO_NUM
: transform a strings
to a numberSTR_TO_NUM(s : STRING) RETURNS REAL
NUM_TO_STR
: transform a numbers
to a stringNUM_TO_STR(s : REAL) RETURNS STRING
CHR
: get the ASCII value of an integern
CHR(n : INTEGER) RETURNS CHAR
ORD
: get the ASCII index of a charORD(s : CHAR) RETURNS INTEGER
Time
: get current timestampTime() RETURNS REAL
Import
: import another cpc fileImport(target : STRING) RETURNS ImportObj
ArrayOne
sets the contents of an array of custom length and width to 1ArrayOne(BYVAL row : INTEGER, col : INTEGER) RETURNS ARRAY
ArrayArrange
generates evenly spaced n numbers within the closure rangeArrayArrange(BYVAL low : INTEGER, high: INTEGER, div : REAL) RETURNS ARRAY
ArrayLinSpace
generates n evenly spaced numbers in the closure rangeArrayLinSpace(BYVAL low : INTEGER, high: INTEGER, num : INTEGER) RETURNS ARRAY