IntellePret Documentation

IntellePret Built-in Functions

Numeric Functions  
Int double Int(double Value)
Return the smallest integer less than or equal to Value

Example:
Int(100.23456) returns 100
Int(-100.23456) returns -101
Fix double Fix(double Value)
Removes the fractional part of the number and returns the resulting integer.

Example:
Int(100.23456) returns 100
Int(-100.23456) returns -100
Round double Round(double Value)
Returns Value rounded to the nearest integer value.

Example:

Round(100.2346) returns 100
Round(100.5346) returns 101
Round double Round(double Value, double DecimalPlaces)
Returns Value rounded to the specified number of decimal places.

Example:

Round(100.2346, 2) returns 100.23
Round(100.7654, 2) returns 100.77
Sqrt double Sqrt(double Value)
Returns the square root of Value. If Value is 0 a runtime error will be reported.

Example:

Sqrt(100) returns 10
Abs double Abs(double Value)
Returns the absolute value of a number

Example:
Abs(-100) returns 100
Sign double Sign(double Value)
Returns the sign of value. If Value > 0 returns 1. If Value < 0 returns -1. If Value == 0 returns 0.

Example:
Sign(100) returns 1
Sign(-100) returns -1
Sign(0) returns 0
Max double Max(double Value1, double Value2)
Returns the larger of the two arguments.
Min double Min(double Value1,double Value2)
Returns the smaller of the two arguments.
Trigonometric Functions  
ACos double ACos(double Value)
Returns the arccosine of Value in the range 0 to p radians. If x is less than –1 or greater than 1, it returns an indefinite (same as a quiet NaN).
ASin double ASin(double Value)
Returns the arcsine of x in the range –p/2 to p/2 radians. If x is less than –1 or greater than 1, it returns an indefinite (same as a quiet NaN).
ATan double ATan(double Value)
Returns the arctangent of Value. Returns in the range –p/2 to p/2 radians. If Value is 0, returns 0.
ATan double ATan(double Value, double Divider)
Returns the arctangent of Value/Divider. If both parameters are 0, the function returns 0. Returns in the range –p to p radians, using the signs of both parameters to determine the quadrant of the return value.
Ceil double Ceil(double Value)
Returns the smallest integer that is greater than or equal to Value.
Cos double Cos(double Value)
Returns the cosine of Value. If Value is greater than or equal to 263, or less than or equal to –263, a loss of significance in the result of the call occurs.
CosH double CosH(double Value)
Returns the hyperbolic cosine of Value. If Value is greater than or equal to 263, or less than or equal to –263, a loss of significance in the result of the call occurs.
Floor double Floor(double Value)
Returns the largest integer that is less than or equal to Value.
Log double Log(double Value)
Returns the logarithm of Value if successful. If Value is negative, return an indefinite (same as a quiet NaN). If Value is 0, returns INF (infinite).
Log10 double Log10(double Value)
Returns the logarithm (base 10) of Value if successful. If Value is negative, returns an indefinite (same as a quiet NaN). If Value is 0, returns INF (infinite).
Sin double Sin(double Value)
Returns the sine of Value. If Value is greater than or equal to 263, or less than or equal to –263, a loss of significance in the result occurs, in which case the function returns an indefinite (same as a quiet NaN).
SinH double SinH(double Value)
Returns the hyperbolic sine of Value. If the result is too large returns ±HUGE_VAL.
Tan double Tan(double Value)
Returns the tangent of Value. If Value is greater than or equal to 263, or less than or equal to –263, a loss of significance in the result occurs, in which case returns an indefinite (same as a quiet NaN).
TanH double TanH(double Value)
Returns the hyperbolic tangent of Value.
String Functions  
MakeIntChar string MakeIntChar(int Value)
Returns a string of 1 character, the character being of "Value".

Example:
MakeIntChar(65) returns "A".
MakeCharInt int MakeCharInt(string Char)
Returns the value of the first character in the string "Char". If the string is empty the value is 0.

Example:
MakeCharInt("A") returns 65.
MakeStrInt int MakeStrInt(string Value)
Converts the string into an integer value and returns it. Stops converting the string when it finds the first character it cannot convert or reaches the end of the string.

Example:
MakeStrInt("123.98") returns 123.
MakeStrDbl double MakeStrDbl(string Value)
Converts the string into a double value and returns it. Stops converting the string when it finds the first character it cannot convert or reaches the end of the string.

Example:
MakeStrDbl("123.98") returns 123.98 .
StrMake string StrMake(int Value)
Returns the integer formatted as a string.

Example:
StrMake(123) returns a string "123".
  string StrMake(double Value)
Returns the double formatted as a string, with 6 decimal places.

Example:
StrMake(123.45) returns a string "123.450000".
  string StrMake(double Value, int DecimalPlaces)
Returns the double formatted as a string have the specified decimal places. The double is rounded appropriately.

Example:
StrMake(123.4567, 2 ) returns a string "123.46".
StrLeft string StrLeft(string Str ,int Count)
Returns a string which contains a copy of the left most "Count" of characters of string "Str".

