All CAIE standard functions are in UPPER CASE. All non-official functions are UpperCamelCase.
QPow: quick powerQPow(x : REAL, n : INTEGER) RETURNS REALMin: smaller value between twoMin(x : REAL, y : REAL) RETURNS REALMax: larger value between twoMax(x : REAL, y : REAL) RETURNS REALAbs: absolute valueAbs(x : REAL) RETURNS REALSum: get the sum of an arraySum(BYREF arr : ARRAY, BYVAL start : INTEGER, end : INTEGER) RETURNS REALPIπ
Sort: shell sortSort(BYREF arr : ARRAY, BYVAL left : INTEGER, right : INTEGER)QuickSortquick sortQuickSort(BYREF a : ARRAY, BYVAL low : INTEGER, high : INTEGER)
Split: truncate a stringSplit(s : STRING, sep : STRING) RETURNS ARRAYLcase: to lower caseLcase(s : STRING) RETURNS STRINGUcase: to upper caseUcase(s : STRING) RETURNS STRINGTrim: remove blanks at the beginning and the end of a stringTrim(s : STRING) RETURNS STRINGTrimStart: remove blanks at the beginning of a stringTrimStart(s : STRING) RETURNS STRINGTrimEnd: remove blanks at the end of a stringTrimEnd(s : STRING) RETURNS STRINGArrayFromString: returns an array of characters of a stringArrayFromString(s : STRING) RETURNS ARRAYContains: if thetargetstring is contained in a stringsContains(s : STRING, target : STRING) RETURNS BOOLEANJoin: join a array of string together with seperationJoin(sep : STRING, BYREF list : ARRAY, start : INTEGER, end : INTEGER) RETURNS STRINGReverse: return a new string in reverse orderReverse(s : STRING) RETURNS STRINGReplace: replace stringfromin stringsto a string namedtoReplace(s : STRING, from : STRING, to : STRING) RETURNS STRINGEndsWith: if a stringsends with a stringsuffixEndsWith(base : STRING, suffix : STRING) RETURNS BOOLEANStartsWith: if a stringsstarts with a stringprefixStartsWith(base : STRING, prefix : STRING) RETURNS BOOLEANSTR_TO_NUM: transform a stringsto a numberSTR_TO_NUM(s : STRING) RETURNS REALNUM_TO_STR: transform a numbersto a stringNUM_TO_STR(s : REAL) RETURNS STRINGCHR: get the ASCII value of an integernCHR(n : INTEGER) RETURNS CHARORD: get the ASCII index of a charORD(s : CHAR) RETURNS INTEGERASCII: get the ASCII index of a char (Same asORD)ASCII(s : CHAR) RETURNS INTEGER
Time: get current timestampTime() RETURNS REAL
Import: import another cpc fileImport(target : STRING) RETURNS ImportObj
ArrayOnesets the contents of an array of custom length and width to 1ArrayOne(BYVAL row : INTEGER, col : INTEGER) RETURNS ARRAYArrayArrangegenerates evenly spaced n numbers within the closure rangeArrayArrange(BYVAL low : INTEGER, high: INTEGER, div : REAL) RETURNS ARRAYArrayLinSpacegenerates n evenly spaced numbers in the closure rangeArrayLinSpace(BYVAL low : INTEGER, high: INTEGER, num : INTEGER) RETURNS ARRAY