# Intrinsic Functions

An intrinsic function is a predefined function. If a user-defined function uses the same name as an Intrinsic function, it replaces the Intrinsic function.

The following are the intrinsic functions provided by Gambas:

 `Abs` Returns the absolute value of a number. `Access` Tests the access authorization of a file. `ACos` Computes the arc cosine of an angle. `ACosh` Computes the hyperbolic arc cosine of an angle. `Ang` Computes the angle polar coordinate from two rectangular coordinates. `Asc` Returns the ASCII code of a character in a string. `ASin` Computes the arc sine of an angle. `ASinh` Computes the hyperbolic arc sine of an angle. `ATan` Computes the arc tangent of an angle. `ATan2` Computes the arc tangent of two numbers. `ATanh` Computes the hyperbolic arc tangent of an angle. `Bool@` Return the Boolean value located at a given memory address. `Byte@` Return the Byte value located at a given memory address. `CBool` Converts a value to a Boolean. `Cbr` Cubic root `CByte` Converts a value to a Byte. `CDate` Converts a value to a Date. `CFloat` Converts a value to a Float. `Chr\$` Returns a character from its ASCII code. `CInt` Converts a value to an Integer. `CLong` Converts a value to a Long. `CLOSE` Closes a stream `Comp` Compares two strings. `Conv\$` Converts a string from a charset to another charset. `COPY` Copy a file. `Cos` Computes the cosine of an angle. `Cosh` Computes the hyperbolic cosine of an angle. `CShort` Converts a value to a Short. `/wiki/lang/csng` Converts a value to a Single. `CStr` Converts a value to a String. `CVariant` Converts a value to a Variant. `Date` Returns a date without its time component. `DateAdd` Adds a period to a given date. `DateDiff` Returns the period between two dates. `Day` Returns the day of a Date value. `DConv\$` Converts a string from the system charset to UTF-8 (the desktop charset). `DEC` Decrements a variable. `Deg` Converts radians to degrees. `DFree` Returns the free space on a device. `Dir` Browses a directory. `Eof` Returns if the end of file is reached. `ERROR` Prints expressions to the error standard output. `ERROR TO` Redirects the standard error output. `Exist` Checks if a specific file or directory exists. `Exp` Exponential, e^x `Exp2` 2^x `Exp10` 10^x `Expm` Exp(x) - 1 `Eval` Evaluates an expression. `Fix` Returns the integer part of a number. `Float@` Return the Float value located at a given memory address. `FLUSH` Flushes the output of a buffered stream. `Format\$` Format a number or a date. `Frac` Returns the fractional part of a number. `Hour` Returns the hours of a Date value. `Html\$` Quotes a string so that it is valid html. `Hyp` Calculate the hypotenuse of a triangle. `INC` Increments a variable. `INPUT` Reads strings from a text stream and converts them into values. `INPUT FROM` Redirects the standard input. `InStr` Searches a string into another string. `Int` Returns the mathematical integer part of a number. `Int@` Return the Integer value located at a given memory address. `IsDir` Returns if a path points at a directory. `KILL` Removes a file. `LCase\$` Converts a string to lowercase. `Left\$` Returns the first characters of a string. `Len` Returns the length of a string. `LINE INPUT` Reads lines from a text stream. `LOCK` Locks an opened stream. `Lof` Returns the length of a stream. `Long@` Return the Long value located at a given memory address. `LINK` Creates a symbolic link. `Log` Neperian logarithm, base e logarithm `Log2` Base 2 logarithm `Log10` Decimal logarithm `Logp` Log(1+x) `LTrim\$` Strips white spaces from the left of a string. `Mag` Computes the distance polar coordinate from two rectangular coordinates. `Max` Returns the maximum number. `Mid\$` Returns a part of a string. `Min` Returns the minimum number. `Minute` Returns the minutes of a Date value. `MKDIR` Creates a directory. `Month` Returns the month of a Date value. `MOVE` Renames or moves a file or a directory. `Now` Returns the current date and time. `OPEN` Opens a file for reading or writing and creates a stream for it. `OUTPUT TO` Redirects the standard output. `Pi` Returns π or a multiple of π. `PIPE` Opens a named pipe for reading or writing and creates a stream for it. `Pointer@` Return the Pointer value located at a given memory address. `PRINT` Prints expressions to a stream. `Quote\$` Quotes a string. `Rad` Converts degrees to radians. `RANDOMIZE` Intializes the pseudo-random number generator. `RDir` Browses a directory recursively. `READ` Reads binary data from a stream. `Replace\$` Replaces in a string a substring by another one. `Right\$` Returns the last characters of a string. `RInStr` Searches a string into another string from its right. `RMDIR` Removes an empty directory. `Rnd` Returns a pseudo-random number. `Round` Rounds a number. `RTrim\$` Strips white spaces from the right of a string. `Scan` Splits a string against a regular expression pattern. `SConv\$` Converts a string from UTF-8 (the desktop charset) to the system charset. `Second` Returns the seconds of a Date value. `SEEK` Change the position of the stream file pointer. `Seek` Gets the position of the stream file pointer. `Sgn` Returns the sign of a number. `Short@` Return the Short value located at a given memory address. `Sin` Computes the sine of an angle. `Single@` Return the Single value located at a given memory address. `Sinh` Computes the hyperbolic sine of an angle. `Space\$` Returns a string containing only space. `Split` Splits a string into substrings. `Sqr` Square root `Stat` Get information about a file. `Str\$` Converts a number or a date into a string. `String\$` Returns the same string concatenated many times. `Subst\$` Substitutes strings in a pattern. `Tan` Computes the tangent of an angle. `Tanh` Computes the hyperbolic tangent of an angle. `Temp\$` Makes temporary file names. `Time` Returns the time part of a Date value. `Timer` Returns the number of elapsed seconds since the program started. `Tr\$` Translate a string. `Trim\$` Strips white spaces from a string. `UCase\$` Converts a string to uppercase. `UNLOCK` Unlocks an opened stream. `UnQuote\$` Unquotes a string. `Val` Converts a string into a number or a date. `Week` Returns the week number of a Date value. `WeekDay` Returns the week day of a Date value. `WRITE` Write binary data to a stream. `Year` Returns the year of a Date value.

Most of these functions only deal with ASCII strings. To manipulate UTF-8 strings, use the String class.