Example:
StrLeft("ABCDEF", 3 ) returns "ABC".
StrMid StrMid(string Str, int Position, int Count)
Returns a string which contains a copy of "Count" characters of string "Str" beginning from "Position". If "Count" is not specified, returns all the character from "Position" to the end of the string.

Example:
StrMid("ABCDEF", 3,2 ) returns "CD".
StrMid("ABCDEF", 3 ) returns "CDEF".
StrRight string StrRight(string Str, int Count)
Returns a string which contains a copy of the right most "Count" of characters of string "Str".

Example:
StrRight("ABCDEF", 3 ) returns "DEF".
StrLen int StrLen(string Str)
Returns the length of string "Str".

Example:
StrLen("ABCDEF" ) returns 6.
StrTrim string StrTrim(string Str)
Returns a string which contains a copy of "Str" with all leading and trailing spaces removed.

Example:
StrTrim(" ABCDEF " ) returns "ABCDEF".
StrLTrim string StrLTrim(string Str)
Returns a string which contains a copy of "Str" with all leading spaces removed.

Example:
StrLTrim(" ABCDEF " ) returns "ABCDEF ".
StrRTrim string StrRTrim(string Str)
Returns a string which contains a copy of "Str" with all trailing spaces removed.

Example:
StrRTrim(" ABCDEF " ) returns " ABCDEF".
StrLPad string StrLPad(string Str, int TotalLen, string PadChar)
Returns a string of length "TotalLen", padded to the left with the first character of "PadChar". If "PadChar" is not specified, pads using a space. If "TotalLen" is less than or equal to the length of "Str" or "PadChar" is empty, "Str" is returned.

Example:
StrLPad("Intell", 8, "*+") returns "**Intell"
StrRPad string StrRPad(string Str, int TotalLen, string PadChar)
Returns a string of length "TotalLen", padded to the right with the first character of "PadChar". If "PadChar" is not specified, pads using a space. If "TotalLen" is less than or equal to the length of "Str" or "PadChar" is empty, "Str" is returned.

Example:
StrRPad("Intell", 8, "*+") returns "Intell**"
StrUpper string StrUpper(string Str)
Returns a string which contains a copy of "Str" in upper case.

Example:
StrUpper("Intellessence" ) returns "INTELLESSENCE".
StrLower string StrLower(string Str)
Returns a string which contains a copy of "Str" in lower case.

Example:
StrLower("IntellessencE" ) returns "intellessence".
StrBuild string StrBuild(int Count, string Str)
Returns a string containing "Count" repetitions of string "Str".

Example:
StrBuild(3, "AB" ) returns "ABABAB".
StrSpaces string StrSpaces(int Count)
Returns a string containing "Count" spaces.

Example:
StrSpaces(3) returns a string with 3 spaces.
StrFind int StrFind(string Str, string SubStr, int Position)
Searches for the sub-string "SubStr" in string "Str", beginning from position "Position". If "Position" is not specified, begins from position 1. Returns the position within string "Str" where the sub-string "SubStr" was found. If not found, returns 0.

Example:
StrFind("Intellessence", "ll", 3) returns 5.
StrFindReverse int StrFindReverse(string Str, string SubStr, int Position)
Searches for the sub-string "SubStr" in string "Str", begining from position "Position", and searching in reverse order (from the end of the string to the beginning). If "Position" is not specified, begins from the end of th string (position StrLen(Str)). Returns the position within string "Str" where the sub-string "SubStr" was found. If not found, returns 0.

Example:
StrFindReverse("Intellessence", "e", 11) returns 10.
StrFindI int StrFindI(string Str, string SubStr, int Position)
Performs a case insensitive search similar to StrFind().

Example:
StrFindI("Intellessence", "Ll", 3) returns 5.
StrFindReverseI int StrFindReverseI(string Str, string SubStr, int Position)
Performs a case insensitive search similar to StrFindReverse().

Example:
StrFindReverseI("Intellessence", "E", 11) returns 10.
StrInsert string StrInsert(string Str, string SubStr, int Position)
Inserts sub-string "SubStr" into string "Str" at position "Position". Returns the modified string.

Example:
StrInsert("Intellessence", "igent ", 7) returns "Intelligent essence".
StrReplace string StrReplace(string Str, string SubStr, int Position, int ReplaceLen)
If the replace length "ReplaceLen" is not specified, replaces the characters in String "Str" at position "Position" with the characters in string "SubStr". (The "ReplaceLen" is computed as the length of "SubStr").
If the replace length "ReplaceLen" is specified, replaces the count of "ReplaceLen" characters in String "Str" at position "Position", with the characters in string "SubStr".
Returns the modified string.

Example:
StrReplace("ReplaceThis", "That", 8) returns "ReplaceThat".
StrReplace("ReplaceThese", "That", 8, 5) returns "ReplaceThat".

Home: www.intellessence.com. Copyright © 1998 - 2000 Intellessence Inc. All rights reserved.