Function Reference

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Language Features)
(NBTTagCompound)
 
(104 intermediate revisions by one user not shown)
Line 20: Line 20:
 
* [[Core Function Pointer Read/Write Bracket|$ptr[<index>]:<type> = <value>]] -- Read and Write to memory pointers similar to PTRRead() and PTRWrite() but using [] to simulate like it's an array
 
* [[Core Function Pointer Read/Write Bracket|$ptr[<index>]:<type> = <value>]] -- Read and Write to memory pointers similar to PTRRead() and PTRWrite() but using [] to simulate like it's an array
 
* [[Core Function Array Splicing|Array Splicing]] -- Copy parts out of an array and return them as a new array
 
* [[Core Function Array Splicing|Array Splicing]] -- Copy parts out of an array and return them as a new array
 +
* [[Core Function Function Variables|Function Variables]] -- Dynamically create function source code and place it in a variable and call it from the variable
 +
 
===== Parser Engine =====
 
===== Parser Engine =====
 
* [[Core Function Parser Engine|Parser Engine]] -- Parse text and have classes created and returned to you
 
* [[Core Function Parser Engine|Parser Engine]] -- Parse text and have classes created and returned to you
Line 35: Line 37:
 
* [[Core Function VPrintf|VPrintf( <expression>, <expressions>... )]] -- Print a formatted string (similar to the C printf() function) using an array as the parameters  
 
* [[Core Function VPrintf|VPrintf( <expression>, <expressions>... )]] -- Print a formatted string (similar to the C printf() function) using an array as the parameters  
 
* [[Core Function PrintfC|PrintfC( <format control>, <params> )]] -- Print a formatted string to the console window
 
* [[Core Function PrintfC|PrintfC( <format control>, <params> )]] -- Print a formatted string to the console window
* [[Core Function Input|Input( <expression> )]] -- Capture a string typed to console window
+
* [[Core Function Input|Input( <prompt> )]] -- Capture a string typed to console window
* [[Core Function InputC|InputC( <expression> )]] -- Capture a char typed to console window
+
* [[Core Function InputC|InputC( <prompt/flag> )]] -- Capture a char (or info about the char) typed to console window
 
* [[Core Function Pause|Pause( <expression> )]] -- Pause the execution of the script on the console window until any key is pressed
 
* [[Core Function Pause|Pause( <expression> )]] -- Pause the execution of the script on the console window until any key is pressed
 
* [[Core Function ConsoleClear|Cls( )]] -- Alias for [[Core Function ConsoleClear|ConsoleClear( )]]
 
* [[Core Function ConsoleClear|Cls( )]] -- Alias for [[Core Function ConsoleClear|ConsoleClear( )]]
 
* [[Core Function ConsoleClear|ConsoleClear( )]] -- Clear all text from the console window
 
* [[Core Function ConsoleClear|ConsoleClear( )]] -- Clear all text from the console window
 +
* [[Core Function ConsoleKeyAvailable|ConsoleKeyAvailable( )]] -- Check if there is a key ready to be read from the console
 +
* [[Core Function ConsoleCapsLock|ConsoleCapsLock( )]] -- Check if caps lock is down on the console
 +
* [[Core Function ConsoleSetCursor|ConsoleSetCursor( <posX>, <posY> )]] -- Set the cursor position on the console
 +
* [[Core Function ConsoleSetBuffer|ConsoleSetBuffer( <width>, <height> )]] -- Set the console text buffer size
 +
* [[Core Function ConsoleSetSize|ConsoleSetSize( <width>, <height> )]] -- Set the console window size
 
* [[Core Function ConsoleHide|ConsoleHide( )]] -- Hide the console window
 
* [[Core Function ConsoleHide|ConsoleHide( )]] -- Hide the console window
 
* [[Core Function ConsoleShow|ConsoleShow( )]] -- Show the console window
 
* [[Core Function ConsoleShow|ConsoleShow( )]] -- Show the console window
Line 56: Line 63:
 
* [[Core Function ConsoleCursorSize|ConsoleCursorSize( <newval> )]] -- Gets or sets the height of the cursor within a character cell
 
* [[Core Function ConsoleCursorSize|ConsoleCursorSize( <newval> )]] -- Gets or sets the height of the cursor within a character cell
 
* [[Core Function ConsoleCursorVisible|ConsoleCursorVisible( <newval> )]] -- Gets or sets a value indicating whether the cursor is visible
 
* [[Core Function ConsoleCursorVisible|ConsoleCursorVisible( <newval> )]] -- Gets or sets a value indicating whether the cursor is visible
 +
* [[Core Function CGIConsole|CGIConsole( )]] -- Changes the console printing to work best a CGI instead of stand alone terminal
  
 
==== Multi-Threading Functions ====
 
==== Multi-Threading Functions ====
Line 121: Line 129:
 
===== Type Checking =====
 
===== Type Checking =====
  
 +
* [[Core Function isVar|isVar( $variable, <type>, <strict> )]] -- Checks if a variable is a type (as a string) or inherits from a type (if not strict) (the same as $a ~~ Type)
 
* [[Core Function isVarChar|isVarChar( $variable )]] -- Checks if a variable is a char type
 
* [[Core Function isVarChar|isVarChar( $variable )]] -- Checks if a variable is a char type
 
* [[Core Function isVarBool|isVarBool( $variable )]] -- Checks if a variable is a boolean type
 
* [[Core Function isVarBool|isVarBool( $variable )]] -- Checks if a variable is a boolean type
Line 152: Line 161:
 
* [[Core Function isVarArray|isVarArray( $variable )]] -- Check if a variable is an array
 
* [[Core Function isVarArray|isVarArray( $variable )]] -- Check if a variable is an array
 
* [[Core Function isVarObj|isVarObj( $variable, <type> )]] -- Check if a variable is an object type (This includes classes, file handles etc)
 
* [[Core Function isVarObj|isVarObj( $variable, <type> )]] -- Check if a variable is an object type (This includes classes, file handles etc)
* [[Core Function isVarClass|isVarClass( $variable, <type> )]] -- Check if a variable's object type is a class
+
* [[Core Function isVarClass|isVarClass( $variable, <type>, <strict> )]] -- Check if a variable's object type is a class
 
* [[Core Function isVarDLLStruct|isVarDLLStruct( $variable )]] -- Check if a variable holds a DLLStruct
 
* [[Core Function isVarDLLStruct|isVarDLLStruct( $variable )]] -- Check if a variable holds a DLLStruct
* [[Core Function isVarGUIObject|isVarGUIObject( $variable )]] -- Check if a variable holds a GUI Object
 
 
* [[Core Function isVarServer|isVarServer( $variable )]] -- Check if a variable holds a Server object from Listen()
 
* [[Core Function isVarServer|isVarServer( $variable )]] -- Check if a variable holds a Server object from Listen()
 
* [[Core Function isVarClient|isVarClient( $variable )]] -- Check if a variable holds a Client object from Connect()
 
* [[Core Function isVarClient|isVarClient( $variable )]] -- Check if a variable holds a Client object from Connect()
Line 167: Line 175:
 
* [[Core Function GetVarObjType|GetVarObjType( $variable )]] -- Get the common object type of a variable (If it is an object)
 
* [[Core Function GetVarObjType|GetVarObjType( $variable )]] -- Get the common object type of a variable (If it is an object)
 
* [[Core Function GetVarObjTypeName|GetVarObjTypeName( $variable )]] -- Get the common object type of a variable (If it is an object) and return it as string
 
* [[Core Function GetVarObjTypeName|GetVarObjTypeName( $variable )]] -- Get the common object type of a variable (If it is an object) and return it as string
* [[Core Function GetVarGUIObjType|GetVarGUIObjType( $variable )]] -- Get the common object type of a variable (If it is a GUI object)
 
  
 
==== Binary Data Management Functions ====
 
==== Binary Data Management Functions ====
 
* [[Core Function Bin|Bin( <args> )]] -- Create a new binary variable
 
* [[Core Function Bin|Bin( <args> )]] -- Create a new binary variable
 +
* [[Core Function Op|Op( <opCodes> )]] -- Create a new binary variable from a string of opCodes such as "AA 10 20"
 
* [[Core Function BinaryCreate|BinaryCreate( <size>, <fill> )]] -- Create a new binary variable and its array size and fill data type  
 
* [[Core Function BinaryCreate|BinaryCreate( <size>, <fill> )]] -- Create a new binary variable and its array size and fill data type  
 
* [[Core Function BinaryClone|BinaryClone( <binary-array> )]] -- Clone a binary variable 100% and return a new binary variable with exactly same data as the old one
 
* [[Core Function BinaryClone|BinaryClone( <binary-array> )]] -- Clone a binary variable 100% and return a new binary variable with exactly same data as the old one
Line 196: Line 204:
 
* [[Core Function BinaryMid|BinaryMid( <binary-array>, <start>, <length> )]] -- Create a binary variable by extracting a number of bytes from another binary variable
 
* [[Core Function BinaryMid|BinaryMid( <binary-array>, <start>, <length> )]] -- Create a binary variable by extracting a number of bytes from another binary variable
 
* [[Core Function BinaryMidReplace|BinaryMidReplace( <binary-array>, <replacement>, <start>, <length> )]] -- Replace a section (from start to length) of the binary with the replacement binary
 
* [[Core Function BinaryMidReplace|BinaryMidReplace( <binary-array>, <replacement>, <start>, <length> )]] -- Replace a section (from start to length) of the binary with the replacement binary
* [[Core Function BinaryConcat|BinaryConcat( <values> )]] -- Mass append a ton of Binary variables in an extremely fast and efficient way
+
* [[Core Function BinaryConcat|BinaryConcat( <destination/array>, <values> )]] -- Mass append a ton of Binary variables in an extremely fast and efficient way
 
* [[Core Function BinaryJoin|BinaryJoin( <separator>, <values>, <start>, <count> )]] -- Create a new Binary by joining together a ton of Binary variables in an extremely fast and efficient way
 
* [[Core Function BinaryJoin|BinaryJoin( <separator>, <values>, <start>, <count> )]] -- Create a new Binary by joining together a ton of Binary variables in an extremely fast and efficient way
 
* [[Core Function BinaryAppend|BinaryAppend( <binary-array>, <binary-array2>, <flag> )]] -- Append a binary variables data onto the end or beginning of another binary variables data
 
* [[Core Function BinaryAppend|BinaryAppend( <binary-array>, <binary-array2>, <flag> )]] -- Append a binary variables data onto the end or beginning of another binary variables data
Line 225: Line 233:
 
* [[Core Function BinaryLoad|BinaryLoad( <file>, <flag> )]] -- Create a new binary variable by loading binary data from a file
 
* [[Core Function BinaryLoad|BinaryLoad( <file>, <flag> )]] -- Create a new binary variable by loading binary data from a file
  
===== Pack/Unpack =====
+
===== Binary packer/unpacker =====
 
* [[Core Function Pack|Pack( <format>, <args> )]] -- Pack data into a binary array
 
* [[Core Function Pack|Pack( <format>, <args> )]] -- Pack data into a binary array
 
* [[Core Function Unpack|Unpack( <format>, <data/binary-array>, <flag> )]] -- Unpack data from a binary array
 
* [[Core Function Unpack|Unpack( <format>, <data/binary-array>, <flag> )]] -- Unpack data from a binary array
 +
* [[Core Function PackSingle|PackSingle( <format>, <value> )]] -- Pack a single value into a binary array
 +
