Function Reference
From Sputnik Wiki
(Difference between revisions)
(→Text File Create/Read/Write Functions) |
(→Text File Create/Read/Write Functions) |
||
Line 51: | Line 51: | ||
* [[Core Function FileReadLine|FileReadLine( <file>, <expression> )]] -- Read a line of text from a previously opened text file (Or specify a name of a file) | * [[Core Function FileReadLine|FileReadLine( <file>, <expression> )]] -- Read a line of text from a previously opened text file (Or specify a name of a file) | ||
* [[Core Function FileReadLines|FileReadLines( <file> )]] -- Read all lines of text from a previously opened text file (Or specify a name of a file) | * [[Core Function FileReadLines|FileReadLines( <file> )]] -- Read all lines of text from a previously opened text file (Or specify a name of a file) | ||
+ | * [[Core Function FileSave|FileSave( <file>, <expression> )]] -- Save all text to a file | ||
+ | * [[Core Function FileLoad|FileLoad( <file>, <expression> )]] -- Load all text from a file | ||
==== Misc Functions ==== | ==== Misc Functions ==== |
Revision as of 11:11, 9 November 2011
Contents |
Function Reference
User Functions
Core Functions
Console Functions
- Print( <expression> ) -- Prints an expressions string value to the console window.
- Println( <expression> ) -- Prints an expressions string value to the console window and inserts a newline charactor at the end.
- Input( <expression> ) -- Capture a string typed to console window.
- InputC( <expression> ) -- Capture a char typed to console window.
- Cls( ) -- Clear all text from the console window.
Variable Type Conversions
- Byte( <expression> ) -- Returns the 8-bit integer (whole number) representation of an expression.
- Int16( <expression> ) -- Returns the 16-bit integer (whole number) representation of an expression.
- Int32( <expression> ) (Alias: Int( $variable )) -- Returns the 32-bit integer (whole number) representation of an expression.
- Int64( <expression> ) -- Returns the 64-bit integer (whole number) representation of an expression.
- Float( <expression> ) -- Returns the 32-bit floating point representation of an expression.
- Double( <expression> ) -- Returns the 64-bit floating point representation of an expression.
- String( <expression> ) -- Returns the String representation of an expression.
Common Variable Functions
- isInt( $variable ) -- Checks if a variable is an integer type
- isFloat( $variable ) -- Checks if a variable is a float-type
- isNumber( $variable ) -- Checks if a variable is a integer or float-type
- isString( $variable ) -- Checks if a variable is a string type
- isArray( $variable ) -- Check if a variable is an array
- isHash( $variable ) -- Check if a variable is an hash
- isObj( $variable ) -- Check if a variable is an object type
- isClass( $variable ) -- Check if a variable's object type is a class
- isStruct( $variable ) -- Check if a variable's object type is a struct
Math Functions
- Abs( <expression> ) -- Calculates the absolute value of a number
- ACos( <expression> ) -- Calculates the arcCosine of a number
- ASin( <expression> ) -- Calculates the arcsine of a number
File Functions
Text File Create/Read/Write Functions
- FileOpen( <FileName>, <flag> ) -- Opens a text file for reading or writing
- FileClose( <file> ) -- Closes a previously opened file
- FileWrite( <file>, <expression> ) -- Write text to previously opened text file at the current File Steam pointer location
- FileAppend( <file>, <expression> ) -- Append a line of text to the end of a previously opened text file
- FileSeek( <file>, <offset>, <flag> ) -- Change the POSITION of the File Stream pointer
- FilePos( <file> ) -- Get the current POSITION of the File Stream pointer
- FileRead( <file>, <expression> ) -- Read a number of characters from a previously opened text file starting from current File Steam pointer location
- FileReadLine( <file>, <expression> ) -- Read a line of text from a previously opened text file (Or specify a name of a file)
- FileReadLines( <file> ) -- Read all lines of text from a previously opened text file (Or specify a name of a file)
- FileSave( <file>, <expression> ) -- Save all text to a file
- FileLoad( <file>, <expression> ) -- Load all text from a file
Misc Functions
- Return( <expression> ) -- Returns a result from a Function.
- Require( <expression> ) -- Includes a file in the current script.