* [[Core Function UnpackSingle|UnpackSingle( <format>, <data/binary-array>, <position> )]] -- Unpack a single value from a binary array optionally from a given index
  
 
===== Bit Vector =====
 
===== Bit Vector =====
Line 239: Line 249:
 
* [[Core Function FillBit|FillBit( <binary-array>, <value> )]] -- Set all bits to the value
 
* [[Core Function FillBit|FillBit( <binary-array>, <value> )]] -- Set all bits to the value
  
==== Binary Memory Stream Management Functions ====
+
===== BinHex 5.0 =====
* [[Core Function StreamCreate|StreamCreate( )]] -- Create a new binary stream
+
* [[Core Function BinHexEncode|BinHexEncode( <name>, <type>, <creator>, <resourceFork>, <dataFork>, <flag1>, <flag2> )]] -- Encode data (usually a file) to BinHex 5.0 format
* [[Core Function StreamCreateB|StreamCreateB( <binary-stream>, <binary-array> )]] -- Create a new binary stream from a binary variable
+
* [[Core Function BinHexDecode|BinHexDecode( <binhex-binary> )]] -- Decode data (usually a file) from BinHex 5.0 format
* [[Core Function StreamLen|StreamLen( <binary-stream> )]] -- Get the length of a binary stream
+
 
* [[Core Function StreamSetLen|StreamSetLen( <binary-stream>, <length> )]] -- Set the length of a binary stream
+
===== ByteBuffer =====
* [[Core Function StreamPos|StreamPos( <binary-stream> )]] -- Get the current seek position of a binary stream
+
The ByteBuffer is the replacement for the old Stream functions it is more robust, has more features and is resistant to crashes/errors from bad information etc it works similar to the ByteBuffer in Java
* [[Core Function StreamSeek|StreamSeek( <binary-stream>, <pos> )]] -- Set the seek position of a binary stream
+
* [[Core Function ByteBufferNew|ByteBufferNew( <nothing/capacity/binary/byteBuffer> )]] -- Make a new ByteBuffer
* [[Core Function StreamCompare|StreamCompare( <binary-stream>, <binary-stream2> )]] -- Compare two binary streams to see if they are identical in data content
+
* [[Core Function ByteBufferGet|ByteBufferGet( <byteBuffer>, <type>, <index> )]] -- Get data from a ByteBuffer
* [[Core Function StreamRead|StreamRead( <binary-stream>, <count> )]] -- Read a number of bytes from a binary stream
+
* [[Core Function ByteBufferPut|ByteBufferPut( <byteBuffer>, <type>, <variable> )]] -- Add data to a ByteBuffer
* [[Core Function StreamReadByte|StreamReadByte( <binary-stream> )]] -- Read a single byte from a binary stream
+
* [[Core Function ByteBufferPeek|ByteBufferPeek( <byteBuffer>, <type> )]] -- Peek at data from a ByteBuffer (same as get but without moving the position forward)
* [[Core Function StreamReadUnpack|StreamReadUnpack( <binary-stream>, <count>, <def>, <unpack-flag> )]] -- Read from a binary stream the same way Unpack() is used
+
* [[Core Function ByteBufferGetBinary|ByteBufferGetBinary( <byteBuffer>, <offset>, <length> )]] -- Get all the binary data from a ByteBuffer (ignores the position) or get all bytes starting from offset to a given length (or all remaining bytes from that offset)
* [[Core Function StreamWrite|StreamWrite( <binary-stream>, <binary-array> )]] -- Write the bytes from a binary variable to the binary stream
+
* [[Core Function ByteBufferCapacity|ByteBufferCapacity( <byteBuffer> )]] -- Get the current capacity of a ByteBuffer
* [[Core Function StreamWriteByte|StreamWriteByte( <binary-stream>, <binary-array> )]] -- Write a single byte to the binary stream
+
* [[Core Function ByteBufferRewind|ByteBufferRewind( <byteBuffer> )]] -- Set the position of a ByteBuffer back to the start
* [[Core Function StreamWritePack|StreamWritePack( <binary-stream>, <def>, <params> )]] -- Write a data to the binary stream the same way Pack() is used
+
* [[Core Function ByteBufferLimit|ByteBufferLimit( <byteBuffer> )]] -- Get the current capacity/length that can be written (based on its currently allocated size) of a ByteBuffer
* [[Core Function StreamToBinary|StreamToBinary( <binary-stream> )]] -- Return a new binary variable from the data within the binary stream
+
* [[Core Function ByteBufferPosition|ByteBufferPosition( <byteBuffer>, <newPosition> )]] -- Get and set the position of a ByteBuffer to any value
* [[Core Function StreamSave|StreamSave( <binary-stream>, <file>, <flag> )]] -- Save the binary stream to file
+
* [[Core Function ByteBufferRemaining|ByteBufferRemaining( <byteBuffer> )]] -- Get how many bytes are possible to read from current position of a ByteBuffer
* [[Core Function StreamLoad|StreamLoad( <file>, <flag> )]] -- Load a binary stream from file
+
* [[Core Function ByteBufferHasRemaining|ByteBufferHasRemaining( <byteBuffer> )]] -- Check if its possible to read at least one byte from the ByteBuffer
 +
* [[Core Function ByteBufferClear|ByteBufferClear( <byteBuffer> )]] -- Clear all data from a ByteBuffer (reset it back to new) also if the mark is defined then it is discarded
 +
* [[Core Function ByteBufferFlip|ByteBufferFlip( <byteBuffer> )]] -- Flip a ByteBuffer it flips this buffer then the limit is set to the current position and then the position is set to zero also if the mark is defined then it is discarded
 +
* [[Core Function ByteBufferMark|ByteBufferMark( <byteBuffer> )]] -- Mark the position in a ByteBuffer
 +
* [[Core Function ByteBufferReset|ByteBufferReset( <byteBuffer> )]] -- Reset the position to the previously marked position in a ByteBuffer
 +
* [[Core Function ByteBufferCompare|ByteBufferCompare( <byteBuffer>, <byteBuffer> )]] -- Compare two ByteBuffers to see if they are equal
 +
* [[Core Function ByteBufferClone|ByteBufferClone( <byteBuffer> )]] -- Clone a ByteBuffer
 +
* [[Core Function ByteBufferToBinary|ByteBufferToBinary( <byteBuffer> )]] -- Return a new binary variable from the data contained within the ByteBuffer
 +
 
 +
===== NBT (Named Binary Tag) =====
 +
Functions on par with Minecrafts NBT system but greatly expanded to include many additional features and improvements specific for Sputnik.
 +
* [[Core Function NBT|NBT( <value> )]] -- Convert a variable into an accurate NBT representation of it
 +
* [[Core Function NBTNew|NBTNew( <nbt-type>, <key>, <value> )]] -- Create a new NBT of a given type and optionally give it a name and starting value
 +
* [[Core Function NBTCompare|NBTCompare( <nbt>, <nbt> )]] -- Compare two NBT variables to see if they contain the same data
 +
* [[Core Function NBTCopy|NBTCopy( <nbt> )]] -- Make a clone of an NBT
 +
* [[Core Function NBTGetId|NBTGetId( <nbt> )]] -- Get the ID type of an NBT
 +
* [[Core Function NBTGetName|NBTGetName( <nbt> )]] -- Get the name (tag key) of an NBT
 +
* [[Core Function NBTSetName|NBTGetName( <nbt>, <new-name> )]] -- Set the name (tag key) of an NBT
 +
* [[Core Function NBTHash|NBTHash( <nbt> )]] -- Compute the CRC32 hash of an NBT
 +
* [[Core Function NBTToString|NBTToString( <nbt> )]] -- Return a string representation of an NBT
 +
* [[Core Function NBTToVar|NBTToVar( <nbt> )]] -- Return the Sputnik variable representation of an NBT
 +
* [[Core Function IsVarNBT|IsVarNBT( <value> )]] -- Check if a variable is contains an NBT
 +
 
 +
====== NBTTagCompound ======
 +
* [[Core Function NBTCompoundClear|NBTCompoundClear( <nbtCompound> )]] -- Clear all tags
 +
* [[Core Function NBTCompoundCount|NBTCompoundCount( <nbtCompound> )]] -- Return the amount of tags
 +
* [[Core Function NBTCompoundGet|NBTCompoundGet( <nbtCompound>, <tag> )]] -- Get a tag by name
 +
* [[Core Function NBTCompoundSet|NBTCompoundSet( <nbtCompound>, <tag>, <value> )]] -- Set a tag by name
 +
* [[Core Function NBTCompoundGetKeys|NBTCompoundGetKeys( <nbtCompound> )]] -- Get an array of all keys
 +
* [[Core Function NBTCompoundGetTags|NBTCompoundGetTags( <nbtCompound> )]] -- Get an array of all tags
 +
* [[Core Function NBTCompoundGetMap|NBTCompoundGetMap( <nbtCompound> )]] -- Get an associative array of all keys and tags
 +
* [[Core Function NBTCompoundHasKey|NBTCompoundHasKey( <nbtCompound>, <tag> )]] -- Check if a given tag exists by name
 +
* [[Core Function NBTCompoundIsEmpty|NBTCompoundIsEmpty( <nbtCompound> )]] -- Check if there are no tags
 +
* [[Core Function NBTCompoundRemove|NBTCompoundRemove( <nbtCompound>, <tag>, <value> )]] -- Remove a specific tag by name
 +
* [[Core Function NBTCompoundWrite|NBTCompoundWrite( <nbtCompound>, <buffer> )]] -- Write the NBTTagCompound to binary or a buffer
 +
* [[Core Function NBTCompoundRead|NBTCompoundRead( <binary-variable/buffer> )]] -- Create a new NBTTagCompound from a binary array or a buffer
 +
* [[Core Function NBTCompoundWriteFile|NBTCompoundWriteFile( <nbtCompound>, <file>, <compression> )]] -- Write the NBTTagCompound to a file
 +
* [[Core Function NBTCompoundReadFile|NBTCompoundReadFile( <file>, <compression>  )]] -- Create a new NBTTagCompound from reading a file
 +
* [[Core Function NBTCompoundCompress|NBTCompoundCompress( <nbtCompound> )]] -- Compress the NBTTagCompound to binary
 +
* [[Core Function NBTCompoundDecompress|NBTCompoundDecompress( <binary-variable> )]] -- Decompress a NBTTagCompound from binary
 +
* [[Core Function NBTCompoundWriteCompressed|NBTCompoundWriteCompressed( <nbtCompound>, <buffer> )]] -- Compress the NBTTagCompound and write it to a buffer
 +
* [[Core Function NBTCompoundReadCompressed|NBTCompoundReadCompressed( <buffer> )]] -- Decompress a NBTTagCompound from a buffer
 +
 
 +
====== NBTTagList/NBTTagListEx ======
 +
* [[Core Function NBTListAppend|NBTListAppend( <nbtList>, <value> )]] -- Add an NBT to the end of the list
 +
* [[Core Function NBTListCount|NBTListCount( <nbtList> )]] -- Return how many tags exist in the list
 +
* [[Core Function NBTListGet|NBTListGet( <nbtList>, <index> )]] -- Get a tag at the given index
 +
* [[Core Function NBTListHasId|NBTListHasId( <nbtList>, <index> )]] -- Check if an index is valid and contains a tag
 +
* [[Core Function NBTListRemove|NBTListRemove( <nbtList>, <index> )]] -- Remove the tag at the given index
 +
 
 +
===== Misc Binary Functions =====
 +
* [[Core Function TB|TB( <string> )]] -- Convert a string of up to 4 chars into a 32-Bit unsigned number (network order)
 +
* [[Core Function BT|BT( <number> )]] -- Convert a 32-Bit unsigned number (network order) into a string
 +
 
 +
==== Bit Flag Functions ====
 +
* [[Core Function HasFlag|HasFlag( <enumInst>, <flag/flags> )]] -- Check if a flag (or array of flags) is enabled in a given enum instance
 +
* [[Core Function HasFlagAny|HasFlagAny( <enumInst>, <flags>... )]] -- Check if any flag is enabled in a given enum instance
 +
* [[Core Function SetFlag|SetFlag( <enumInst>, <flag/flags>, <state> )]] -- Enable or Disable a flag (or array of flags) in a given enum instance
  
 
==== Math Functions ====
 
==== Math Functions ====
Line 281: Line 348:
 
* [[Core Function DegreesToRadians|DegreesToRadians( <value> )]] -- Converts degrees to radians
 
* [[Core Function DegreesToRadians|DegreesToRadians( <value> )]] -- Converts degrees to radians
 
* [[Core Function DegreesToRevolutions|DegreesToRevolutions( <value> )]] -- Converts degrees to revolutions
 
* [[Core Function DegreesToRevolutions|DegreesToRevolutions( <value> )]] -- Converts degrees to revolutions
 +
* [[Core Function DiffCalc|DiffCalc( <first>, <second>, <isDouble> )]] -- Calculates the difference between two values and returns information about it that can help you convert the first into the second for future needs
 
* [[Core Function Distance|Distance( <value1>, <value2> )]] -- Calculates the absolute value of the difference of two values
 
* [[Core Function Distance|Distance( <value1>, <value2> )]] -- Calculates the absolute value of the difference of two values
 
* [[Core Function Distance2D|Distance2D( <x1>, <y1>, <x2>, <y2> )]] -- Finds the distance between two points on a 2D surface
 
* [[Core Function Distance2D|Distance2D( <x1>, <y1>, <x2>, <y2> )]] -- Finds the distance between two points on a 2D surface
Line 307: Line 375:
 
* [[Core Function Mod2PI|Mod2PI( <value> )]] -- Calculates the modulo 2*PI of the specified value
 
* [[Core Function Mod2PI|Mod2PI( <value> )]] -- Calculates the modulo 2*PI of the specified value
 
* [[Core Function MatlabMod|MatlabMod( <expression>, <expression2> )]] -- Performs the Matlab modulus operation
 
* [[Core Function MatlabMod|MatlabMod( <expression>, <expression2> )]] -- Performs the Matlab modulus operation
 +
* [[Core Function OffsetCalc|OffsetCalc( <size>, <start>, <length> )]] -- Calculate the START and LENGTH of an array index
 
* [[Core Function Pow|Pow( <expression>, <expression2> )]] -- Returns a specified number raised to the specified power
 
* [[Core Function Pow|Pow( <expression>, <expression2> )]] -- Returns a specified number raised to the specified power
 
* [[Core Function RadiansToDegrees|RadiansToDegrees( <value> )]] -- Converts radians to degrees
 
* [[Core Function RadiansToDegrees|RadiansToDegrees( <value> )]] -- Converts radians to degrees
Line 328: Line 397:
 
* [[Core Function Tanh|Tanh( <expression> )]] -- Returns the hyperbolic tangent of the specified angle
 
* [[Core Function Tanh|Tanh( <expression> )]] -- Returns the hyperbolic tangent of the specified angle
 
* [[Core Function Truncate|Truncate( <expression> )]] -- Calculates the integral part of a specified decimal number
 
* [[Core Function Truncate|Truncate( <expression> )]] -- Calculates the integral part of a specified decimal number
 +
* [[Core Function WithinEpsilson|WithinEpsilson( <value1>, <value2>, <epsilon> )]] -- Checks if value1 - value2 are almost equals within a float epsilon.
 
* [[Core Function Wrap|Wrap( <value>, <min>, <max> )]] -- Wraps the specified value into a range
 
* [[Core Function Wrap|Wrap( <value>, <min>, <max> )]] -- Wraps the specified value into a range
 
* [[Core Function WrapAngle|WrapAngle( <value> )]] -- Reduces a given angle to a value between π and -π.
 
* [[Core Function WrapAngle|WrapAngle( <value> )]] -- Reduces a given angle to a value between π and -π.
Line 383: Line 453:
 
* [[Core Function HTMLSpecialChars|HTMLSpecialChars( <string>, <flags>, <encoding>, <double_encode> )]] -- Convert special characters to HTML entities
 
* [[Core Function HTMLSpecialChars|HTMLSpecialChars( <string>, <flags>, <encoding>, <double_encode> )]] -- Convert special characters to HTML entities
 
* [[Core Function HTMLSpecialCharsDecode|HTMLSpecialCharsDecode( <string>, <flags> )]] -- Convert special HTML entities back to characters  
 
* [[Core Function HTMLSpecialCharsDecode|HTMLSpecialCharsDecode( <string>, <flags> )]] -- Convert special HTML entities back to characters  
 +
* [[Core Function HTTPMakeQuery|HTTPMakeQuery( <array> )]] -- Converts an array into a properly formatted HTTP query string for use with requests etc
 +
* [[Core Function HTTPParseQuery|HTTPParseQuery( <string> )]] -- Parse an HTTP query string into an array
 
* [[Core Function Fmt|Fmt( <format control>, <params> )]] -- Create a formatted string
 
* [[Core Function Fmt|Fmt( <format control>, <params> )]] -- Create a formatted string
 
* [[Core Function FmtNumber|FmtNumber( <number>, <decimals>, <dec_point>, <thousands_sep> )]] -- Format a number with grouped thousands
 
* [[Core Function FmtNumber|FmtNumber( <number>, <decimals>, <dec_point>, <thousands_sep> )]] -- Format a number with grouped thousands
Line 390: Line 462:
 
* [[Core Function GMatch|GMatch( <string>, <pattern>, <asKeypair>, <offset> )]] -- Extract the patterns from a string and return as array or associative array
 
* [[Core Function GMatch|GMatch( <string>, <pattern>, <asKeypair>, <offset> )]] -- Extract the patterns from a string and return as array or associative array
 
* [[Core Function GSub|GSub( <string>, <pattern>, <repl>, <max> )]] -- Returns a copy of the string in which all occurrences of the pattern have been replaced by a replacement string (Or fills an array/callback function)
 
* [[Core Function GSub|GSub( <string>, <pattern>, <repl>, <max> )]] -- Returns a copy of the string in which all occurrences of the pattern have been replaced by a replacement string (Or fills an array/callback function)
* [[Core Function InStr|InStr( <string>, <substirng>, <casesense>, <occurrence>, <start> )]] -- Checks if a string contains a given substring.
+
* [[Core Function InStr|InStr( <string>, <substirng>, <ignoreCase>, <occurrence>, <start> )]] -- Checks if a string contains a given substring
 +
* [[Core Function InStrRev|InStrRev( <string>, <substirng>, <ignoreCase>, <occurrence>, <start> )]] -- Same as InStr() but searches from right to left instead of left to right
 
* [[Core Function isAlpha|isAlpha( <expression> )]] -- Checks if string contains only Alphabetic characters
 
* [[Core Function isAlpha|isAlpha( <expression> )]] -- Checks if string contains only Alphabetic characters
 
* [[Core Function isAlphaNumeric|isAlphaNumeric( <expression> )]] -- Checks if string contains only AlphaNumeric(A-Z, 0-9), Characters
 
* [[Core Function isAlphaNumeric|isAlphaNumeric( <expression> )]] -- Checks if string contains only AlphaNumeric(A-Z, 0-9), Characters
Line 452: Line 525:
 
* [[Core Function Scanf|Scanf( <expression>, <def> )]] -- Parses input from a string according to a format
 
* [[Core Function Scanf|Scanf( <expression>, <def> )]] -- Parses input from a string according to a format
 
* [[Core Function SHA1|SHA1( <expression> )]] -- Returns SHA1 hash of string
 
* [[Core Function SHA1|SHA1( <expression> )]] -- Returns SHA1 hash of string
 +
* [[Core Function Serialize|Serialize( <variable> )]] -- Convert a variable, array, class etc a string you can save to file or transfer over the internet
 
* [[Core Function SimilarText|SimilarText( <first>, <second>, <percent> )]] -- Calculates the similarity between two input strings and return a percentage of the matching between the two input strings
 
* [[Core Function SimilarText|SimilarText( <first>, <second>, <percent> )]] -- Calculates the similarity between two input strings and return a percentage of the matching between the two input strings
 
* [[Core Function Split|Split( <expression>, <delim/pattern>, <flag> )]] -- Splits up a string into substrings depending on the given delimiters.
 
* [[Core Function Split|Split( <expression>, <delim/pattern>, <flag> )]] -- Splits up a string into substrings depending on the given delimiters.
 
* [[Core Function SPrintf|SPrintf( <format control>, <params>... )]] -- Returns a formatted string (similar to the C sprintf() function)
 
* [[Core Function SPrintf|SPrintf( <format control>, <params>... )]] -- Returns a formatted string (similar to the C sprintf() function)
 
* [[Core Function StartsWith|StartsWith( <expression>, <expression2>, <flag> )]] -- Check if a string starts with a substring
 
* [[Core Function StartsWith|StartsWith( <expression>, <expression2>, <flag> )]] -- Check if a string starts with a substring
* [[Core Function StrChr|StrChr( <haystack>, <char>, <start> )]] --  Locate first occurrence of character in string
+
* [[Core Function StrChr|StrChr( <haystack>, <char>, <start>, <count> )]] --  Locate first occurrence of character in string
* [[Core Function StrrChr|StrrChr( <haystack>, <char>, <start> )]] --  Locate last occurrence of character in string
+
* [[Core Function StrrChr|StrrChr( <haystack>, <char>, <start>, <count> )]] --  Locate last occurrence of character in string
 
* [[Core Function StrShuffle|StrShuffle( <str> )]] --  Randomly shuffles a string
 
* [[Core Function StrShuffle|StrShuffle( <str> )]] --  Randomly shuffles a string
* [[Core Function Strpbrk|Strpbrk( <haystack>, <needle>, <start> )]] --  Locate a list of possible characters in string and return the position of it
+
* [[Core Function Strpbrk|Strpbrk( <haystack>, <needle>, <start>, <count> )]] --  Locate a list of possible characters in string and return the position of it
 
* [[Core Function StripCSlashes|StripCSlashes( <str> )]] -- Unescape string escaped with AddCSlashes()
 
* [[Core Function StripCSlashes|StripCSlashes( <str> )]] -- Unescape string escaped with AddCSlashes()
 
* [[Core Function StripTags|StripTags( <str>, <allowable_tags> )]] -- Strip HTML tags from a string
 
* [[Core Function StripTags|StripTags( <str>, <allowable_tags> )]] -- Strip HTML tags from a string
Line 465: Line 539:
 
* [[Core Function StrSpn|StrSpn( <subject>, <mask>, <start>, <length> )]] --  Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask
 
* [[Core Function StrSpn|StrSpn( <subject>, <mask>, <start>, <length> )]] --  Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask
 
* [[Core Function StrCSpn|StrCSpn( <subject>, <mask>, <start>, <length> )]] --  Find length of initial segment not matching mask
 
* [[Core Function StrCSpn|StrCSpn( <subject>, <mask>, <start>, <length> )]] --  Find length of initial segment not matching mask
* [[Core Function StrCmp|StrCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparison
+
* [[Core Function StrCmp|StrCmp( <str1>, <str2>, <ignoreCase>, <start>, <length> )]] -- String comparison
 
* [[Core Function StrNatCmp|StrNatCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparisons using a "natural order" algorithm
 
* [[Core Function StrNatCmp|StrNatCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparisons using a "natural order" algorithm
 
* [[Core Function StrVersCmp|StrVersCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparison holding name and indices/version numbers
 
* [[Core Function StrVersCmp|StrVersCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparison holding name and indices/version numbers
 
* [[Core Function Soundex|Soundex( <str> )]] -- Calculate the soundex key of a string
 
* [[Core Function Soundex|Soundex( <str> )]] -- Calculate the soundex key of a string
 
* [[Core Function Str2Hex|Str2Hex( <expression>, <flag> )]] -- Convert a string to a hex string
 
* [[Core Function Str2Hex|Str2Hex( <expression>, <flag> )]] -- Convert a string to a hex string
 +
* [[Core Function StrNew|StrNew( <char>, <length>, <flag> ]] -- Create a new string of a given length filled with a given char
 
* [[Core Function StrInsert|StrInsert( <expression>, <index>, <expression2> )]] -- Insert a string at a given index of another string and return the new string
 
* [[Core Function StrInsert|StrInsert( <expression>, <index>, <expression2> )]] -- Insert a string at a given index of another string and return the new string
 
* [[Core Function StrIndex|StrIndex( <expression>, <index>, <value> )]] -- Get or set a char from/to a string at a specific index
 
* [[Core Function StrIndex|StrIndex( <expression>, <index>, <value> )]] -- Get or set a char from/to a string at a specific index
* [[Core Function StrPos|StrPos( <haystack>, <needle>, <offset>, <flags> )]] -- Find the position of the first/last occurrence of a substring in a string
+
* [[Core Function StrIncrement|StrIncrement( <str> )]] -- Increment a string the same way as doing ++ on a string like $a++
* [[Core Function StrTr|StrTr( <str>, <from> <to>, <replace_pairs> )]] -- Translate characters or replace substrings
+
* [[Core Function StrPos|StrPos( <haystack>, <needle>, <flags>, <start>, <length> )]] -- Find the position of the first/last occurrence of a substring in a string
 +
* [[Core Function StrTr|StrTr( <str>, <from-to/replace_pairs> )]] -- Translate characters or replace substrings
 
* [[Core Function StrTok|StrTok( <str/token>, <token> )]] -- Tokenize string
 
* [[Core Function StrTok|StrTok( <str/token>, <token> )]] -- Tokenize string
* [[Core Function StrStr|StrStr( <haystack>, <needle>, <before_needle>, <find_last>, <case> )]] -- Find the first/last occurrence of a string
+
* [[Core Function StrStr|StrStr( <haystack>, <needle>, <before_needle>, <find_last>, <case>, <start>, <length> )]] -- Find the first/last occurrence of a string
 
* [[Core Function StrLen|StrLen( <expression> )]] -- Returns length of specified string
 
* [[Core Function StrLen|StrLen( <expression> )]] -- Returns length of specified string
 
* [[Core Function SubStr|SubStr( <expression>, <start>, <count>, <replacement> )]] -- Return part of a string or replace it
 
* [[Core Function SubStr|SubStr( <expression>, <start>, <count>, <replacement> )]] -- Return part of a string or replace it
Line 488: Line 564:
 
* [[Core Function TrimLeft|TrimLeft( <expression>, <chars> )]] -- Strip whitespace from the start of a string
 
* [[Core Function TrimLeft|TrimLeft( <expression>, <chars> )]] -- Strip whitespace from the start of a string
 
* [[Core Function TrimRight|TrimRight( <expression>, <chars> )]] -- Strip whitespace from the end of a string
 
* [[Core Function TrimRight|TrimRight( <expression>, <chars> )]] -- Strip whitespace from the end of a string
 +
* [[Core Function TrimToNull|TrimToNull( <string> )]] -- Strip all zero chars (nulls) from the end of a string
 
* [[Core Function UC|UC( <expression> )]] -- Returns string in all Upper Case
 
* [[Core Function UC|UC( <expression> )]] -- Returns string in all Upper Case
 
* [[Core Function UCFirst|UCFirst( <expression> )]] -- Upper Cases first letter of string
 
* [[Core Function UCFirst|UCFirst( <expression> )]] -- Upper Cases first letter of string
Line 495: Line 572:
 
* [[Core Function UUDecode|UUDecode( <expression> )]] -- Decodes a string that was encode using the uuencode algorithm
 
* [[Core Function UUDecode|UUDecode( <expression> )]] -- Decodes a string that was encode using the uuencode algorithm
 
* [[Core Function Unescape|Unescape( <expression>, <custom> )]] -- Remove all escapes from a string
 
* [[Core Function Unescape|Unescape( <expression>, <custom> )]] -- Remove all escapes from a string
 +
* [[Core Function Unserialize|Unserialize( <string> )]] -- Convert a string (Created with Serialize()) into its original variable/class/array etc
 +
* [[Core Function UrlEncodeBytes|UrlEncodeBytes( <binary>, <index>, <length> )]] -- Cnvert a binary variable into a URL-encoded string, starting at the specified position in the array and continuing for the specified number of bytes
 +
* [[Core Function UrlDecodeBytes|UrlDecodeBytes( <binary>, <encoding>, <index>, <length> )]] -- Convert a URL-encoded binary variable into a decoded string using the specified encoding, starting at the specified position in the array, and continuing for the specified number of bytes
 
* [[Core Function VSPrintf|VSPrintf( <format control>, <params>... )]] -- Returns a formatted string (similar to the C sprintf() function) but accepts arrays as the arguments
 
* [[Core Function VSPrintf|VSPrintf( <format control>, <params>... )]] -- Returns a formatted string (similar to the C sprintf() function) but accepts arrays as the arguments
 
* [[Core Function WordWrap|WordWrap( <str>, <width>, <break>, <cut> )]] -- Wraps a string to a given number of characters
 
* [[Core Function WordWrap|WordWrap( <str>, <width>, <break>, <cut> )]] -- Wraps a string to a given number of characters
 
==== CharPtr Functions ====
 
Note the [[Fixed|Fixed]] statement is tied directly with CharPtr
 
* [[Core Function StrNew|StrNew( <char>, <length>, <flag> ]] -- Create a new string of a given length filled with a given char (or optionally return it as a CharPtr rather than a new string)
 
* [[Core Function CharCopy|CharCopy( <dest>, <src>, <length> )]] -- Copy a length of characters from the source pointer to the destination pointer
 
* [[Core Function CharCopyRev|CharCopyRev( <dest>, <src>, <length> )]] -- Copy a length of characters from the source pointer to the destination pointer (in reverse so Hello becomes olleH)
 
  
 
==== Array Functions ====
 
==== Array Functions ====
 +
* [[Core Function SameValues|SameValues( <array> )]] -- Check if all values within an array are the same value type such as all String and return the type or return error type
 
* [[Core Function ArrayScope|ArrayScope( <array>, <scope> )]] -- Get or Set an arrays internal Sputnik scope (Only to be used by Sputnik library developers)
 
* [[Core Function ArrayScope|ArrayScope( <array>, <scope> )]] -- Get or Set an arrays internal Sputnik scope (Only to be used by Sputnik library developers)
 
* [[Core Function IsHash|IsHash( <array> )]] -- Check if all the keys in an array are Strings rather than numeric (Making it a full hashmap rather than full array or mixed)
 
* [[Core Function IsHash|IsHash( <array> )]] -- Check if all the keys in an array are Strings rather than numeric (Making it a full hashmap rather than full array or mixed)
 +
* [[Core Function IsHashAny|IsHashAny( <array> )]] -- Check if any of the keys in an array are Strings rather than numeric (Making it a possible hashmap rather than full array or mixed)
 
* [[Core Function IsArray|IsArray( <array> )]] -- Check if all the keys in an array are Numeric and none are String (Making it a full array rather than full hashmap or mixed)
 
* [[Core Function IsArray|IsArray( <array> )]] -- Check if all the keys in an array are Numeric and none are String (Making it a full array rather than full hashmap or mixed)
 
* [[Core Function IsList|IsList( <array> )]] -- Same as IsArray but also checks to make sure the keys start at 0 and end at the highest with no gaps which makes it a perfect list
 
* [[Core Function IsList|IsList( <array> )]] -- Same as IsArray but also checks to make sure the keys start at 0 and end at the highest with no gaps which makes it a perfect list
Line 513: Line 589:
 
* [[Core Function Join|Join( <array>, <separator> )]] -- Join an array into a string with an optional separator
 
* [[Core Function Join|Join( <array>, <separator> )]] -- Join an array into a string with an optional separator
 
* [[Core Function JoinKV|JoinKV( <array>, <separator> )]] -- Join an array (as keys and values) into a string with an optional separator
 
* [[Core Function JoinKV|JoinKV( <array>, <separator> )]] -- Join an array (as keys and values) into a string with an optional separator
* [[Core Function Count|Count( <array/binary-array> )]] -- Returns the size of array (How many elements it currently has stored)
+
* [[Core Function Count|Count( <array/binary-array/class> )]] -- Returns the size of array (How many elements it currently has stored)
 
* [[Core Function Fill|Fill( <start>, <num>, <value> )]] -- Fill an array with values
 
* [[Core Function Fill|Fill( <start>, <num>, <value> )]] -- Fill an array with values
 
* [[Core Function FillKeys|FillKeys( <keys>, <value> )]] -- Fill an array with values, specifying keys
 
* [[Core Function FillKeys|FillKeys( <keys>, <value> )]] -- Fill an array with values, specifying keys
Line 561: Line 637:
  
 
==== Linq (Integrated Language Query) Functions ====
 
==== Linq (Integrated Language Query) Functions ====
* [[Core Function Where|Where( <array>, <query> )]] -- Filters an array based on a predicate
+
These functions are basically quick ways to shuffle arrays around (sort and organize them etc) and are BEST suited for when the array contains nothing but Classes but you can use them on any array if you want.
 +
* [[Core Function All|All( <array>, <query> )]] -- Check of all elements in the query are a true match
 +
* [[Core Function Any|Any( <array>, <query> )]] -- Check of any of the elements in the query are a true match
 +
* [[Core Function Concat|Concat( <array>, <array>... )]] -- Join multiple arrays (query results?) together
 +
* [[Core Function First|First( <array>, <query> )]] -- Return the first matching element from the query
 +
* [[Core Function FirstOrDefault|FirstOrDefault( <array>, <query>, <default> )]] -- Return the first matching element from the query or return the default variable given
 +
* [[Core Function Last|Last( <array>, <query> )]] -- Return the last matching element from the query
 +
* [[Core Function LastOrDefault|LastOrDefault( <array>, <query>, <default> )]] -- Return the last matching element from the query or return the default variable given
 +
* [[Core Function Where|Where( <array>, <query> )]] -- Filters an array based on a query and returns all matching
 +
* [[Core Function WhereNot|WhereNot( <array>, <query> )]] -- Filters an array based on a query and all non matching
 +
* [[Core Function SumInt|SumInt( <array>, <query> )]] -- Adds up all matching elements from the query and returns it as an Int64
 +
* [[Core Function SumUInt|SumUInt( <array>, <query> )]] -- Adds up all matching elements from the query and returns it as a UInt64
 +
* [[Core Function SumDouble|SumDouble( <array>, <query> )]] -- Adds up all matching elements from the query and returns it as a Double
 +
* [[Core Function Obtain|Obtain( <array>, <query> )]] -- Gathers up all matching elements from the query and returns them (Unlike Where() this returns the values directly instead of their source so instead of returning the class it will return the variable)
  
 
==== Enum Functions ====
 
==== Enum Functions ====
Line 569: Line 658:
 
* [[Core Function EnumAdd|EnumAdd( <enum>, <key>, <value> )]] -- Add a new key and value to an existing enum
 
* [[Core Function EnumAdd|EnumAdd( <enum>, <key>, <value> )]] -- Add a new key and value to an existing enum
 
* [[Core Function EnumDel|EnumDel( <enum>, <key> )]] -- Delete a key and value from an existing enum
 
* [[Core Function EnumDel|EnumDel( <enum>, <key> )]] -- Delete a key and value from an existing enum
 +
* [[Core Function EnumIsDefined|EnumIsDefined( <enum>, <value> )]] -- Check if a given value exists within an enum
  
 
==== Process Functions ====
 
==== Process Functions ====
Line 607: Line 697:
 
===== File Create/Read/Write Functions =====
 
===== File Create/Read/Write Functions =====
 
* [[Core Function FileOpen|FileOpen( <FileName>, <flag> )]] -- Opens a file for reading or writing
 
* [[Core Function FileOpen|FileOpen( <FileName>, <flag> )]] -- Opens a file for reading or writing
 +
* [[Core Function FileOpenText|FileOpenText( <FileName> )]] -- Opens a file for reading only (text files only)
 
* [[Core Function FileClose|FileClose( <file> )]] -- Closes a previously opened file
 
* [[Core Function FileClose|FileClose( <file> )]] -- Closes a previously opened file
 
* [[Core Function FileWrite|FileWrite( <file>, <expression>, <useAscii> )]] -- Write text to previously opened file at the current File Steam pointer location
 
* [[Core Function FileWrite|FileWrite( <file>, <expression>, <useAscii> )]] -- Write text to previously opened file at the current File Steam pointer location
 
* [[Core Function FileWriteBinary|FileWriteBinary( <file>, <binary-array> )]] -- Write the data from a binary variable to previously opened file at the current File Steam pointer location
 
* [[Core Function FileWriteBinary|FileWriteBinary( <file>, <binary-array> )]] -- Write the data from a binary variable to previously opened file at the current File Steam pointer location
 +
* [[Core Function FileWriteLines|FileWriteLines( <file>, <array>, <lineBreak>, <useAscii> )]] -- Write an array of lines to previously opened file at the current File Steam pointer location
 
* [[Core Function FileAppend|FileAppend( <file>, <expression>, <useAscii> )]] -- Append a line of text to the end of a previously opened text file
 
* [[Core Function FileAppend|FileAppend( <file>, <expression>, <useAscii> )]] -- Append a line of text to the end of a previously opened text file
 
* [[Core Function FileAppendBinary|FileAppendBinary( <file>, <binary-array> )]] -- Append the data from a binary variable to the end of a previously opened file
 
* [[Core Function FileAppendBinary|FileAppendBinary( <file>, <binary-array> )]] -- Append the data from a binary variable to the end of a previously opened file
 +
* [[Core Function FileAppendLines|FileAppendLines( <file>, <array>, <lineBreak>, <useAscii> )]] -- Append an array of lines to the end of previously opened file
 
* [[Core Function FileSeek|FileSeek( <file>, <offset>, <flag> )]] -- Change the POSITION of the File Stream pointer
 
* [[Core Function FileSeek|FileSeek( <file>, <offset>, <flag> )]] -- Change the POSITION of the File Stream pointer
 
* [[Core Function FilePos|FilePos( <file> )]] -- Get the current POSITION of the File Stream pointer
 
* [[Core Function FilePos|FilePos( <file> )]] -- Get the current POSITION of the File Stream pointer
* [[Core Function FileRead|FileRead( <file>, <expression> )]] -- Read a number of characters from a text file starting from current File Steam pointer location
+
* [[Core Function FileRead|FileRead( <file>, <expression> )]] -- Read a number of bytes from a text file starting from current File Steam pointer location and return them as a string
 
* [[Core Function FileReadBinary|FileReadBinary( <file>, <expression> )]] -- Read a number of bytes from a file starting from current File Steam pointer location
 
* [[Core Function FileReadBinary|FileReadBinary( <file>, <expression> )]] -- Read a number of bytes from a file starting from current File Steam pointer location
* [[Core Function FileReadLine|FileReadLine( <file>, <expression> )]] -- Read a line of text from a 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 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 FileReadText|FileReadText( <file>, <format>, <length> )]] -- Read text from a file opened by FileOpenText() using the format and length params
 +
* [[Core Function FileTemp|FileTemp(  )]] -- Create a uniquely named, zero-byte temporary file on disk and returns the full path of it
 
* [[Core Function FileSave|FileSave( <file>, <expression>, <useAscii> )]] -- Save all text to a file
 
* [[Core Function FileSave|FileSave( <file>, <expression>, <useAscii> )]] -- Save all text to a file
 
* [[Core Function FileLoad|FileLoad( <file> )]] -- Load all text from a file
 
* [[Core Function FileLoad|FileLoad( <file> )]] -- Load all text from a file
  
 
===== Misc =====
 
===== Misc =====
 +
* [[Core Function FileMove|FileMove( <file1>, <file2>, <flag> )]] -- Move a file
 
* [[Core Function FileCopy|FileCopy( <file1>, <file2>, <flag> )]] -- Copy a file
 
* [[Core Function FileCopy|FileCopy( <file1>, <file2>, <flag> )]] -- Copy a file
 
* [[Core Function FileDelete|FileDelete( <file> )]] -- Delete a file
 
* [[Core Function FileDelete|FileDelete( <file> )]] -- Delete a file
Line 632: Line 728:
 
* [[Core Function FileMD5|FileMD5( <file> )]] -- Calculate the MD5 checksum of a file
 
* [[Core Function FileMD5|FileMD5( <file> )]] -- Calculate the MD5 checksum of a file
 
* [[Core Function FileSHA1|FileSHA1( <file> )]] -- Calculate the SHA1 checksum of a file
 
* [[Core Function FileSHA1|FileSHA1( <file> )]] -- Calculate the SHA1 checksum of a file
* [[Core Function FileSize|FileSize( <file> )]] -- Returns the file size in bytes
+
* [[Core Function FileSize|FileSize( <file>, <flag> )]] -- Returns the file size in bytes (or return the formatted size)
 
* [[Core Function FileIsText|FileIsText( <file>, <length> )]] -- Returns true if the file contains only text
 
* [[Core Function FileIsText|FileIsText( <file>, <length> )]] -- Returns true if the file contains only text
 
* [[Core Function FileRecycleEmpty|FileRecycleEmpty( <root> )]] -- Empty the recycle bin with no GUI, sound or confirmation
 
* [[Core Function FileRecycleEmpty|FileRecycleEmpty( <root> )]] -- Empty the recycle bin with no GUI, sound or confirmation
Line 653: Line 749:
 
* [[Core Function DirSize|DirSize( <path> )]] -- Returns the size in bytes of a whole directory
 
* [[Core Function DirSize|DirSize( <path> )]] -- Returns the size in bytes of a whole directory
 
* [[Core Function CurDir|CurDir ( <path> )]] -- Get or Set the current working directory
 
* [[Core Function CurDir|CurDir ( <path> )]] -- Get or Set the current working directory
* [[Core Function CombinePath|CombinePath( <path1>, <path1> )]] -- Safe way to combine two paths into one
+
* [[Core Function CombinePath|CombinePath( <path1>, <path2> )]] -- Safe way to combine two paths into one
 
+
* [[Core Function GetRelativePath|GetRelativePath( <Path1>, <path2> )]] -- Try makes a path relative to another
 
===== Dialogs =====
 
===== Dialogs =====
 
* [[Core Function FolderSelectDialog|FolderSelectDialog ( <text>, <dir>, <flag>, <init dir> )]] -- Initiates a Browse For Folder Dialog
 
* [[Core Function FolderSelectDialog|FolderSelectDialog ( <text>, <dir>, <flag>, <init dir> )]] -- Initiates a Browse For Folder Dialog
Line 669: Line 765:
 
* [[Core Function IsPathRooted|IsPathRooted ( <path> )]] -- Gets a value indicating whether the specified path string contains absolute or relative path information
 
* [[Core Function IsPathRooted|IsPathRooted ( <path> )]] -- Gets a value indicating whether the specified path string contains absolute or relative path information
 
* [[Core Function GetDosPath|GetDosPath( <path> )]] -- Returns a given path in DOS friendly style (shortened)
 
* [[Core Function GetDosPath|GetDosPath( <path> )]] -- Returns a given path in DOS friendly style (shortened)
 +
* [[Core Function AddPath|AddPath( <path> )]] -- Add a directory to the search list when using ParsePath() and all other functions such as Include(), Require() etc
 +
* [[Core Function DelPath|DelPath( <path> )]] -- Remove a directory from the search list when using ParsePath() and all other functions such as Include(), Require() etc
  
 
==== Network Functions ====
 
==== Network Functions ====
Line 691: Line 789:
 
* [[Core Function SSListen|SSListen( <port>, <max connections>, <name>  )]] -- Create a server and begin listening for clients to connect
 
* [[Core Function SSListen|SSListen( <port>, <max connections>, <name>  )]] -- Create a server and begin listening for clients to connect
 
* [[Core Function SSConnect|SSConnect( <ip>, <port>, <connection string>, <name>  )]] -- Connect to a server
 
* [[Core Function SSConnect|SSConnect( <ip>, <port>, <connection string>, <name>  )]] -- Connect to a server
* [[Core Function SSApprove|SSApprove( <server>, <client socket> )]] -- Approve a client to connect to the server
+
* [[Core Function SSApprove|SSApprove( <client socket> )]] -- Approve a client to connect to the server
* [[Core Function SSDisapprove|SSDisapprove( <server>, <client socket> )]] -- Disapprove a client to connect to the server
+
* [[Core Function SSDisapprove|SSDisapprove( <client socket> )]] -- Disapprove a client to connect to the server
* [[Core Function SSClientStatus|SSClientStatus( /* depends... /* )]] -- Get the status of a client or of our client
+
* [[Core Function SSClientStatus|SSClientStatus( <client/client socket> )]] -- Get the status of a client or of our client
* [[Core Function SSClientIP|SSClientIP( <server>, <client socket> )]] -- Get the IP of a client socket
+
* [[Core Function SSClientIP|SSClientIP( <client socket> )]] -- Get the IP of a client socket
 
* [[Core Function SSRecv|SSRecv( <server/client> )]] -- Check for a message recieved from client/server
 
* [[Core Function SSRecv|SSRecv( <server/client> )]] -- Check for a message recieved from client/server
* [[Core Function SSRead|SSRead( <message buffer>, <data type> )]] -- Read data from a message
+
* [[Core Function SSRead|SSRead( <client/server>, <data type> )]] --Read data from a client/server
* [[Core Function SSDrop|SSDrop( <server>, <client socket> )]] -- Kick a client off the server
+
* [[Core Function SSDrop|SSDrop( <client socket>, <reason> )]] -- Kick a client off the server
* [[Core Function SSSendBufferCreate|SSSendBufferCreate( <server/client> )]] -- Create a new buffer to store data to send to the client/server
+
* [[Core Function SSSendBufferAppend|SSSendBufferAppend( <message buffer>, <type>, <data> )]] -- Add data to the buffer to send such as Strings etc
+
 
* [[Core Function SSSend|SSSend( /* depends... /* )]] -- Send data to client or server
 
* [[Core Function SSSend|SSSend( /* depends... /* )]] -- Send data to client or server
 +
* [[Core Function SSBufferNew|SSBufferNew( <nothing/server/client> )]] -- Create a new net buffer to store data to send to the client/server
 +
* [[Core Function SSBufferPut|SSBufferPut( <netBuffer>, <type>, <data> )]] -- Add data to a net buffer
  
 
===== Raw Sockets (TCP/UDP etc) =====
 
===== Raw Sockets (TCP/UDP etc) =====
Line 712: Line 810:
 
* [[Core Function SocketListen|SocketListen( <socket>, <backlog>  )]] -- Places a <socket> in a listening state
 
* [[Core Function SocketListen|SocketListen( <socket>, <backlog>  )]] -- Places a <socket> in a listening state
 
* [[Core Function SocketReceive|SocketReceive( <socket>, <buffersize>  )]] -- Receives data from a bound <socket> into a receive buffer
 
* [[Core Function SocketReceive|SocketReceive( <socket>, <buffersize>  )]] -- Receives data from a bound <socket> into a receive buffer
 +
* [[Core Function SocketReadChar|SocketReadChar( <socket>, <count>  )]] -- Receives a single (or a specified amount) of char(s) from a bound <socket>
 +
* [[Core Function SocketReadLine|SocketReadLine( <socket>  )]] -- Receives the next line from a bound <socket> (useful for Telnet style stuff)
 
* [[Core Function SocketSend|SocketSend( <socket>, <binary-variable>, <offset>, <length>, <flag> )]] -- Sends data to a connected <socket>
 
* [[Core Function SocketSend|SocketSend( <socket>, <binary-variable>, <offset>, <length>, <flag> )]] -- Sends data to a connected <socket>
 
* [[Core Function SocketSendTo|SocketSendTo( <socket>, <ip>, <port>, <binary-variable>, <length>, <flag> )]] -- Sends data to the specified ip + port
 
* [[Core Function SocketSendTo|SocketSendTo( <socket>, <ip>, <port>, <binary-variable>, <length>, <flag> )]] -- Sends data to the specified ip + port
Line 727: Line 827:
  
 
==== Memory Functions ====
 
==== Memory Functions ====
* [[Core Function WriteMem|WriteMem( < Caption / PID >, <Class>, <Address>, <value> )]] -- Write a value to an address in an application's memory (Supports multiple values and even binary variables for writing multiple bytes)
 
* [[Core Function ReadMem|ReadMem( < Caption / PID >, <Class>, <Address>, <defs>, <size> )]] -- Read bytes from an application's memory at an address and create variables using same defs and return values as Unpack()
 
 
* [[Core Function Alloc|Alloc( <size>, <filler> )]] -- Allocate memory and return the pointer to it
 
* [[Core Function Alloc|Alloc( <size>, <filler> )]] -- Allocate memory and return the pointer to it
 
* [[Core Function Realloc|Realloc( <ptr>, <size> )]] -- Resizes a block of memory previously allocated with Alloc()
 
* [[Core Function Realloc|Realloc( <ptr>, <size> )]] -- Resizes a block of memory previously allocated with Alloc()
Line 761: Line 859:
  
 
==== Time & Date Functions ====
 
==== Time & Date Functions ====
* [[Core Function Time|Time( )]] -- Return current Unix timestamp
+
* [[Core Function Time|Time( <array> )]] -- Returns the current time or calculates the time in seconds from an associative array
 +
* [[Core Function MicroTime|MicroTime( <returnAsDouble> )]] -- Returns the current Unix timestamp with microseconds
 +
* [[Core Function Date|Date( <format>, <time> )]] -- Returns a string with the date and time formatted according to the format given. If no time is supplied defaults to the current time
 
* [[Core Function TimerInit|TimerInit( )]] -- Returns a handle that can be passed to TimerDiff() to calculate the difference in milliseconds
 
* [[Core Function TimerInit|TimerInit( )]] -- Returns a handle that can be passed to TimerDiff() to calculate the difference in milliseconds
 
* [[Core Function TimerDiff|TimerDiff( <handle> )]] -- Returns the difference in time from a previous call to TimerInit()
 
* [[Core Function TimerDiff|TimerDiff( <handle> )]] -- Returns the difference in time from a previous call to TimerInit()
* [[Core Function Sleep|Sleep( <miliseconds>, <doEvents> )]] -- Pause the current executing thread for the given milliseconds
+
* [[Core Function Sleep|Sleep( <milliseconds>, <doEvents> )]] -- Pause the current executing thread for the given milliseconds
 +
* [[Core Function USleep|USleep( <microseconds> )]] -- Pause the current executing thread for the given microseconds
 
* [[Core Function TickCount|TickCount( <ticks> )]] -- Retrieves the number of milliseconds that have elapsed since the current instance of Sputnik was started
 
* [[Core Function TickCount|TickCount( <ticks> )]] -- Retrieves the number of milliseconds that have elapsed since the current instance of Sputnik was started
  
==== GUI Functions ====
+
==== Old GUI Functions ====
 +
 
 +
All the functions below are part of the SputnikOldGUI.dll basically these functions are *to be* depreciated and replaced with something much better in the future.
 +
 
 +
However you can still use these and even after they have been replaced with a new GUI system you will still be able to use these functions (and GUI programs made with them) anyway by using the SputnikOldGUI.dll into your project.
 +
 
 +
To use any of these functions you must include the SputnikOldGUI.dll to do that you must add this code to the top of your script.
 +
 
 +
<syntaxhighlight lang="sputnik">
 +
use('SputnikOldGUI.dll', true);
 +
</syntaxhighlight>
 +
 
 +
Here is an example of using "GUICreate" in a full example and including the SputnikOldGUI.dll
 +
 
 +
<syntaxhighlight lang="sputnik">
 +
// Load the old GUI system
 +
// Since this an old GUI example
 +
use('SputnikOldGUI.dll', true);
 +
// Create the GUI
 +
Global $GUI = GUICreate("Window", "My Title", 200, 200);
 +
// Create a button -- This button will simply display a message
 +
Global $Button = GUICreate("Button", $GUI, "Press Me!", 8, 8);
 +
// Add a link to the button
 +
GUILink($Button, "Click", 'myFunction();'); // Call function
 +
// Show the GUI
 +
GUILoad( $GUI );
 +
// Keep the GUI running as long as long as the window is open
 +
While ( GUIStatus( $GUI ) )
 +
DoEvents( );
 +
// This function is called when the button is clicked
 +
Function myFunction()
 +
{
 +
MsgBox("Hello from the button");
 +
}
 +
</syntaxhighlight>
 +
 
 +
Make note however that the examples below do not include the SputnikOldGUI.dll in their scripts you must do that part yourself!.
  
 
===== Dialog Creation Functions =====
 
===== Dialog Creation Functions =====
Line 839: Line 976:
 
* [[Core Function GUISetProp|GUISetProp( <gui object>, <prop>, <value> )]] -- Set the value of a GUI objects property
 
* [[Core Function GUISetProp|GUISetProp( <gui object>, <prop>, <value> )]] -- Set the value of a GUI objects property
 
* [[Core Function GUIGetPropList|GUIGetPropList( <gui object>, <searchfor>, <flag> )]] -- Get an array of the the names and types of all compatible/incompatible/all properties that the GUI object offers
 
* [[Core Function GUIGetPropList|GUIGetPropList( <gui object>, <searchfor>, <flag> )]] -- Get an array of the the names and types of all compatible/incompatible/all properties that the GUI object offers
 
===== Common Dialog/Control Functions =====
 
* [[Core Function GUIInvoke|GUIInvoke( <gui object>, <method name>, <params> )]] -- Call a method on a GUI object
 
  
 
===== GUI Link (Event) Functions =====
 
===== GUI Link (Event) Functions =====
 
* [[Core Function GUILink|GUILink( <gui object>, <linktype>, <action>, <param var> )]] -- Add an event (link) to a GUI object such as Click, MouseDown etc
 
* [[Core Function GUILink|GUILink( <gui object>, <linktype>, <action>, <param var> )]] -- Add an event (link) to a GUI object such as Click, MouseDown etc
 
* [[Core Function GUILinkValid|GUILinkValid( <gui object>, <linktype> )]] -- Check if a given event (link) is valid for the given GUI object
 
* [[Core Function GUILinkValid|GUILinkValid( <gui object>, <linktype> )]] -- Check if a given event (link) is valid for the given GUI object
 +
 +
===== Graphics/Pixel Functions =====
 +
* [[Core Function Colour|Colour( <name> )]] -- Get the colour INT value of a given colours name
 +
* [[Core Function ColourDialog|ColourDialog( )]] -- Allows the user to select a colour and allows you to get the RED, GREEN, BLUE etc values
 +
* [[Core Function FontDialog|FontDialog( <font> )]] -- Allows the user to select a font and allows you to get the Name, size, bold etc values
 +
 +
===== Bitmap Functions =====
 +
* [[Core Function BitmapCreate|BitmapCreate( <width>, <height> )]] -- Create a new blank bitmap object
 +
* [[Core Function BitmapGetPixel|BitmapGetPixel( <bitmap>, <x>, <y> )]] -- Get a pixel on a bitmap object
 +
* [[Core Function BitmapSetPixel|BitmapSetPixel( <bitmap>, <x>, <y>, <colour> )]] -- Alter a pixel on a bitmap object
  
 
===== Other GUI Functions =====
 
===== Other GUI Functions =====
Line 860: Line 1,004:
 
* [[Core Function ToolTipKill|ToolTipKill( <ToolTip> )]] -- Delete a tooltip that was made using ToolTip()
 
* [[Core Function ToolTipKill|ToolTipKill( <ToolTip> )]] -- Delete a tooltip that was made using ToolTip()
 
* [[Core Function PSet|PSet( <gui object>, <x>, <y>, <object> )]] -- Draw at a pixel
 
* [[Core Function PSet|PSet( <gui object>, <x>, <y>, <object> )]] -- Draw at a pixel
 +
* [[Core Function GUISendToBack|GUISendToBack( <gui object> )]] -- Send a GUI object to the back of the ZOrder
 +
* [[Core Function GUIBringToFront|GUIBringToFront( <gui object> )]] -- Send a GUI object to the front of the ZOrder
  
==== Bitmap Functions ====
+
===== Variable Type Checking etc =====
* [[Core Function BitmapCreate|BitmapCreate( <width>, <height> )]] -- Create a new blank bitmap object
+
* [[Core Function isVarGUIObject|isVarGUIObject( $variable )]] -- Check if a variable holds a GUI Object
* [[Core Function BitmapGetPixel|BitmapGetPixel( <bitmap>, <x>, <y> )]] -- Get a pixel on a bitmap object
+
* [[Core Function GetVarGUIObjType|GetVarGUIObjType( $variable )]] -- Get the common object type of a variable (If it is a GUI object)
* [[Core Function BitmapSetPixel|BitmapSetPixel( <bitmap>, <x>, <y>, <colour> )]] -- Alter a pixel on a bitmap object
+
  
 
==== Keyboard Control Functions ====
 
==== Keyboard Control Functions ====
Line 939: Line 1,084:
 
* [[Core Function PixelSearchHWND|PixelSearchHWND ( <hwnd>, <left>, <top>, <right>, <bottom>, <colour>, <shade>, <padding>, <step> )]] -- Searches a rectangle of pixels for the pixel colour provided
 
* [[Core Function PixelSearchHWND|PixelSearchHWND ( <hwnd>, <left>, <top>, <right>, <bottom>, <colour>, <shade>, <padding>, <step> )]] -- Searches a rectangle of pixels for the pixel colour provided
 
* [[Core Function PixelChecksum|PixelChecksum ( <left>, <top>, <right>, <bottom>, <step>, <hwnd> )]] -- Generates a checksum for a region of pixels
 
* [[Core Function PixelChecksum|PixelChecksum ( <left>, <top>, <right>, <bottom>, <step>, <hwnd> )]] -- Generates a checksum for a region of pixels
* [[Core Function Colour|Colour( <name> )]] -- Get the colour INT value of a given colours name
 
 
* [[Core Function RGB|RGB( <red>, <green>, <blue> )]] -- Get the colour INT value of given red, green and blue bytes
 
* [[Core Function RGB|RGB( <red>, <green>, <blue> )]] -- Get the colour INT value of given red, green and blue bytes
 
* [[Core Function GetRValue|GetRValue( <colour> )]] -- Get the red byte from a colour INT value
 
* [[Core Function GetRValue|GetRValue( <colour> )]] -- Get the red byte from a colour INT value
 
* [[Core Function GetGValue|GetGValue( <colour> )]] -- Get the green byte from a colour INT value
 
* [[Core Function GetGValue|GetGValue( <colour> )]] -- Get the green byte from a colour INT value
 
* [[Core Function GetBValue|GetBValue( <colour> )]] -- Get the blue byte from a colour INT value
 
* [[Core Function GetBValue|GetBValue( <colour> )]] -- Get the blue byte from a colour INT value
* [[Core Function ColourDialog|ColourDialog( )]] -- Allows the user to select a colour and allows you to get the RED, GREEN, BLUE etc values
 
* [[Core Function FontDialog|FontDialog( <font> )]] -- Allows the user to select a font and allows you to get the Name, size, bold etc values
 
  
==== .NET Functions and Features ====
+
==== Sputnik Plugins (Using .NET DLLs) ====
* [[Core Function DotNet|DotNet Objects]] -- Create/use .NET objects and call instance/static method and get/set properties
+
* [[Core Function Use|Use( <name/array>, <flag> )]] -- Load a Sputnik plugin
* [[Core Function Use|Use( <name>, <flag> )]] -- Define a .NET assemblies namespace + full qualified name for use in creating .NET objects
+
* [[Core Function Unuse|Unuse( <name> )]] -- ???
* [[Core Function Unuse|Unuse( <name> )]] -- Remove a .NET namespacefrom Sputniks search group (Added by Use() function)
+
* [[Core Function UnuseAssembly|UnuseAssembly( <name> )]] -- Remove a .NET assembly from Sputniks search group (Added by Compile() function)
+
* [[Core Function Compile|Compile( <sourceCode>, <outputFile/outputType>, <includeDLLs>, <options>, <compileroptions> )]] -- Compile C# source code into a DLL(or in ram) for use in using its classes, functions etc as if they were part of Sputnik
+
* [[Core Function ObjToDotNet|ObjToDotNet( <object> )]] -- Convert a Sputnik raw object such as a TextBox from GUICreate() or anything that uses OBJECT type into a useable DotNet type
+
  
 
==== Control Flow Functions ====
 
==== Control Flow Functions ====
Line 963: Line 1,101:
 
* [[Core Function Redo|Redo( )]] -- Continue the execution of a loop at the start of the current iteration
 
* [[Core Function Redo|Redo( )]] -- Continue the execution of a loop at the start of the current iteration
  
==== Misc Functions ====
+
==== Internal Class Management and Information ====
* [[Core Function Exit|Exit( <exitCode> )]] -- Instantly terminate the program/script
+
* [[Core Function ClassExists|ClassExists( <expression> )]] -- Check if a given Class exists
* [[Core Function Serialize|Serialize( <variable> )]] -- Convert a variable, array, class etc a string you can save to file or transfer over the internet
+
* [[Core Function ClassList|ClassList( <expression>, <inherits> )]] -- Return an array of all user defined classes (Or just ones fitting a given pattern)
* [[Core Function Unserialize|Unserialize( <string> )]] -- Convert a string (Created with Serialize()) into its original variable/class/array etc
+
* [[Core Function ClassInfo|ClassInfo( <class-name> )]] -- Get a vast amount of *behind the scene* information on a class and its functions, properties and so on
* [[Core Function Assert|Assert( <toCheck>, <errorMsg> )]] -- Check if value is true (if so returns it) if it is notthen an exception is thrown with a default or user provided (second argument) error message
+
* [[Core Function ClassStack|ClassStack( <variable> )]] -- Return a reference to a classes internal variable stack (as an array) (or set the class stack from an existing array)
* [[Core Function IsOverloaded|IsOverloaded( <class>, <overload> )]] -- Check if a given cast/operator overload exists within a class
+
* [[Core Function ClassName|ClassName( <variable> )]] -- Return the name of the class on a variable or a class this code is running inside of (automatically uses $this if no param is given)
 +
* [[Core Function UnsetClass|UnsetClass( <class-name> )]] -- Delete a previous user defined Class from Sputnik
 
* [[Core Function New|New( <classConstruction> )]] -- Create a new instance of a given class name optionally with parameters to be sent to the __Construct function of the new class
 
* [[Core Function New|New( <classConstruction> )]] -- Create a new instance of a given class name optionally with parameters to be sent to the __Construct function of the new class
* [[Core Function Clone|Clone( <object> )]] -- Create a clone of a clone-able object
 
* [[Core Function Warn|Warn( <message> )]] -- Show a warning message with source file name and line number
 
 
* [[Core Function NewClass|newClass( <name>, <params> )]] -- Create a new instance of a class by its name as a string
 
* [[Core Function NewClass|newClass( <name>, <params> )]] -- Create a new instance of a class by its name as a string
 
* [[Core Function NewClassFromArray|NewClassFromArray( <name>, <array>, <wakeUp> )]] -- Create a new instance of a class by its name and an array of its values
 
* [[Core Function NewClassFromArray|NewClassFromArray( <name>, <array>, <wakeUp> )]] -- Create a new instance of a class by its name and an array of its values
 
* [[Core Function ConvertClass|ConvertClass( <oldClass>, <name>, <wakeUp> )]] -- Create a new instance of a class by its name and copy the values from another class
 
* [[Core Function ConvertClass|ConvertClass( <oldClass>, <name>, <wakeUp> )]] -- Create a new instance of a class by its name and copy the values from another class
* [[Core Function AddPath|AddPath( <path> )]] -- Add a directory to the search list when using ParsePath() and all other functions such as Include(), Require() etc
+
* [[Core Function IsOverloaded|IsOverloaded( <class>, <overload> )]] -- Check if a given cast/operator overload exists within a class
* [[Core Function DelPath|DelPath( <path> )]] -- Remove a directory from the search list when using ParsePath() and all other functions such as Include(), Require() etc
+
 
 +
==== Internal Function Management and Information ====
 +
* [[Core Function FunctionExists|FunctionExists( <expression> )]] -- Check if a given Function exists
 +
* [[Core Function FunctionList|FunctionList( <expression>, <class> )]] -- Return an array of all user defined functions (Or just ones fitting a given pattern)
 +
* [[Core Function FunctionInfo|FunctionInfo( <function-name> )]] -- Get a vast amount of *behind the scene* information on a function
 +
* [[Core Function UnsetFunction|UnsetFunction( <function-name> )]] -- Delete a previous user defined Function from Sputnik
 +
* [[Core Function UnsetCoreFunction|UnsetCoreFunction( <function-name> )]] -- Delete a core function from Sputnik
 +
* [[Core Function CoreFunctionExists|CoreFunctionExists( <expression> )]] -- Check if a given Core Function exists
 +
* [[Core Function CoreFunctionList|CoreFunctionList( <expression> )]] -- Return an array of all core functions (Or just ones fitting a given pattern)
 +
* [[Core Function Eval|Eval( <expression>, <flag>, <cleanup>, <printToReturn> )]] -- Evaluate a string as Sputnik code
 
* [[Core Function MKFunc|MKFunc(<params>, <body>)]] -- Create a user defined function to be called from a variable
 
* [[Core Function MKFunc|MKFunc(<params>, <body>)]] -- Create a user defined function to be called from a variable
 
* [[Core Function CallFunc|CallFunc( <function>, <array>)]] -- Calls a user defined function contained in a variable
 
* [[Core Function CallFunc|CallFunc( <function>, <array>)]] -- Calls a user defined function contained in a variable
 
* [[Core Function Call|Call(<function/array>, <expressions>)]] -- Calls a function contained in a string parameter
 
* [[Core Function Call|Call(<function/array>, <expressions>)]] -- Calls a function contained in a string parameter
 
* [[Core Function CallArray|CallArray( <function/array>, <array>)]] -- Calls a function contained in a string parameter
 
* [[Core Function CallArray|CallArray( <function/array>, <array>)]] -- Calls a function contained in a string parameter
* [[Core Function Eval|Eval( <expression>, <flag>, <cleanup>, <printToReturn> )]] -- Evaluate a string as Sputnik code
+
 
 +
==== Internal Enum Management and Information ====
 +
* [[Core Function EnumExists|EnumExists( <expression> )]] -- Check if a given Enum exists
 +
* [[Core Function EnumList|EnumList( <expression> )]] -- Return an array of all user defined enums (Or just ones fitting a given pattern)
 +
* [[Core Function UnsetEnum|UnsetEnum( <enum-name> )]] -- Delete a previous user defined Enum from Sputnik
 +
 
 +
==== Internal DLLImport Management and Information ====
 +
* [[Core Function DLLImportExists|DLLImportExists( <expression> )]] -- Check if a given DLLImport exists
 +
* [[Core Function DLLImportList|DLLImportList( <expression> )]] -- Return an array of all user defined dllimports (Or just ones fitting a given pattern)
 +
* [[Core Function UnsetDLLImport|UnsetDLLImport( <dllimport-function-name> )]] -- Delete a function imported using the DLLImport() function
 +
 
 +
==== Internal DLLStruct Management and Information ====
 +
* [[Core Function DLLStructExists|DLLStructExists( <expression> )]] -- Check if a given DLLStruct exists
 +
* [[Core Function DLLStructList|DLLStructList( <expression> )]] -- Return an array of all user defined dllstructs (Or just ones fitting a given pattern)
 +
* [[Core Function UnsetDLLStruct|UnsetDLLStruct( <dllstruct-name> )]] -- Delete a previous user defined DLLStruct from Sputnik
 +
 
 +
==== Internal Variable/Scope Information ====
 +
* [[Core Function VarList|VarList( <varScope/class> )]] -- Obtain information on all variables that exist in a given scope or class
 +
* [[Core Function VarTypeToString|VarTypeToString( <varType> )]] -- Convert a raw variable type into it's string representation
 +
* [[Core Function VarTypeFromString|VarTypeFromString( <string> )]] -- Convert a variable type from it's string representation into it's raw type
 +
* [[Core Function VarObjTypeToString|VarObjTypeToString( <varObjType> )]] -- Convert a raw variable object type into it's string representation
 +
* [[Core Function VarObjTypeFromString|VarObjTypeFromString( <string> )]] -- Convert a variable object type from it's string representation into it's raw type
 +
* [[Core Function VarScopeToString|VarScopeToString( <varScope> )]] -- Convert a raw variable scope into it's string representation
 +
* [[Core Function VarScopeFromString|VarScopeFromString( <string> )]] -- Convert a variable scope from it's string representation into it's raw type
 +
* [[Core Function ScopeToString|ScopeToString( <scope> )]] -- Convert a raw scope into it's string representation
 +
* [[Core Function ScopeFromString|ScopeFromString( <string> )]] -- Convert a scope from it's string representation into it's raw type
 +
 
 +
==== Eval Functions ====
 
* [[Core Function EvalSyntax|EvalSyntax( <expression> )]] -- Evaluate a string as Sputnik code but only check if it's syntax is valid
 
* [[Core Function EvalSyntax|EvalSyntax( <expression> )]] -- Evaluate a string as Sputnik code but only check if it's syntax is valid
 
* [[Core Function EvalCreate|EvalCreate( )]] -- Create an Eval object for use with Eval()
 
* [[Core Function EvalCreate|EvalCreate( )]] -- Create an Eval object for use with Eval()
 
* [[Core Function EvalSet|EvalSet( <evalObject>, <name>, <value> )]] -- Set a variable inside an Eval Object
 
* [[Core Function EvalSet|EvalSet( <evalObject>, <name>, <value> )]] -- Set a variable inside an Eval Object
 
* [[Core Function EvalGet|EvalGet( <evalObject>, <name>, <value> )]] -- Get a from variable inside an Eval Object
 
* [[Core Function EvalGet|EvalGet( <evalObject>, <name>, <value> )]] -- Get a from variable inside an Eval Object
 +
 +
==== Misc Functions ====
 +
* [[Core Function Exit|Exit( <exitCode> )]] -- Instantly terminate the program/script
 +
* [[Core Function Assert|Assert( <toCheck>, <errorMsg> )]] -- Check if value is true (if so returns it) if it is not then an exception is thrown with a default or user provided (second argument) error message
 +
* [[Core Function Warn|Warn( <message> )]] -- Show a warning message with source file name and line number
 +
* [[Core Function Clone|Clone( <object> )]] -- Create a clone of a clone-able object
 +
* [[Core Function LineInfo|LineInfo( )]] -- Get a vast amount of *behind the scene* information the current line of source code being executed
 
* [[Core Function GC|GC( <flag> )]] -- Use the garbage collector
 
* [[Core Function GC|GC( <flag> )]] -- Use the garbage collector
 
* [[Core Function HWND|HWND( )]] -- Get the HWND of the hidden window used by this program (It handles hotkeys etc)
 
* [[Core Function HWND|HWND( )]] -- Get the HWND of the hidden window used by this program (It handles hotkeys etc)
 
* [[Core Function Require|Require( <file>, <flag> )]] -- Add all functions etc from a file for use
 
* [[Core Function Require|Require( <file>, <flag> )]] -- Add all functions etc from a file for use
 
* [[Core Function Include|Include( <file>, <flag> )]] -- Add all functions etc from a file for use and execute all expressions
 
* [[Core Function Include|Include( <file>, <flag> )]] -- Add all functions etc from a file for use and execute all expressions
* [[Core Function CGIConsole|CGIConsole( )]] -- Changes the console printing to work best a CGI instead of stand alone terminal
 
 
* [[Core Function Opt|Opt( <option>, <value> )]] -- Changes the operation of various Sputnik functions/parameters
 
* [[Core Function Opt|Opt( <option>, <value> )]] -- Changes the operation of various Sputnik functions/parameters
* [[Core Function UnsetFunction|UnsetFunction( <function-name> )]] -- Delete a previous user defined Function from Sputnik
 
* [[Core Function UnsetClass|UnsetClass( <class-name> )]] -- Delete a previous user defined Class from Sputnik
 
* [[Core Function UnsetEnum|UnsetEnum( <enum-name> )]] -- Delete a previous user defined Enum from Sputnik
 
* [[Core Function UnsetDLLStruct|UnsetDLLStruct( <dllstruct-name> )]] -- Delete a previous user defined DLLStruct from Sputnik
 
* [[Core Function UnsetDLLImport|UnsetDLLImport( <dllimport-function-name> )]] -- Delete a function imported using the DLLImport() function
 
* [[Core Function FunctionExists|FunctionExists( <expression> )]] -- Check if a given Function exists
 
* [[Core Function ClassName|ClassName( <variable> )]] -- Return the name of the class on a variable or a class this code is running inside of (automatically uses $this if no param is given)
 
* [[Core Function ClassStack|ClassStack( <variable> )]] -- Return a reference to a classes internal variable stack (as an array) (or set the class stack from an existing array)
 
* [[Core Function ClassExists|ClassExists( <expression> )]] -- Check if a given Class exists
 
* [[Core Function EnumExists|EnumExists( <expression> )]] -- Check if a given Enum exists
 
* [[Core Function DLLStructExists|DLLStructExists( <expression> )]] -- Check if a given DLLStruct exists
 
* [[Core Function DLLImportExists|DLLImportExists( <expression> )]] -- Check if a given DLLImport exists
 
* [[Core Function FunctionList|FunctionList( <expression> )]] -- Return an array of all user defined functions (Or just ones fitting a given pattern)
 
* [[Core Function ClassList|ClassList( <expression> )]] -- Return an array of all user defined classes (Or just ones fitting a given pattern)
 
* [[Core Function EnumList|EnumList( <expression> )]] -- Return an array of all user defined enums (Or just ones fitting a given pattern)
 
* [[Core Function DLLStructList|DLLStructList( <expression> )]] -- Return an array of all user defined dllstructs (Or just ones fitting a given pattern)
 
* [[Core Function DLLImportList|DLLImportList( <expression> )]] -- Return an array of all user defined dllimports (Or just ones fitting a given pattern)
 
 
* [[Core Function IsAdmin|IsAdmin( )]] -- Check if the script is running in admin mode or not (Run as administrator)
 
* [[Core Function IsAdmin|IsAdmin( )]] -- Check if the script is running in admin mode or not (Run as administrator)
 
* [[Core Function ObjToVar|ObjToVar( <variable> )]] -- Convert a $variable's object to its compatible $variable data type
 
* [[Core Function ObjToVar|ObjToVar( <variable> )]] -- Convert a $variable's object to its compatible $variable data type

Latest revision as of 07:54, 20 December 2015

Contents

Function Reference

How to create a Function

To create your own funtions see the Function page.

Core Functions

If a link is red (unclickable) the function either doesnt exist yet and is pending creation or it has been created but does not yet have a page/example.

Language Features

Parser Engine

Console Functions

Multi-Threading Functions

Variable Type Conversions

Common Variable Functions

Misc
Type Checking
Get Type Directly

Binary Data Management Functions

Binary packer/unpacker
Bit Vector
Bits
BinHex 5.0
ByteBuffer

The ByteBuffer is the replacement for the old Stream functions it is more robust, has more features and is resistant to crashes/errors from bad information etc it works similar to the ByteBuffer in Java

NBT (Named Binary Tag)

Functions on par with Minecrafts NBT system but greatly expanded to include many additional features and improvements specific for Sputnik.

NBTTagCompound
NBTTagList/NBTTagListEx
Misc Binary Functions

Bit Flag Functions

Math Functions

String Functions

Array Functions

Linq (Integrated Language Query) Functions

These functions are basically quick ways to shuffle arrays around (sort and organize them etc) and are BEST suited for when the array contains nothing but Classes but you can use them on any array if you want.

Enum Functions

Process Functions

Environment Management

File Functions

File Create/Read/Write Functions
Misc
Dialogs

Directory Functions

Dialogs

Path Functions

Network Functions

HTTP Functions
MySQL Functions
Sputnik Client/Server Functions (This is just for connecting Sputnik Clients to Sputnik Servers nothing else)
Raw Sockets (TCP/UDP etc)
Misc Network Functions

Memory Functions

Clipboard Functions

Registry Functions

Time & Date Functions

Old GUI Functions

All the functions below are part of the SputnikOldGUI.dll basically these functions are *to be* depreciated and replaced with something much better in the future.

However you can still use these and even after they have been replaced with a new GUI system you will still be able to use these functions (and GUI programs made with them) anyway by using the SputnikOldGUI.dll into your project.

To use any of these functions you must include the SputnikOldGUI.dll to do that you must add this code to the top of your script.

use('SputnikOldGUI.dll', true);

Here is an example of using "GUICreate" in a full example and including the SputnikOldGUI.dll

// Load the old GUI system
// Since this an old GUI example
use('SputnikOldGUI.dll', true);
// Create the GUI
Global $GUI = GUICreate("Window", "My Title", 200, 200);
// Create a button -- This button will simply display a message
Global $Button = GUICreate("Button", $GUI, "Press Me!", 8, 8);
// Add a link to the button
GUILink($Button, "Click", 'myFunction();'); // Call function
// Show the GUI
GUILoad( $GUI );
// Keep the GUI running as long as long as the window is open
While ( GUIStatus( $GUI ) ) 
	DoEvents( ); 
// This function is called when the button is clicked
Function myFunction()
{
	MsgBox("Hello from the button");
}

Make note however that the examples below do not include the SputnikOldGUI.dll in their scripts you must do that part yourself!.

Dialog Creation Functions
Control Creation Functions
NOT AVAILABLE YET
Window/Control Properties Get/Set Functions

Note - Any options not here are most likely found using GUIGetProp and GUISetProp the bulk of all props can be found/used in them 2 funtions however anything special and not generic will go in the functions below.

Common Dialog/Control Properties Get/Set Functions
GUI Link (Event) Functions
Graphics/Pixel Functions
Bitmap Functions
Other GUI Functions
Variable Type Checking etc

Keyboard Control Functions

Mouse Control Functions

Window Management Functions

(For info on using <title>, <text> See Window Titles and Text (Advanced) )

Controls

(For info on using <title>, <text> See Window Titles and Text (Advanced) )

NOT AVAILABLE YET

Graphics/Pixel Functions

Sputnik Plugins (Using .NET DLLs)

Control Flow Functions

  • Return <expressions> -- Immediately ends execution of the current function, and returns its argument as the value of the function call. return will also end the execution of an Eval() statement or script file
  • Throw( <expression> ) -- Throw an exception
  • Die( <expression> ) -- Gives an error and terminates the program
  • Break( <scopes> ) -- Ends execution of the current loop
  • Continue( <scopes> ) -- Continue the execution of a loop at its next iteration
  • Redo( ) -- Continue the execution of a loop at the start of the current iteration

Internal Class Management and Information

Internal Function Management and Information

Internal Enum Management and Information

Internal DLLImport Management and Information

Internal DLLStruct Management and Information

Internal Variable/Scope Information

Eval Functions

Misc Functions

User Defined Functions

These functions are created using Sputnik and are not part of the Sputnik core language.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox