Function Reference
(→Environment Management) |
(→NBTTagCompound) |
||
(986 intermediate revisions by 3 users not shown) | |||
Line 8: | Line 8: | ||
=== Core Functions === | === 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 ==== | ==== Language Features ==== | ||
+ | * [[Core Function Translation|<Expression> =~ tr/searchList/replacementList/flags]] -- Translate characters from one character set to another similar to StrTr() function | ||
* [[Core Function Regex Match|<Expression> =~ m/pattern/flags]] -- Match a string to a regular expression pattern and check if it matches and optionally return captured groups | * [[Core Function Regex Match|<Expression> =~ m/pattern/flags]] -- Match a string to a regular expression pattern and check if it matches and optionally return captured groups | ||
* [[Core Function Regex Replace|<Expression> =~ s/pattern/replacement/flags]] -- Replace parts of a string using a regular expression pattern and optionally executing functions on the matched groups | * [[Core Function Regex Replace|<Expression> =~ s/pattern/replacement/flags]] -- Replace parts of a string using a regular expression pattern and optionally executing functions on the matched groups | ||
+ | * [[Core Function Goto Label|Goto Label; & Label:]] -- Jump to another section of the script | ||
+ | * [[Core Function List|<Scope> List( <expressions>, .. ) = <array>]] -- Extract some elements from an array into ready to use variables | ||
+ | * [[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 Function Variables|Function Variables]] -- Dynamically create function source code and place it in a variable and call it from the variable | ||
+ | |||
+ | ===== Parser Engine ===== | ||
+ | * [[Core Function Parser Engine|Parser Engine]] -- Parse text and have classes created and returned to you | ||
+ | * [[Core Function Parser|Parser( <grammar>, <tokenName>, <trimRules> )]] -- Create a new parser | ||
+ | * [[Core Function Parse|Parse( <parser>, <text> )]] -- Parse text with a parser created with Parser() | ||
+ | * [[Core Function IsToken|IsToken( <object> )]] -- Check if a given object is a token created from the parser | ||
+ | * [[Core Function TokenClass|TokenClass( <token> )]] -- Get the class the token is linked to | ||
==== Console Functions ==== | ==== Console Functions ==== | ||
+ | * [[Core Function Print|Echo( )]] -- Alias for [[Core Function Print|Print( )]] | ||
+ | * [[Core Function Println|Say( )]] -- Alias for [[Core Function Println|Println( )]] | ||
* [[Core Function Print|Print( <expression> )]] -- Prints an expressions string value to the console window | * [[Core Function Print|Print( <expression> )]] -- Prints an expressions string value to the console window | ||
− | * [[Core Function Println|Println( <expression> )]] -- Prints an expressions string value to the console window and inserts a newline | + | * [[Core Function Println|Println( <expression> )]] -- Prints an expressions string value to the console window and inserts a newline character at the end. |
− | * [[Core Function Printf|Printf( <expression>, <expressions>... )]] -- Print a formatted string to the console window | + | * [[Core Function Printf|Printf( <expression>, <expressions>... )]] -- Print a formatted string (similar to the C printf() function) |
− | * [[Core Function Input|Input( < | + | * [[Core Function VPrintf|VPrintf( <expression>, <expressions>... )]] -- Print a formatted string (similar to the C printf() function) using an array as the parameters |
− | * [[Core Function InputC|InputC( < | + | * [[Core Function PrintfC|PrintfC( <format control>, <params> )]] -- Print a formatted string to the console window |
− | * [[Core Function | + | * [[Core Function Input|Input( <prompt> )]] -- Capture a string 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 ConsoleClear|Cls( )]] -- Alias for [[Core Function ConsoleClear|ConsoleClear( )]] | ||
+ | * [[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 ConsoleShow|ConsoleShow( )]] -- Show the console window | ||
+ | * [[Core Function ConsoleState|ConsoleState( )]] -- Get the console state (Visible, Hidden) | ||
+ | * [[Core Function ConsoleBeep|ConsoleBeep( <freq>, <duration> )]] -- Plays the sound of a beep of a specified frequency and duration through the console speaker | ||
+ | * [[Core Function ConsoleSeek|ConsoleSeek( <x>, <y> )]] -- Set the position of the console cursor | ||
+ | * [[Core Function ConsoleBackColour|ConsoleBackColour( <colour> )]] -- Set the background (behind text) colour of the console | ||
+ | * [[Core Function ConsoleForeColour|ConsoleForeColour( <colour> )]] -- Set the foreground (text) colour of the console | ||
+ | * [[Core Function ConsoleBufferWidth|ConsoleBufferWidth( <newval> )]] -- Get or Set the buffer width of the console window | ||
+ | * [[Core Function ConsoleBufferHeight|ConsoleBufferHeight( <newval> )]] -- Get or Set the buffer height of the console window | ||
+ | * [[Core Function ConsoleWidth|ConsoleWidth( <newval> )]] -- Get or Set the width of the console window | ||
+ | * [[Core Function ConsoleHeight|ConsoleHeight( <newval> )]] -- Get or Set the height of the console window | ||
+ | * [[Core Function ConsoleTitle|ConsoleTitle( <newtitle> )]] -- Get or Set the title of the console window | ||
+ | * [[Core Function ConsoleCursorLeft|ConsoleCursorLeft( <newval> )]] -- Gets or sets the column position of the cursor within the buffer area | ||
+ | * [[Core Function ConsoleCursorTop|ConsoleCursorTop( <newval> )]] -- Gets or sets the row position of the cursor within the buffer area | ||
+ | * [[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 CGIConsole|CGIConsole( )]] -- Changes the console printing to work best a CGI instead of stand alone terminal | ||
− | ==== | + | ==== Multi-Threading Functions ==== |
− | * [[Core Function ThreadCreate|ThreadCreate( <name>, <function> )]] -- Create a new thread and start it off executing a function or some code | + | * [[Core Function ThreadCreate|ThreadCreate( <name>, <function>, <extra> )]] -- Create a new thread and start it off executing a function or some code |
* [[Core Function ThreadSleep|ThreadSleep( <name> )]] -- Freeze a thread and make it sleep | * [[Core Function ThreadSleep|ThreadSleep( <name> )]] -- Freeze a thread and make it sleep | ||
* [[Core Function ThreadResume|ThreadResume( <name> )]] -- Unfreeze a thread and allow it to continue execution | * [[Core Function ThreadResume|ThreadResume( <name> )]] -- Unfreeze a thread and allow it to continue execution | ||
Line 31: | Line 74: | ||
* [[Core Function ThreadExists|ThreadExists( <name> )]] -- Check if a thread exists by this name | * [[Core Function ThreadExists|ThreadExists( <name> )]] -- Check if a thread exists by this name | ||
* [[Core Function ThreadName|ThreadName( )]] -- Returns the name of the current thread that is executing this code | * [[Core Function ThreadName|ThreadName( )]] -- Returns the name of the current thread that is executing this code | ||
+ | * [[Core Function ThreadLock|ThreadLock( <lockname> ) {}]] -- Locks a given section of code allowing only one thread to execute it at a time | ||
* [[Core Function Threads|Threads( )]] -- Return an array of all threads | * [[Core Function Threads|Threads( )]] -- Return an array of all threads | ||
==== Variable Type Conversions ==== | ==== Variable Type Conversions ==== | ||
+ | * [[Core Function Bool|Bool( <expression> )]] -- Returns the TRUE(1) or FALSE(0) representation of an expression | ||
* [[Core Function Char|Char( <expression> )]] -- Returns the single letter representation of an expression | * [[Core Function Char|Char( <expression> )]] -- Returns the single letter representation of an expression | ||
* [[Core Function Byte|Byte( <expression> )]] -- Returns the unsigned 8-bit integer (whole number) representation of an expression | * [[Core Function Byte|Byte( <expression> )]] -- Returns the unsigned 8-bit integer (whole number) representation of an expression | ||
Line 50: | Line 95: | ||
* [[Core Function UInt64|UInt64( <expression> )]] -- Returns the unsigned 64-bit integer (whole number) representation of an expression | * [[Core Function UInt64|UInt64( <expression> )]] -- Returns the unsigned 64-bit integer (whole number) representation of an expression | ||
* [[Core Function ULong|ULong( <expression> )]] -- Returns the unsigned 64-bit integer (whole number) representation of an expression | * [[Core Function ULong|ULong( <expression> )]] -- Returns the unsigned 64-bit integer (whole number) representation of an expression | ||
+ | * [[Core Function Ptr|Ptr( <expression> )]] -- Returns the signed pointer representation of an expression | ||
+ | * [[Core Function IntPtr|IntPtr( <expression> )]] -- Returns the signed pointer representation of an expression | ||
+ | * [[Core Function UPtr|UPtr( <expression> )]] -- Returns the unsigned pointer representation of an expression | ||
+ | * [[Core Function UIntPtr|UIntPtr( <expression> )]] -- Returns the unsigned pointer representation of an expression | ||
* [[Core Function Float|Float( <expression> )]] -- Returns the 32-bit floating point representation of an expression | * [[Core Function Float|Float( <expression> )]] -- Returns the 32-bit floating point representation of an expression | ||
* [[Core Function Double|Double( <expression> )]] -- Returns the 64-bit floating point representation of an expression | * [[Core Function Double|Double( <expression> )]] -- Returns the 64-bit floating point representation of an expression | ||
* [[Core Function String|String( <expression> )]] -- Returns the String representation of an expression | * [[Core Function String|String( <expression> )]] -- Returns the String representation of an expression | ||
+ | * [[Core Function Ascii|Ascii( <expression> )]] -- Returns the String (In raw ASCII) representation of an expression | ||
+ | * [[Core Function Binary|Binary( <expression> )]] -- Returns the Binary (raw bytes) representation of an expression | ||
==== Common Variable Functions ==== | ==== Common Variable Functions ==== | ||
===== Misc ===== | ===== Misc ===== | ||
+ | * [[Core Function IsSet|IsSet( $variable )]] -- Determine if a variable is set and is not NULL | ||
* [[Core Function Unset|Unset( $variable )]] -- Delete a variable | * [[Core Function Unset|Unset( $variable )]] -- Delete a variable | ||
− | + | * [[Core Function Ref|Ref( $variable )]] -- Retrieve the variable at the lowest depth in references that the current variable links to | |
− | + | * [[Core Function IsDeclared|IsDeclared( <variable name>, <flag> )]] -- Check if a variable has been declared | |
− | * [[Core Function | + | * [[Core Function Printr|Printr( $variable, <newline>, <flag> )]] -- Prints all details about a variable in a way thats easy for humans to read it (Will print arrays etc) |
− | * [[Core Function | + | * [[Core Function VarDump|VarDump( $variable, <newline> )]] -- Dumps information about a variable |
− | * [[Core Function | + | * [[Core Function Assign|Assign( <varname>, <data>, <flag> )]] -- Assigns a variable by name with the data |
+ | * [[Core Function Atof|Atof( <variable>, <count>, <start> )]] -- Convert string to Double | ||
+ | * [[Core Function Atoi|Atoi( <variable>, <count>, <start> )]] -- Convert string to Int32 | ||
+ | * [[Core Function Atol|Atol( <variable>, <count>, <start> )]] -- Convert string to Int64 | ||
+ | * [[Core Function StrToTol|StrTol( <variable>, <count>, <base>, <start> )]] -- Convert string to Int64 | ||
+ | * [[Core Function StrToToul|StrToul( <variable>, <count>, <base>, <start> )]] -- Convert string to UInt64 | ||
+ | * [[Core Function IsNan|IsNan( <variable> )]] -- Check if a floating pointer value is NaN (Not a number) | ||
+ | * [[Core Function IsInf|IsInf( <variable> )]] -- Check if a floating pointer value is Infinity | ||
+ | * [[Core Function IsPosInf|IsPosInf( <variable> )]] -- Check if a floating pointer value is Positive-Infinity | ||
+ | * [[Core Function IsNegInf|IsNegInf( <variable> )]] -- Check if a floating pointer value is Negative-Infinity | ||
+ | * [[Core Function IsNormal|IsNormal( <variable> )]] -- Check if a floating pointer value is neither NaN, PosInf, NegInf or Inf | ||
+ | * [[Core Function SignBit|SignBit( <variable> )]] -- Returns whether the sign of a variable is negative | ||
===== 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 isVarByte|isVarByte( $variable )]] -- Checks if a variable is an unsigned 8-bit integer type | * [[Core Function isVarByte|isVarByte( $variable )]] -- Checks if a variable is an unsigned 8-bit integer type | ||
* [[Core Function isVarSByte|isVarSByte( $variable )]] -- Checks if a variable is a signed 8-bit integer type | * [[Core Function isVarSByte|isVarSByte( $variable )]] -- Checks if a variable is a signed 8-bit integer type | ||
Line 82: | Line 147: | ||
* [[Core Function isVarULong|isVarULong( $variable )]] -- Checks if a variable is an unsigned 64-bit integer type | * [[Core Function isVarULong|isVarULong( $variable )]] -- Checks if a variable is an unsigned 64-bit integer type | ||
* [[Core Function isVarFloat|isVarFloat( $variable )]] -- Checks if a variable is a single precision floating point type | * [[Core Function isVarFloat|isVarFloat( $variable )]] -- Checks if a variable is a single precision floating point type | ||
+ | * [[Core Function isVarFP|isVarFP( $variable )]] -- Checks if a check if a variable type is only a float/double nothing else | ||
* [[Core Function isVarDouble|isVarDouble( $variable )]] -- Checks if a variable is a double precision floating point type | * [[Core Function isVarDouble|isVarDouble( $variable )]] -- Checks if a variable is a double precision floating point type | ||
+ | * [[Core Function isVarPtr|isVarPtr( $variable )]] -- Checks if a variable is an signed pointer type | ||
+ | * [[Core Function isVarIntPtr|isVarIntPtr( $variable )]] -- Checks if a variable is an signed pointer type | ||
+ | * [[Core Function isVarUPtr|isVarUPtr( $variable )]] -- Checks if a variable is an unsigned pointer type | ||
+ | * [[Core Function isVarUIntPtr|isVarUIntPtr( $variable )]] -- Checks if a variable is an unsigned pointer type | ||
* [[Core Function isVarString|isVarString( $variable )]] -- Checks if a variable is a string type | * [[Core Function isVarString|isVarString( $variable )]] -- Checks if a variable is a string type | ||
* [[Core Function isVarNumber|isVarNumber( $variable )]] -- Checks if a variable is any integer or float/double type | * [[Core Function isVarNumber|isVarNumber( $variable )]] -- Checks if a variable is any integer or float/double type | ||
+ | * [[Core Function isVarNull|isVarNull( $variable )]] -- Checks if a variable is null | ||
* [[Core Function isVarBinary|isVarBinary( $variable )]] -- Checks if a variable is a binary type | * [[Core Function isVarBinary|isVarBinary( $variable )]] -- Checks if a variable is a binary type | ||
+ | * [[Core Function isVarFunction|isVarFunction( $variable )]] -- Checks if a variable is a function type | ||
* [[Core Function isVarRef|isVarRef( $variable )]] -- Check if a variable is an reference to another variable | * [[Core Function isVarRef|isVarRef( $variable )]] -- Check if a variable is an reference to another variable | ||
* [[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 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 isVarClientSocket|isVarClientSocket( $variable )]] -- Check if a variable holds a Client socket object | ||
+ | * [[Core Function isVarSocket|isVarSocket( $variable )]] -- Check if a variable holds a Socket object | ||
+ | * [[Core Function isVarSigned|isVarSigned( $variable )]] -- Check if a variable holds a signed integer | ||
+ | * [[Core Function isVarUnsigned|isVarUnsigned( $variable )]] -- Check if a variable holds an unsigned integer | ||
+ | |||
+ | ====== Get Type Directly ====== | ||
+ | * [[Core Function GetVarType|GetVarType( $variable )]] -- Get the common type of a variable | ||
+ | * [[Core Function GetVarTypeName|GetVarTypeName( $variable )]] -- Get the common type of a variable (as a string) | ||
+ | * [[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 | ||
==== Binary Data Management Functions ==== | ==== Binary Data Management Functions ==== | ||
− | * [[Core Function | + | * [[Core Function Bin|Bin( <args> )]] -- Create a new binary variable |
− | * [[Core Function | + | * [[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 | ||
− | * [[Core Function BinaryWipe|BinaryWipe( <binary-array> )]] -- Wipes a binary variables data 100% and sets the variable to a blank int containing | + | * [[Core Function BinaryContains|BinaryContains( <binary-array>, <needle>, <start>, <length> )]] -- Check if a binary variable contains a given byte or contains another binary variable |
+ | * [[Core Function BinaryCRC32|BinaryCRC32( <binary-array> )]] -- Calculates the crc32 polynomial of a binary array | ||
+ | * [[Core Function BinaryWipe|BinaryWipe( <binary-array> )]] -- Wipes a binary variables data 100% and sets the variable to a blank int containing null | ||
+ | * [[Core Function BinaryFill|BinaryFill( <binary-array>, <fillWith>, <start>, <length> )]] -- Fill a binary variables data (replace all of it or part of it) with a given byte or zero | ||
* [[Core Function BinaryStr|BinaryStr( <binary-array>, <separator> )]] -- Create a Hex string from a binary array | * [[Core Function BinaryStr|BinaryStr( <binary-array>, <separator> )]] -- Create a Hex string from a binary array | ||
− | * [[Core Function BinaryHex|BinaryHex( <expression> )]] -- Create a binary array from a hex string | + | * [[Core Function BinaryHex|BinaryHex( <expression>, <flag> )]] -- Create a binary array from a hex string |
− | * [[Core Function BinaryLen|BinaryLen( <binary-array> )]] -- Returns the number of bytes in a binary variable | + | * [[Core Function BinaryLen|BinaryLen( <binary-array>, <newLen> )]] -- Returns the number of bytes in a binary variable (or increase it's capacity for bytes) |
* [[Core Function BinaryGet|BinaryGet( <binary-array>, <index> )]] -- Get the byte at an index of a binary variable | * [[Core Function BinaryGet|BinaryGet( <binary-array>, <index> )]] -- Get the byte at an index of a binary variable | ||
* [[Core Function BinarySet|BinarySet( <binary-array>, <index>, <value> )]] -- Set the byte at an index of a binary variable | * [[Core Function BinarySet|BinarySet( <binary-array>, <index>, <value> )]] -- Set the byte at an index of a binary variable | ||
* [[Core Function BinaryReverse|BinaryReverse( <binary-array>, <start>, <length> )]] -- Reverse the order bytes a binary variable | * [[Core Function BinaryReverse|BinaryReverse( <binary-array>, <start>, <length> )]] -- Reverse the order bytes a binary variable | ||
+ | * [[Core Function BinaryRemove|BinaryRemove( <binary-array>, <start>, <length> )]] -- Remove bytes from a binary variable | ||
+ | * [[Core Function BinaryExpand|BinaryExpand( <binary-array> )]] -- Expand the bytes of a binary variable into a string along with the text they match up to so you can convert binary into something human readable | ||
+ | * [[Core Function BinaryStartsWith|BinaryStartsWith( <binary-array>, <binary-array2> )]] -- Check if this binary variable starts with a specific sequence of bytes | ||
+ | * [[Core Function BinaryEndsWith|BinaryEndsWith( <binary-array>, <binary-array2> )]] -- Check if this binary variable ends with a specific sequence of bytes | ||
+ | * [[Core Function BinaryIndexOf|BinaryIndexOf( <binary-array>, <needle>, <start>, <length> )]] -- Find the first occurrence of the needle | ||
+ | * [[Core Function BinaryIndexOfAny|BinaryIndexOfAny( <binary-array>, <needles>, <start>, <length> )]] -- Find the first occurrence of any of the needles | ||
+ | * [[Core Function BinaryLastIndexOf|BinaryLastIndexOf( <binary-array>, <needle>, <start>, <length> )]] -- Find the last occurrence of the needle | ||
+ | * [[Core Function BinaryLastIndexOfAny|BinaryLastIndexOfAny( <binary-array>, <needles>, <start>, <length> )]] -- Find the last occurrence of any of the needles | ||
+ | * [[Core Function BinaryRandom|BinaryRandom( <binary-array>, <seed> )]] -- Randomize all bytes in a binary variable | ||
+ | * [[Core Function BinaryReplace|BinaryReplace( <binary-array>, <needle>, <replacement>, <maxReplacements> )]] -- Search for a byte or string of bytes in a binary variable and replace it | ||
+ | * [[Core Function BinaryHash|BinaryHash( <binary-array> )]] -- Gain a unique Hash of the bytes in this 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 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 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 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 | ||
− | * [[Core Function BinaryInsert|BinaryInsert( <binary-array>, <binary-array2>, <index> )]] -- Insert a binary variables data into another binary variable at a specific location | + | * [[Core Function BinaryInsert|BinaryInsert( <binary-array>, <binary-array2>, <index>, <overwrite> )]] -- Insert a binary variables data into another binary variable at a specific location |
* [[Core Function BinaryUnshift|BinaryUnshift( <binary-array>, <byte> )]] -- Add a byte to the beginning of a binary variable | * [[Core Function BinaryUnshift|BinaryUnshift( <binary-array>, <byte> )]] -- Add a byte to the beginning of a binary variable | ||
* [[Core Function BinaryPush|BinaryPush( <binary-array>, <byte> )]] -- Add a byte to the end of a binary variable | * [[Core Function BinaryPush|BinaryPush( <binary-array>, <byte> )]] -- Add a byte to the end of a binary variable | ||
Line 111: | Line 213: | ||
* [[Core Function BinaryPop|BinaryPop( <binary-array> )]] -- Delete the last byte from a binary variable | * [[Core Function BinaryPop|BinaryPop( <binary-array> )]] -- Delete the last byte from a binary variable | ||
* [[Core Function BinaryResize|BinaryResize( <binary-array>, <size>, <data> )]] -- Resize a binary variables data array | * [[Core Function BinaryResize|BinaryResize( <binary-array>, <size>, <data> )]] -- Resize a binary variables data array | ||
+ | * [[Core Function BinaryPadLeft|BinaryPadLeft( <binary-array>, <padSize>, <padWith> )]] -- Left pad a binary variable with a number of bytes or pad it to a total number of bytes | ||
+ | * [[Core Function BinaryPadRight|BinaryPadRight( <binary-array>, <padSize>, <padWith> )]] -- Right pad a binary variable with a number of bytes or pad it to a total number of bytes | ||
+ | * [[Core Function BinarySHA1|BinarySHA1( <binary-array> )]] -- Returns the SHA1 hash of a binary variable | ||
+ | * [[Core Function BinaryFromStr|BinaryFromStr( <string>, <flag> )]] -- Returns a new binary variable created from a strings raw bytes | ||
+ | * [[Core Function BinaryToStr|BinaryToStr( <binary-array>, <flag>, <start>, <length> )]] -- Returns a new string containing the binary data as raw bytes | ||
+ | * [[Core Function BinaryMD5|BinaryMD5( <binary-array> )]] -- Returns the MD5 hash of a binary variable | ||
+ | * [[Core Function BinaryCompare|BinaryCompare( <binary-array>, <offset>, <needle, <needleOffset>, <length>, <ignoreCase> )]] -- Compare two binary variables | ||
* [[Core Function BinaryCompress|BinaryCompress( <binary-array> )]] -- Compress a binary variables data | * [[Core Function BinaryCompress|BinaryCompress( <binary-array> )]] -- Compress a binary variables data | ||
* [[Core Function BinaryUncompress|BinaryUncompress( <binary-array> )]] -- Uncompress a binary variable data | * [[Core Function BinaryUncompress|BinaryUncompress( <binary-array> )]] -- Uncompress a binary variable data | ||
+ | * [[Core Function BinaryToLower|BinaryToLower( <binary-array> )]] -- Convert any ASCII characters to lowercase | ||
+ | * [[Core Function BinaryToUpper|BinaryToUpper( <binary-array> )]] -- Convert any ASCII characters to uppercase | ||
+ | * [[Core Function BinaryTrim|BinaryTrim( <binary-array>, <trimBytes> )]] -- Trim any single-byte ASCII characters '\r', '\n', '\t', and ' ' (or provide your own) to the left or right | ||
+ | * [[Core Function BinaryTrimLeft|BinaryTrimLeft( <binary-array>, <trimBytes> )]] -- Trim any single-byte ASCII characters '\r', '\n', '\t', and ' ' (or provide your own) to the left | ||
+ | * [[Core Function BinaryTrimRight|BinaryTrimRight( <binary-array>, <trimBytes> )]] -- Trim any single-byte ASCII characters '\r', '\n', '\t', and ' ' (or provide your own) to the right | ||
+ | * [[Core Function BinaryStripNull|BinaryStripNull( <binary-array> )]] -- Strip all NULL bytes (0x00) from a binary variable | ||
+ | * [[Core Function BinaryUUEncode|BinaryUUEncode( <binary-array> )]] -- Encodes a binary variable using the uuencode algorithm | ||
+ | * [[Core Function BinaryUUDecode|BinaryUUDecode( <binary-array> )]] -- Decodes a binary variable that was encode using the uuencode algorithm | ||
* [[Core Function BinarySave|BinarySave( <binary-array>, <file>, <flag> )]] -- Save a binary variable data to file | * [[Core Function BinarySave|BinarySave( <binary-array>, <file>, <flag> )]] -- Save a binary variable data to file | ||
* [[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 | ||
+ | |||
+ | ===== Binary packer/unpacker ===== | ||
+ | * [[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 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 ===== | ||
+ | * [[Core Function Vec|Vec( <binary-array>, <offset>, <bits> )]] -- Treats binary variable as a bit vector made up of elements of width bits and returns the value of the element specified by offset as an unsigned integer and optionally sets bits in the string to a given value | ||
+ | |||
+ | ===== Bits ===== | ||
+ | * [[Core Function SetBit|SetBit( <binary-array>, <index>, <value> )]] -- Set the bit at a given index | ||
+ | * [[Core Function GetBit|GetBit( <binary-array>, <index> )]] -- Get the bit at a given index | ||
+ | * [[Core Function InvertBit|InvertBit( <binary-array>, <index> )]] -- Invert the bit at a given index | ||
+ | * [[Core Function ClearBit|ClearBit( <binary-array>, <index> )]] -- Clear the bit at a given index | ||
+ | * [[Core Function FillBit|FillBit( <binary-array>, <value> )]] -- Set all bits to the value | ||
+ | |||
+ | ===== BinHex 5.0 ===== | ||
+ | * [[Core Function BinHexEncode|BinHexEncode( <name>, <type>, <creator>, <resourceFork>, <dataFork>, <flag1>, <flag2> )]] -- Encode data (usually a file) to BinHex 5.0 format | ||
+ | * [[Core Function BinHexDecode|BinHexDecode( <binhex-binary> )]] -- Decode data (usually a file) from BinHex 5.0 format | ||
+ | |||
+ | ===== 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 | ||
+ | * [[Core Function ByteBufferNew|ByteBufferNew( <nothing/capacity/binary/byteBuffer> )]] -- Make a new ByteBuffer | ||
+ | * [[Core Function ByteBufferGet|ByteBufferGet( <byteBuffer>, <type>, <index> )]] -- Get data from a ByteBuffer | ||
+ | * [[Core Function ByteBufferPut|ByteBufferPut( <byteBuffer>, <type>, <variable> )]] -- Add data to a ByteBuffer | ||
+ | * [[Core Function ByteBufferPeek|ByteBufferPeek( <byteBuffer>, <type> )]] -- Peek at data from a ByteBuffer (same as get but without moving the position forward) | ||
+ | * [[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 ByteBufferCapacity|ByteBufferCapacity( <byteBuffer> )]] -- Get the current capacity of a ByteBuffer | ||
+ | * [[Core Function ByteBufferRewind|ByteBufferRewind( <byteBuffer> )]] -- Set the position of a ByteBuffer back to the start | ||
+ | * [[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 ByteBufferPosition|ByteBufferPosition( <byteBuffer>, <newPosition> )]] -- Get and set the position of a ByteBuffer to any value | ||
+ | * [[Core Function ByteBufferRemaining|ByteBufferRemaining( <byteBuffer> )]] -- Get how many bytes are possible to read from current position of a ByteBuffer | ||
+ | * [[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 121: | Line 329: | ||
* [[Core Function ASin|ASin( <expression> )]] -- Calculates the arcsine of a number | * [[Core Function ASin|ASin( <expression> )]] -- Calculates the arcsine of a number | ||
* [[Core Function ATan|ATan( <expression> )]] -- Calculates the arctangent of a number | * [[Core Function ATan|ATan( <expression> )]] -- Calculates the arctangent of a number | ||
− | * [[Core Function | + | * [[Core Function ATan2|ATan2( <expression>, <expression2> )]] -- Compute arc tangent with two parameters |
− | * [[Core Function | + | * [[Core Function Angle2D|Angle2D( <x1>, <y1>, <x2>, <y2> )]] -- Calculates the angle of a line defined by two points on a 2D surface |
− | * [[Core Function | + | * [[Core Function Barycentric|Barycentric( <value1>, <value2>, <value3>, <amount1>, <amount2> )]] -- Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric (areal) coordinates |
− | * [[Core Function | + | * [[Core Function CatmullRom|CatmullRom( <value1>, <value2>, <value3>, <value4>, <amount> )]] -- Performs a Catmull-Rom interpolation using the specified positions |
+ | * [[Core Function BaseConv|BaseConv( <number>, <frombase>, <tobase> )]] -- Convert a number between arbitrary bases | ||
+ | * [[Core Function BitAND|BitAND( <expression>, <expression2>, <n> )]] -- Performs a bitwise AND operation | ||
+ | * [[Core Function BitNOT|BitNOT( <expression> )]] -- Performs a bitwise NOT operation | ||
+ | * [[Core Function BitOR|BitOR( <expression>, <expression2>, <n> )]] -- Performs a bitwise OR operation | ||
* [[Core Function BitSHIFT|BitSHIFT( <value>, <shift> )]] -- Performs a bit shifting operation | * [[Core Function BitSHIFT|BitSHIFT( <value>, <shift> )]] -- Performs a bit shifting operation | ||
− | * [[Core Function BitXOR|BitXOR( <expression> )]] -- | + | * [[Core Function BitTripleSHIFT|BitTripleSHIFT( <value>, <shift> )]] -- Performs a triple bit shifting operation |
− | * [[Core Function Ceiling|Ceiling( <expression> )]] -- | + | * [[Core Function BitXOR|BitXOR( <expression>, <expression2>, <n> )]] -- Performs a bitwise exclusive OR (XOR) operation |
− | * [[Core Function Cos|Cos( <expression> )]] -- | + | * [[Core Function BitROTATE|BitROTATE( <expression>, <shift>, <size> )]] -- Performs a bit shifting operation, with rotation |
− | * [[Core Function Cosh|Cosh( <expression> )]] -- | + | * [[Core Function BitSwap|BitSwap( <expression> )]] -- Byte-swap (little-endian <-> big-endian) |
− | * [[Core Function Exp|Exp( <expression> )]] -- | + | * [[Core Function Ceiling|Ceiling( <expression> )]] -- Returns a number rounded up to the next integer |
− | * [[Core Function Floor|Floor( <expression> )]] -- | + | * [[Core Function Clamp|Clamp( <value>, <min>, <max> )]] -- Clamps the specified value |
− | * [[Core Function Log|Log( <expression> )]] -- | + | * [[Core Function Cos|Cos( <expression> )]] -- Calculates the cosine of a number |
− | * [[Core Function Math|Math( <expression> )]] -- | + | * [[Core Function Cosh|Cosh( <expression> )]] -- Returns the hyperbolic cosine of the specified angle |
− | * [[Core Function Max|Max( <expression> )]] -- | + | * [[Core Function DegreesToRadians|DegreesToRadians( <value> )]] -- Converts degrees to radians |
− | * [[Core Function Min|Min( <expression> )]] -- | + | * [[Core Function DegreesToRevolutions|DegreesToRevolutions( <value> )]] -- Converts degrees to revolutions |
− | * [[Core Function Mod|Mod( <expression> )]] -- | + | * [[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 Pow|Pow( <expression> )]] -- | + | * [[Core Function Distance|Distance( <value1>, <value2> )]] -- Calculates the absolute value of the difference of two values |
− | * [[Core Function Random|Random( < | + | * [[Core Function Distance2D|Distance2D( <x1>, <y1>, <x2>, <y2> )]] -- Finds the distance between two points on a 2D surface |
− | * [[Core Function Round|Round( <expression> )]] -- | + | * [[Core Function Distance3D|Distance3D( <x1>, <y1>, <z1>, <x2>, <y2>, <z2> )]] -- Finds the distance between two points on a 3D surface |
− | * [[Core Function Sin|Sin( <expression> )]] -- | + | * [[Core Function Exp|Exp( <expression> )]] -- Returns e raised to the specified power |
− | * [[Core Function Sinh|Sinh( <expression> )]] -- | + | * [[Core Function Floor|Floor( <expression> )]] -- Returns the largest integer less than or equal to the specified number |
− | * [[Core Function Sqrt|Sqrt( <expression> )]] -- | + | * [[Core Function frexp|frexp( <x> )]] -- Returns m and e such that x = m2e, e is an integer and the absolute value of m is in the range [0.5, 1) (or zero when x is zero) |
− | * [[Core Function Tan|Tan( <expression> )]] -- | + | * [[Core Function Gauss|Gauss( <amplitude>, <x>, <y>, <radX>, <radY>, <sigmaX>, <sigmaY> )]] -- Get the result of the Gaussian function |
− | * [[Core Function Tanh|Tanh( <expression> )]] -- | + | * [[Core Function GradiansToRevolutions|GradiansToRevolutions( <value> )]] -- Converts gradians to revolutions |
− | * [[Core Function | + | * [[Core Function GradiansToDegrees|GradiansToDegrees( <value> )]] -- Converts gradians to degrees |
+ | * [[Core Function GradiansToRadians|GradiansToRadians( <value> )]] -- Converts gradians to radians | ||
+ | * [[Core Function Hermite|Hermite( <value1>, <tangent1>, <value2>, <tangent2>, <amount> )]] -- Performs a Hermite spline interpolation | ||
+ | * [[Core Function IsDivisible|IsDivisible( <expression>, <divisor>, <flag> )]] -- Check if an expression is divisible by a given divisor optionally comparing as double/int64 | ||
+ | * [[Core Function IsOdd|IsOdd( <expression> )]] -- Check if an expression is an odd number | ||
+ | * [[Core Function IsEven|IsEven( <expression> )]] -- Check if an expression is an even number | ||
+ | * [[Core Function IntToRom|IntToRom( <expression> )]] -- Returns the roman numerical value of an integer | ||
+ | * [[Core Function ldexp|ldexp( <m>, <n> )]] -- Returns the value of m * 2^n | ||
+ | * [[Core Function Lerp|Lerp( <from>, <to>, <amount> )]] -- Interpolates between two values using a linear function by a given amount | ||
+ | * [[Core Function Log|Log( <expression>, <newbase> )]] -- Returns the logarithm of a specified number | ||
+ | * [[Core Function Log10|Log10( <expression> )]] -- Returns the common (base-10) logarithm of a specified number | ||
+ | * [[Core Function Math|Math( <expression> )]] -- Parse a string containing mathematical equations | ||
+ | * [[Core Function Max|Max( <expression>, <expression2> )]] -- Find the greater number and return it | ||
+ | * [[Core Function Min|Min( <expression>, <expression2> )]] -- Find the lesser number and return it | ||
+ | * [[Core Function Mod|Mod( <expression>, <expression2> )]] -- Performs the modulus operation | ||
+ | * [[Core Function Modf|Modf( <x>, <intpart> )]] -- Breaks x into an integral and a fractional part | ||
+ | * [[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 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 RadiansToDegrees|RadiansToDegrees( <value> )]] -- Converts radians to degrees | ||
+ | * [[Core Function RadiansToRevolutions|RadiansToRevolutions( <value> )]] -- Converts radians to revolutions | ||
+ | * [[Core Function RadiansToGradians|RadiansToGradians( <value> )]] -- Converts radians to gradians | ||
+ | * [[Core Function Random|Random( <minValue>, <maxValue>, <flag> )]] -- Get a random number from the defined area | ||
+ | * [[Core Function RandomVar|RandomVar( <seed>, <flag>, <flag> )]] -- Generator a random number | ||
+ | * [[Core Function RandomSeed|RandomSeed( <flag>, <size> )]] -- Generator a cryptographically strong random number for use as a seed | ||
+ | * [[Core Function RandomSeedSet|RandomSeedSet( <seed> )]] -- Set the seed of Sputniks random number generator | ||
+ | * [[Core Function RevolutionsToDegrees|RevolutionsToDegrees( <value> )]] -- Converts revolutions to degrees. | ||
+ | * [[Core Function RevolutionsToRadians|RevolutionsToRadians( <value> )]] -- Converts revolutions to radians. | ||
+ | * [[Core Function RevolutionsToGradians|RevolutionsToGradians( <value> )]] -- Converts revolutions to gradians. | ||
+ | * [[Core Function Round|Round( <expression>, <decimalplaces> )]] -- Returns a number rounded to a specified number of decimal places | ||
+ | * [[Core Function RomToInt|RomToInt( <expression> )]] -- Returns the integer value of a roman numerical sequence | ||
+ | * [[Core Function Sin|Sin( <expression> )]] -- Returns the sine of the specified angle | ||
+ | * [[Core Function Sinh|Sinh( <expression> )]] -- Returns the hyperbolic sine of the specified angle | ||
+ | * [[Core Function SmoothStep|SmoothStep( <value1>, <value2>, <amount> )]] -- Interpolates between two values using a cubic equation | ||
+ | * [[Core Function Sqrt|Sqrt( <expression> )]] -- Returns the square root of a specified number | ||
+ | * [[Core Function Sum|Sum( <expressions> )]] -- Returns the sum of all the parameters | ||
+ | * [[Core Function Tan|Tan( <expression> )]] -- Returns the 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 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 WrapAngle|WrapAngle( <value> )]] -- Reduces a given angle to a value between π and -π. | ||
+ | * [[Core Function IsPrime|IsPrime( <expression> )]] -- Check if a number is a Prime number | ||
==== String Functions ==== | ==== String Functions ==== | ||
− | * [[Core Function Asc|Asc( < | + | * [[Core Function AddCSlashes|AddCSlashes( <str>, <charlist> )]] -- Escape a string with slashes in a C style |
− | * [[Core Function AscW|AscW( <expression> )]] -- | + | * [[Core Function AddBR|AddBR( <str> )]] -- Add HTML breaks to strings at newlines |
− | * [[Core Function Chr|Chr( <expression> )]] -- | + | * [[Core Function Asc|Asc( <char> )]] -- Returns the ASCII code of a character |
− | * [[Core Function ChrW|ChrW( <expression> )]] -- | + | * [[Core Function AscW|AscW( <char> )]] -- Returns the UNICODE code of a character |
− | * [[Core Function Contains|Contains( < | + | * [[Core Function AscArray|AscArray( <char> )]] -- Returns an array of ASCII characters of a string |
− | * [[Core Function | + | * [[Core Function AscWArray|AscWArray( <char> )]] -- Returns an array of UNICODE characters of a string |
+ | * [[Core Function Between|Between( <haystack>, <firstneedle>, <secondneedle>, <case> )]] -- Return the text between a start and end substring | ||
+ | * [[Core Function BCrypt|BCrypt( <expression>, <rounds> )]] -- Hash a string (usually password) with BCrypt. | ||
+ | * [[Core Function BCryptVerify|BCryptVerify( <expression>, <hash> )]] -- Verify a hash to a string (usually password) with BCrypt. | ||
+ | * [[Core Function CSetMatch|CSetMatch( <expression>, <charset>, <case> )]] -- Check if a string contains only characters from a substring(charset) | ||
+ | * [[Core Function CSetDel|CSetDel( <expression>, <charset>, <case> )]] -- Delete all characters found in the charset from a string | ||
+ | * [[Core Function ChunkSplit|ChunkSplit( <body>, <chunklen>, <end> )]] -- Split a string into smaller chunks | ||
+ | * [[Core Function Chop|Chop( <variable> )]] -- Removes and returns the last character from a string | ||
+ | * [[Core Function Chomp|Chomp( <variable> )]] -- Removes trailing newlines and returns the number of characters removed | ||
+ | * [[Core Function CountChars|CountChars( <string> )]] -- Return information about characters used in a string | ||
+ | * [[Core Function CountWords|CountWords( <string>, <format>, <charlist>, <outputArray> )]] -- Return information about words used in a string | ||
+ | * [[Core Function Chr|Chr( <expression> )]] -- Returns a character corresponding to an ASCII code | ||
+ | * [[Core Function ChrW|ChrW( <expression> )]] -- Returns a character corresponding to an UNICODE code | ||
+ | * [[Core Function ChrArray|ChrArray( <expression> )]] -- Returns a string corresponding to an array ASCII codes | ||
+ | * [[Core Function ChrWArray|ChrWArray( <expression> )]] -- Returns a string corresponding to an array UNICODE codes | ||
+ | * [[Core Function CRC32|CRC32( <string> )]] -- Calculates the crc32 polynomial of a string | ||
+ | * [[Core Function Crypt|Crypt( <string>, <salt> )]] -- One-way string hashing | ||
+ | * [[Core Function Contains|Contains( <srting>, <string>, <casesense>)]] -- Check if string contains a sub string | ||
+ | * [[Core Function ContainsAny|ContainsAny( <srting>, <array>, <casesense>)]] -- Check if string contains any of the given strings from an array | ||
+ | * [[Core Function CountFields|CountFields( <string>, <delim>, <quote>, <quoteescape>, <comment>, <trimtype> )]] -- Returns the number of values (fields) in the string passed that are separated by the separator string passed | ||
+ | * [[Core Function CSV|CSV( <string>, <delim>, <quote>, <quoteescape>, <comment>, <trimtype> )]] -- Split strings and parse a CSV text into an array | ||
+ | * [[Core Function DecOct|DecOct( <expression> )]] -- Decimal to octal | ||
* [[Core Function Dec|Dec( <expression> )]] -- Returns a integer representation of a hexadecimal string | * [[Core Function Dec|Dec( <expression> )]] -- Returns a integer representation of a hexadecimal string | ||
* [[Core Function FDec|FDec( <expression> )]] -- Returns a float representation of a hexadecimal string | * [[Core Function FDec|FDec( <expression> )]] -- Returns a float representation of a hexadecimal string | ||
* [[Core Function DDec|DDec( <expression> )]] -- Returns a double representation of a hexadecimal string | * [[Core Function DDec|DDec( <expression> )]] -- Returns a double representation of a hexadecimal string | ||
* [[Core Function DecPad|DecPad( <expression>, <count> )]] -- Pads numeric string to a given number of chars (Filling in the gap with zeros) | * [[Core Function DecPad|DecPad( <expression>, <count> )]] -- Pads numeric string to a given number of chars (Filling in the gap with zeros) | ||
− | * [[Core Function EndsWith|EndsWith( <expression> )]] -- | + | * [[Core Function DecryptString|DecryptString( <expression>, <password> )]] -- Decrypt a string with a given password |
+ | * [[Core Function Decode64|Decode64( <expression>, <strict> )]] -- Decodes string with MIME base64 | ||
+ | * [[Core Function Encode64|Encode64( <expression> )]] -- Encodes string with MIME base64 | ||
+ | * [[Core Function Escape|Escape( <expression>, <custom> )]] -- Add escapes to a string | ||
+ | * [[Core Function EscapeMeta|EscapeMeta( <expression>, <custom> )]] -- Add escapes to meta characters | ||
+ | * [[Core Function EscapeShellArg|EscapeShellArg( <arg> )]] -- Escape a string to be used as a shell argument | ||
+ | * [[Core Function EscapeShellCmd|EscapeShellCmd( <command> )]] -- Escape shell metacharacters | ||
+ | * [[Core Function EncryptString|EncryptString( <expression>, <password> )]] -- Encrypt a string with a given password | ||
+ | * [[Core Function EndsWith|EndsWith( <expression>, <expression2>, <flag> )]] -- Check if a string ends with a substring | ||
+ | * [[Core Function Hash|Hash( <expression> )]] -- Generate a unique hash code for a string value | ||
+ | * [[Core Function Hebrev|Hebrev( <hebrew_text>, <max_chars_per_line> )]] -- Convert logical Hebrew text to visual text | ||
+ | * [[Core Function Hebrevc|Hebrevc( <hebrew_text>, <max_chars_per_line> )]] -- Convert logical Hebrew text to visual text with newline conversion | ||
+ | * [[Core Function Hex2Str|Hex2Str( <expression>, <flag> )]] -- Convert a hex string back to a normal string | ||
* [[Core Function Hex|Hex( <expression>, <length> )]] -- Returns a string representation of an integer type converted to hexadecimal | * [[Core Function Hex|Hex( <expression>, <length> )]] -- Returns a string representation of an integer type converted to hexadecimal | ||
+ | * [[Core Function HTMLTranslationTable|HTMLTranslationTable( <the_table>, <flags>, <encoding> )]] -- Returns the translation table used by HTMLSpecialChars() and HTMLEntities() | ||
+ | * [[Core Function HTMLEntities|HTMLEntities( <string>, <flags>, <encoding>, <double_encode> )]] -- Convert all applicable characters to HTML entities | ||
+ | * [[Core Function HTMLEntityDecode|HTMLEntityDecode( <string>, <flags>, <encoding>, <double_encode> )]] -- Convert all HTML entities to their applicable characters | ||
+ | * [[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 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 FmtNumber|FmtNumber( <number>, <decimals>, <dec_point>, <thousands_sep> )]] -- Format a number with grouped thousands | ||
* [[Core Function FHex|FHex( <expression> )]] -- Returns a string representation of an float type converted to hexadecimal | * [[Core Function FHex|FHex( <expression> )]] -- Returns a string representation of an float type converted to hexadecimal | ||
* [[Core Function DHex|DHex( <expression> )]] -- Returns a string representation of an double type converted to hexadecimal | * [[Core Function DHex|DHex( <expression> )]] -- Returns a string representation of an double type converted to hexadecimal | ||
− | * [[Core Function InStr|InStr( <string>, <substirng>, < | + | * [[Core Function Find|Find( <string>, <pattern>, <offset>, <plain> )]] -- Search for a match in a string and return the match with its found position and length |
− | * [[Core Function isAlpha|isAlpha( <expression> )]] -- | + | * [[Core Function GMatch|GMatch( <string>, <pattern>, <asKeypair>, <offset> )]] -- Extract the patterns from a string and return as array or associative array |
− | * [[Core Function isAlphaNumeric|isAlphaNumeric( <expression> )]] -- | + | * [[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 isASCII|isASCII( <expression> )]] -- | + | * [[Core Function InStr|InStr( <string>, <substirng>, <ignoreCase>, <occurrence>, <start> )]] -- Checks if a string contains a given substring |
− | * [[Core Function isEmpty|isEmpty( <expression> )]] -- | + | * [[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 isFloat|isFloat( <expression> )]] -- | + | * [[Core Function isAlpha|isAlpha( <expression> )]] -- Checks if string contains only Alphabetic characters |
− | * [[Core Function isLower|isLower( <expression> )]] -- | + | * [[Core Function isAlphaNumeric|isAlphaNumeric( <expression> )]] -- Checks if string contains only AlphaNumeric(A-Z, 0-9), Characters |
− | * [[Core Function isNumeric|isNumeric( <expression> )]] -- | + | * [[Core Function isASCII|isASCII( <expression> )]] -- Check if string contains only ASCII chars |
− | * [[Core Function isSpace|isSpace( <expression> )]] -- | + | * [[Core Function isControl|isControl( <expression> )]] -- Check if string contains only control chars |
− | * [[Core Function isSymbol| | + | * [[Core Function isEmpty|isEmpty( <expression> )]] -- Checks if a string is completely empty |
− | * [[Core Function isUpper|isUpper( <expression> )]] -- | + | * [[Core Function isEmptyOrNull|isEmptyOrNull( <expression> )]] -- Checks if a string is completely empty or if the variable is null or if the variable translates to false (zero) |
− | * [[Core Function isXDigit|isXDigit( <expression> )]] -- | + | * [[Core Function IsGraph|IsGraph( <expression> )]] -- Checks if a string is completely only characters that have a graphical representation |
− | * [[Core Function LC|LC( <expression> )]] -- | + | * [[Core Function isDigit|isDigit( <expression> )]] -- Checks if string only contains numbers |
− | * [[Core Function LCFirst|LCFirst( <expression> )]] -- | + | * [[Core Function isFloat|isFloat( <expression> )]] -- Check if string contains a floating point and could be converted |
− | * [[Core Function LCWords|LCWords( <expression> )]] -- | + | * [[Core Function isLower|isLower( <expression> )]] -- Checks if string contains only lowercase letters |
− | * [[Core Function Left|Left( <expression> )]] -- | + | * [[Core Function isNumeric|isNumeric( <expression> )]] -- Checks if string only contains numbers (Allows for float/double) |
− | * [[Core Function Match|Match( < | + | * [[Core Function isSpace|isSpace( <expression> )]] -- Check if string contains only whitespace |
− | * [[Core Function MD5|MD5( <expression> )]] -- | + | * [[Core Function isSymbol|isSymbol( <expression> )]] -- Check if string contains only symbol chars |
− | * [[Core Function PadLeft|PadLeft( <expression> )]] -- | + | * [[Core Function IsPunctuation|IsPunctuation( <expression> )]] -- Check if string contains only characters categorized as a punctuation marks |
− | * [[Core Function PadRight|PadRight( <expression> )]] -- | + | * [[Core Function IsSeparator|IsSeparator( <expression> )]] -- Check if string contains only characters categorized as a separator character |
− | * [[Core Function RandStr|RandStr( <expression> )]] -- | + | * [[Core Function IsBlank|IsBlank( <expression> )]] -- Check if string contains only spaces and tabs |
+ | * [[Core Function isString|isString( <expression> )]] -- Check if variable contains only string chars | ||
+ | * [[Core Function isUpper|isUpper( <expression> )]] -- Check if string contains only uppercase chars | ||
+ | * [[Core Function isXDigit|isXDigit( <expression> )]] -- Check if string contains only hex chars | ||
+ | * [[Core Function IndexOf|IndexOf( <expression>, <needle>, <pos>, <case>, <count> )]] -- Reports the index of the first occurrence of the specified string in a string | ||
+ | * [[Core Function IndexOfAny|IndexOfAny( <expression>, <needle>, <pos>, <case>, <count> )]] -- Reports the index of the first occurrence of any characters or array of strings in a specified string | ||
+ | * [[Core Function IndexNotOf|IndexNotOf( <expression>, <needle>, <pos>, <case>, <count> )]] -- Reports the index of the first none occurrence of the specified string in the current string | ||
+ | * [[Core Function IndexNotOfAny|IndexNotOfAny( <expression>, <needle>, <pos>, <case>, <count> )]] -- Reports the index of the first none occurrence of any characters or array of strings in a specified string | ||
+ | * [[Core Function LastIndexOf|LastIndexOf( <expression>, <needle>, <pos>, <case>, <count> )]] -- Reports the index of the last occurrence of the specified string in the current string | ||
+ | * [[Core Function LastIndexOfAny|LastIndexOfAny( <expression>, <needle>, <pos>, <case>, <count> )]] -- Reports the index of the last occurrence of any characters or array of strings in a specified string | ||
+ | * [[Core Function LastIndexNotOf|LastIndexNotOf( <expression>, <needle>, <pos>, <case>, <count> )]] -- Reports the index of the last none occurrence of the specified string in the current string | ||
+ | * [[Core Function LastIndexNotOfAny|LastIndexNotOfAny( <expression>, <needle>, <pos>, <case>, <count> )]] -- Reports the index of the last none occurrence of any characters or array of strings in a specified string | ||
+ | * [[Core Function JsonEncode|JsonEncode( <value>, <options> )]] -- Returns the JSON representation of a value | ||
+ | * [[Core Function JsonDecode|JsonDecode( <value>, <options> )]] -- Decodes a JSON string | ||
+ | * [[Core Function Levenshtein|Levenshtein( <str1>, <str2>, <cost_ins>, <cost_rep>, <cost_de> )]] -- Calculate Levenshtein distance between two strings | ||
+ | * [[Core Function LC|LC( <expression> )]] -- Returns string in all lower case | ||
+ | * [[Core Function LCFirst|LCFirst( <expression> )]] -- Lower Cases first letter of string | ||
+ | * [[Core Function LCLast|LCLast( <expression> )]] -- Lower Cases last letter of string | ||
+ | * [[Core Function LCWords|LCWords( <expression> )]] -- Lower Cases first letter of each word in string | ||
+ | * [[Core Function Left|Left( <expression>, <count> )]] -- Returns a number of characters from the left-hand side of a string | ||
+ | * [[Core Function Lines|Lines( <expression> )]] -- Returns an array containing all the lines from a string | ||
+ | * [[Core Function Match|Match( <string>, <pattern>, <offset> )]] -- Search for the first match of pattern in a string if found return the captures from the pattern | ||
+ | * [[Core Function Metaphone|Metaphone( <string>, <phonemes> )]] -- Calculate the metaphone key of a string | ||
+ | * [[Core Function MD5|MD5( <expression> )]] -- Creates MD5 Hash of specified string | ||
+ | * [[Core Function NthField|NthField( <string>, <delim>, <index>, <quote>, <quoteescape>, <comment>, <trimtype> )]] -- Returns a field from a row of data (such as comma separated text) | ||
+ | * [[Core Function Ord|Ord( <char> )]] -- Returns the ASCII code of a character | ||
+ | * [[Core Function OrdW|OrdW( <char> )]] -- Returns the UNICODE code of a character | ||
+ | * [[Core Function Oct|Oct( <string> )]] -- Converts an octal string into the numerical corresponding value | ||
+ | * [[Core Function PadLeft|PadLeft( <expression>, <pad>, <count> )]] -- Pad the left of a string a given number of times with another string | ||
+ | * [[Core Function PadRight|PadRight( <expression>, <pad>, <count> )]] -- Pad the right of a string a given number of times with another string | ||
+ | * [[Core Function PrintableEncode|PrintableEncode( <string )]] -- Convert a quoted-printable string to an 8 bit string | ||
+ | * [[Core Function PrintableDecode|PrintableDecode( <string )]] -- Convert a 8 bit string to a quoted-printable string | ||
+ | * [[Core Function RandStr|RandStr( <count>, <allowEscapes>, <allowVariables>, <allowCode> )]] -- Generate a random sequence of characters at a given length | ||
+ | * [[Core Function RegexMatch|RegexMatch( <expression>, <pattern>, <matches>, <offset> )]] -- Perform a regular expression match | ||
+ | * [[Core Function RegexReplace|RegexReplace( <expression>, <pattern>, <replacement>, <limit>, <count>, <offset> )]] -- Perform a regular expression search and replace | ||
+ | * [[Core Function RegexEscape|RegexEscape( <expression>, <delimiter> )]] -- Escape regular expression characters | ||
+ | * [[Core Function RegexUnescape|RegexUnescape( <expression> )]] -- Remove any escapes regular expression characters | ||
+ | * [[Core Function ResolveStr|ResolveStr( <expression>, <allowEscapes>, <allowVariables>, <allowCode> )]] -- Treat a given string as if it was a Sputnik "string" and parse all stuff inside it such as $variables etc | ||
* [[Core Function Repeat|Repeat( <expression>, <count>, <flag> )]] -- Create a new string or new array containing repeats of a string provided | * [[Core Function Repeat|Repeat( <expression>, <count>, <flag> )]] -- Create a new string or new array containing repeats of a string provided | ||
− | * [[Core Function Replace|Replace( <expression> )]] -- | + | * [[Core Function Replace|Replace( <expression>, <find>, <replace>, <case-sensitive-flag> )]] -- Replace substrings within a string with other strings |
− | * [[Core Function Reverse|Reverse( <expression> )]] -- | + | * [[Core Function Reverse|Reverse( <expression> )]] -- Reverse all characters in a string |
− | * [[Core Function Right|Right( <expression> )]] -- | + | * [[Core Function RevHex|RevHex( <expression> )]] -- Reverse a string of hex digits |
− | * [[Core Function SHA1|SHA1( <expression> )]] -- | + | * [[Core Function Right|Right( <expression>, <count> )]] -- Returns a number of characters from the right-hand side of a string |
+ | * [[Core Function Rot13|Rot13( <str> )]] -- Perform the rot13 transform on a string | ||
+ | * [[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 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 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( < | + | * [[Core Function SPrintf|SPrintf( <format control>, <params>... )]] -- Returns a formatted string (similar to the C sprintf() function) |
− | * [[Core Function StartsWith|StartsWith( <expression> )]] -- | + | * [[Core Function StartsWith|StartsWith( <expression>, <expression2>, <flag> )]] -- Check if a string starts with a substring |
− | * [[Core Function StrLen|StrLen( <expression> )]] -- | + | * [[Core Function StrChr|StrChr( <haystack>, <char>, <start>, <count> )]] -- Locate first occurrence of character in string |
− | * [[Core Function SubStr|SubStr( <expression> )]] -- | + | * [[Core Function StrrChr|StrrChr( <haystack>, <char>, <start>, <count> )]] -- Locate last occurrence of character in string |
− | * [[Core Function Trim|Trim( <expression> )]] -- | + | * [[Core Function StrShuffle|StrShuffle( <str> )]] -- Randomly shuffles a string |
− | * [[Core Function TrimLeft|TrimLeft( <expression> )]] -- | + | * [[Core Function Strpbrk|Strpbrk( <haystack>, <needle>, <start>, <count> )]] -- Locate a list of possible characters in string and return the position of it |
− | * [[Core Function TrimRight|TrimRight( <expression> )]] -- | + | * [[Core Function StripCSlashes|StripCSlashes( <str> )]] -- Unescape string escaped with AddCSlashes() |
− | * [[Core Function UC|UC( <expression> )]] -- | + | * [[Core Function StripTags|StripTags( <str>, <allowable_tags> )]] -- Strip HTML tags from a string |
− | * [[Core Function UCFirst|UCFirst( <expression> )]] -- | + | * [[Core Function StripWS|StripWS( <str>, <flags>, <charList> )]] -- Strips the white space in a string or given characters. |
− | * [[Core Function UCWords|UCWords( <expression> )]] -- | + | * [[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 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 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 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 StrIndex|StrIndex( <expression>, <index>, <value> )]] -- Get or set a char from/to a string at a specific index | ||
+ | * [[Core Function StrIncrement|StrIncrement( <str> )]] -- Increment a string the same way as doing ++ on a string like $a++ | ||
+ | * [[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 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 SubStr|SubStr( <expression>, <start>, <count>, <replacement> )]] -- Return part of a string or replace it | ||
+ | * [[Core Function SubStrCount|SubStrCount( <expression>, <expression2>, <offset>, <length>, <flag> )]] -- Count the number of substring occurrences | ||
+ | * [[Core Function SubStrCmp|SubStrCmp( <main_str>, <str>, <offset>, <length>, <ignoreCase> )]] -- Comparison of two strings from an offset, up to length characters | ||
+ | * [[Core Function SubStrReplace|SubStrReplace( <expression>, <replacement>, <start>, <length> )]] -- Replace text within a portion of a string | ||
+ | * [[Core Function Sub|Sub( <expression>, <start>, <end>, <replacement> )]] -- Return part of a string or replace it | ||
+ | * [[Core Function StrSplit|StrSplit( <expression>, <split_length>, <flag> )]] -- Convert a string to an array | ||
+ | * [[Core Function StrCompress|StrCompress( <expression> )]] -- Compress a string | ||
+ | * [[Core Function StrUncompress|StrUncompress( <expression> )]] -- Uncompress a string | ||
+ | * [[Core Function Trim|Trim( <expression>, <chars> )]] -- Removes whitespace from the beginning and end 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 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 UCFirst|UCFirst( <expression> )]] -- Upper Cases first letter of string | ||
+ | * [[Core Function UCLast|UCLast( <expression> )]] -- Upper Cases last letter of string | ||
+ | * [[Core Function UCWords|UCWords( <expression> )]] -- Upper Cases first letter of each word in string | ||
+ | * [[Core Function UUEncode|UUEncode( <expression> )]] -- Encodes a string 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 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 WordWrap|WordWrap( <str>, <width>, <break>, <cut> )]] -- Wraps a string to a given number of characters | ||
==== 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 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 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 Array|Array( <expressions> )]] -- Create a new array | ||
+ | * [[Core Function Clear|Clear( <array>, <flag> )]] -- Remove all items from an array | ||
* [[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 | + | * [[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/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 FillKeys|FillKeys( <keys>, <value> )]] -- Fill an array with values, specifying keys | ||
+ | * [[Core Function UBound|UBound( <array/binary-array> )]] -- Returns the index of the highest element in an array | ||
+ | * [[Core Function LBound|LBound( <array/binary-array> )]] -- Returns the index of the lowest element in an array | ||
* [[Core Function Push|Push( <array>, <expressions> )]] -- Add items to the end of an array | * [[Core Function Push|Push( <array>, <expressions> )]] -- Add items to the end of an array | ||
+ | * [[Core Function PushArray|PushArray( <array>, <expressions> )]] -- Add arrays to the end of an array | ||
* [[Core Function Insert|Insert( <array>, <id>, <expressions> )]] -- Add items to an array at a given location | * [[Core Function Insert|Insert( <array>, <id>, <expressions> )]] -- Add items to an array at a given location | ||
+ | * [[Core Function InsertArray|InsertArray( <array>, <id>, <arrays> )]] -- Add arrays to an array at a given location | ||
+ | * [[Core Function Pad|Pad( <array>, <size>, <value> )]] -- Pad array to the specified length with a value | ||
* [[Core Function Unshift|Unshift( <array>, <expressions> )]] -- Add items to the beginning of an array | * [[Core Function Unshift|Unshift( <array>, <expressions> )]] -- Add items to the beginning of an array | ||
− | * [[Core Function Pop|Pop( <array> )]] -- Delete the | + | * [[Core Function UnshiftArray|UnshiftArray( <array>, <expressions> )]] -- Add arrays to the beginning of an array |
− | * [[Core Function Shift|Shift( <array> )]] -- Delete the | + | * [[Core Function Pop|Pop( <array> )]] -- Delete the last item in an array |
+ | * [[Core Function Shift|Shift( <array> )]] -- Delete the first item in an array | ||
+ | * [[Core Function Range|Range( <start>, <end>, <step> )]] -- Create an array containing a range of elements | ||
* [[Core Function Remove|Remove( <array>, <start-id>, <end-id> )]] -- Delete items from an array starting at a given location and stopping at a given location | * [[Core Function Remove|Remove( <array>, <start-id>, <end-id> )]] -- Delete items from an array starting at a given location and stopping at a given location | ||
− | * [[Core Function | + | * [[Core Function RemoveValue|RemoveValue( <array>, <needle>, <useStrict>, <removeAll>, <recursive>, <returnCopy> )]] -- Remove a specific value or all matching values from an array |
+ | * [[Core Function RemoveValues|RemoveValues( <array>, <needles>, <useStrict>, <removeAll>, <recursive>, <returnCopy> )]] -- Remove an array of specific values from an array | ||
+ | * [[Core Function RemoveKey|RemoveKey( <array>, <key>, <returnCopy> )]] -- Remove a specific key from an array | ||
+ | * [[Core Function RemoveKeys|RemoveKeys( <array>, <keys>, <returnCopy> )]] -- Remove an array of keys from an recursively from an array | ||
+ | * [[Core Function IsIndexSet|IsIndexSet( <array>, <index> )]] -- Check if an element exist at a given index ID within an array | ||
+ | * [[Core Function Grep|Grep( <array>, <pattern>, <flag> )]] -- Returns a new array consisting of the elements of the input arrays values that match the given regex pattern | ||
+ | * [[Core Function GrepKeys|GrepKeys( <array>, <pattern>, <flag> )]] -- Returns a new array consisting of the elements of the input arrays keys that match the given regex pattern | ||
+ | * [[Core Function Search|Search( <array>, <value>, <flag>, <invert_flag>, <returnKeys> )]] -- Returns a new array consisting of the elements of the input array that match the given value | ||
+ | * [[Core Function Combine|Combine( <array-keys>, <array-values> )]] -- Creates a hash (Dictionary) by using the values from the keys array as keys and the values from the values array as the corresponding values | ||
+ | * [[Core Function Walk|Walk( <array>, <function> )]] -- Walk through the arrays items and execute a user defined function on each one | ||
+ | * [[Core Function Rev|Rev( <array> )]] -- Returns a new array consisting of the reverse of another array | ||
+ | * [[Core Function IsKeySet|IsKeySet( <array>, <key> )]] -- Check if given key exists within an array | ||
+ | * [[Core Function IsKeysSet|IsKeysSet( <array>, <keys>, <flag> )]] -- Check if any/all/none of a given key from a key array was found inside an array | ||
+ | * [[Core Function Keys|Keys( <array>, <flag> )]] -- Create an array containing all KEYS from an array | ||
+ | * [[Core Function Values|Values( <array>, <flag> )]] -- Create an array containing all VALUES from an array | ||
+ | * [[Core Function InArray|InArray( <array>, <needle>, <strict>, <flag> )]] -- Checks if a value exists in an array | ||
+ | * [[Core Function Flip|Flip( <array> )]] -- Exchanges all keys with their associated values in an array | ||
+ | * [[Core Function Splice|Splice( <array>, <offset>, <length>, <replace_with> )]] -- Cut out and return a chunk or portion of an array and optionally replace the cut out section with new data. | ||
+ | * [[Core Function Order|Order( <array>, <flag> )]] -- Fix the order of numeric array elements from 0 to whatever. | ||
+ | * [[Core Function Sort|Sort( <array>, <flag>, <function> )]] -- Sort an array by value or keys optionally modify it in place or return new and optionally use a custom function to decide how to sort it | ||
+ | * [[Core Function CountValues|CountValues( <array> )]] -- Counts all the values of an array | ||
+ | * [[Core Function SumKeys|SumKeys( <array> )]] -- Counts the sum total of all the keys of an array | ||
+ | * [[Core Function SumValues|SumValues( <array> )]] -- Counts the sum total of all the values of an array | ||
+ | * [[Core Function IndexOfValue|IndexOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> )]] -- Checks if a value exists in an array and returns its index value | ||
+ | * [[Core Function IndexOfValueAny|IndexOfValueAny( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> )]] -- Checks if a value (from an array) exists in an array and returns its index value | ||
+ | * [[Core Function IndexNotOfValue|IndexNotOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> )]] -- Checks for the non-occurrence of a value in an array and returns the first index that does not contain the value | ||
+ | * [[Core Function IndexNotOfValueAny|IndexNotOfValueAny( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> )]] -- Checks for the non-occurrence of a value (from an array) in an array and returns the first index that does not contain any of the values | ||
+ | * [[Core Function LastIndexOfValue|LastIndexOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> )]] -- Checks if a value exists in an array and returns the index of the last occurrence of the value | ||
+ | * [[Core Function LastIndexOfValueAny|LastIndexOfValueAny( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> )]] -- Checks if a value (from an array of values) exists in an array and returns the index of the last occurrence of the value (from the value array) | ||
+ | * [[Core Function LastIndexNotOfValue|LastIndexNotOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> )]] -- Checks for the non-occurrence of a value in an array and returns the last index that does not contain the value | ||
− | ==== | + | ==== 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. | ||
+ | * [[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 ==== | ||
+ | * [[Core Function Enumerate|Enumerate( <enum> )]] -- Cycle through all Name + Values in an enum | ||
+ | * [[Core Function EnumKey|EnumKey( <enum>, <value> )]] -- Return the string KEY for a given integer value | ||
+ | * [[Core Function EnumValue|EnumValue( <enum>, <value> )]] -- Return the integer value for a given string KEY | ||
+ | * [[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 EnumIsDefined|EnumIsDefined( <enum>, <value> )]] -- Check if a given value exists within an enum | ||
==== Process Functions ==== | ==== Process Functions ==== | ||
− | * [[Core Function DLLCall|DLLCall( < | + | * [[Core Function DLLCall|DLLCall( <Dll/DLLName>, <FunctionName/Alias>, <ReturnType>, <ParameterType>, <CharSet/CallingConvention>, <Parms> )]] -- Dynamically call a function in a DLL |
− | * [[Core Function Run|Run( <file>, <workdir>, <flag> )]] -- Runs an external program | + | * [[Core Function DLLOpen|DLLOpen( <DLLName>, <FunctionName/Alias>, <ReturnType>, <ParameterType>, <CharSet/CallingConvention> )]] -- Open a DLL and get a function from it and return it as a ready to call object function that is already compiled (vastly speeding up the repeat call speed) |
− | * [[Core Function RunWait|RunWait( <file>, <workdir>, <flag> )]] -- Runs an external program and waits until the program finishes | + | * [[Core Function DLLClose|DLLClose( <DLL> )]] -- Close and unset a return value from DLLOpen() |
+ | * [[Core Function DLLImport|DLLImport( <varies...> )]] -- Dynamically load a function from a DLL and transform it to act and behave like a normal Sputnik function (Can load thousands functions at a time and even save the loaded stuff to DLL for quick access later) | ||
+ | * [[Core Function Exec|Exec( <command>, <output>, <return_var> )]] -- Execute an external program | ||
+ | * [[Core Function ExecShell|ExecShell( <command> )]] -- Execute command via shell and return the complete output as a string | ||
+ | * [[Core Function ExecSystem|ExecSystem( <command>, <return_var> )]] -- Execute an external program and display the output | ||
+ | * [[Core Function Passthru|Passthru( <command>, <return_var> )]] -- Execute an external program and display raw output | ||
+ | * [[Core Function System|System( <expression> )]] -- Execute system command | ||
+ | * [[Core Function Run|Run( <file>, <arguments>, <workdir>, <flag>, <show options> )]] -- Runs an external program | ||
+ | * [[Core Function RunWait|RunWait( <file>, <timeout>, <arguments>, <workdir>, <flag>, <show options> )]] -- Runs an external program and waits until the program finishes | ||
+ | * [[Core Function RunShell|RunShell( <file>, <arguments>, <workdir>, <flag>, <show options> )]] -- Runs an external program (Using ShellExecute) | ||
+ | * [[Core Function RunShellWait|RunShellWait( <file>, <timeout>, <arguments>, <workdir>, <flag>, <show options> )]] -- Runs an external program (Using ShellExecute) and waits until the program finishes | ||
+ | * [[Core Function RunAsSet|RunAsSet( <user>, <domain>, <password>, <options> )]] -- Initialise a set of user credentials to use during Run and RunWait operations. | ||
+ | * [[Core Function RunCapture|RunCapture( <file>, <arguments>, <workdir>, <flag>, <function> )]] -- Run a program in a hidden window and capture its printed output as strings | ||
+ | * [[Core Function PHandle|PHandle( )]] -- Get the process handle of this program | ||
* [[Core Function ProcessClose|ProcessClose( <pid/name> )]] -- Terminates a named process | * [[Core Function ProcessClose|ProcessClose( <pid/name> )]] -- Terminates a named process | ||
+ | * [[Core Function ProcessID|ProcessID( <name> )]] -- Gets the process ID of a given name | ||
* [[Core Function ProcessExists|ProcessExists( <pid/name> )]] -- Checks to see if a specified process exists | * [[Core Function ProcessExists|ProcessExists( <pid/name> )]] -- Checks to see if a specified process exists | ||
* [[Core Function ProcessList|ProcessList( <name> )]] -- Returns an array listing the currently running processes (names and PIDs) | * [[Core Function ProcessList|ProcessList( <name> )]] -- Returns an array listing the currently running processes (names and PIDs) | ||
− | * [[Core Function ProcessSetPriority|ProcessSetPriority( <name>, <priority> )]] -- Changes the priority of a process | + | * [[Core Function ProcessSetPriority|ProcessSetPriority( <pid/name>, <priority> )]] -- Changes the priority of a process |
− | * [[Core Function ProcessWait|ProcessWait( <name>, <timeout> )]] -- Pauses the current thread until a given process exists or optional the timeout expires | + | * [[Core Function ProcessWait|ProcessWait( <pid/name>, <timeout> )]] -- Pauses the current thread until a given process exists or optional the timeout expires |
+ | * [[Core Function ProcessWaitClose|ProcessWaitClose( <pid/name>, <timeout> )]] -- Pauses the current thread until a given process no longer exists or optional the timeout expires | ||
+ | * [[Core Function Shutdown|Shutdown( <shutdown code> )]] -- Shuts down the system | ||
+ | * [[Core Function Debug|Debug( <flag> )]] -- Enter or leave debug mode in debug state the program can interact with operating system processes that run in a special mode by enabling the native property SeDebugPrivilege on the current thread | ||
==== Environment Management ==== | ==== Environment Management ==== | ||
* [[Core Function EnvExpand|EnvExpand( <expression> )]] -- Convert a string containing %name% env tags and return complete string with names resolved | * [[Core Function EnvExpand|EnvExpand( <expression> )]] -- Convert a string containing %name% env tags and return complete string with names resolved | ||
+ | * [[Core Function EnvGet|EnvGet( <tag> )]] -- Get the value of an environment variable | ||
+ | * [[Core Function EnvSet|EnvSet( <tag>, <expression> )]] -- Set the value of an environment variable | ||
+ | * [[Core Function EnvUpdate|EnvUpdate( )]] -- Refreshes the OS environment | ||
==== File Functions ==== | ==== File Functions ==== | ||
Line 230: | 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> )]] -- 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 FileAppend|FileAppend( <file>, <expression> )]] -- Append a line of text to the end of a previously opened text file | + | * [[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 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 | + | * [[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 | + | * [[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 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 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 FileLoad|FileLoad( <file> )]] -- Load all text from a file | * [[Core Function FileLoad|FileLoad( <file> )]] -- Load all text from a file | ||
+ | |||
+ | ===== Misc ===== | ||
+ | * [[Core Function FileMove|FileMove( <file1>, <file2>, <flag> )]] -- Move a file | ||
+ | * [[Core Function FileCopy|FileCopy( <file1>, <file2>, <flag> )]] -- Copy a file | ||
+ | * [[Core Function FileDelete|FileDelete( <file> )]] -- Delete a file | ||
+ | * [[Core Function FileExists|FileExists( <file> )]] -- Check if a given file exists | ||
+ | * [[Core Function FileCreationTime|FileCreationTime( <file>, <flag> )]] -- Get the creation time of a file | ||
+ | * [[Core Function FileWriteTime|FileWriteTime( <file>, <flag> )]] -- Get the last write time of a file | ||
+ | * [[Core Function FileAccessTime|FileAccessTime( <file>, <flag> )]] -- Get the last access time of a file | ||
+ | * [[Core Function FileEncrypt|FileEncrypt( <file> )]] -- Encrypt a file so only the windows account used to encrypt it can decrypt it | ||
+ | * [[Core Function FileDecrypt|FileDecrypt( <file> )]] -- Decrypt a file previously encrypted by this windows user account | ||
+ | * [[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 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 FileRecycleEmpty|FileRecycleEmpty( <root> )]] -- Empty the recycle bin with no GUI, sound or confirmation | ||
+ | * [[Core Function FileRecycle|FileRecycle( <filename> )]] -- Move a file or directory to the recycle bin | ||
+ | * [[Core Function FileMatch|FileMatch( <pattern>, <string>, <flags> )]] -- Match filename against a Glob pattern | ||
+ | |||
+ | ===== Dialogs ===== | ||
+ | * [[Core Function FileSaveDialog|FileSaveDialog ( <title>, <dir>, <filter>, <options>, <default name> )]] -- Initiates a Save File Dialog | ||
+ | * [[Core Function FileOpenDialog|FileOpenDialog ( <title>, <dir>, <filter>, <options>, <default name> )]] -- Initiates a Load File Dialog | ||
+ | |||
+ | ==== Directory Functions ==== | ||
+ | * [[Core Function GetFiles|GetFiles ( <path>, <pattern> )]] -- Get an array of all files in a directory | ||
+ | * [[Core Function GetFolders|GetFolders ( <path>, <pattern> )]] -- Get an array of all folders in a directory | ||
+ | * [[Core Function Glob|Glob( <pattern>, <flags> )]] -- Find files/folders matching a pattern | ||
+ | * [[Core Function MKDir|MKDir ( <path> )]] -- Creates all directories and subdirectories as specified by path | ||
+ | * [[Core Function RMDir|RMDir ( <path>, <flag> )]] -- Deletes the specified directory and, if indicated, any subdirectories in the directory | ||
+ | * [[Core Function DirExists|DirExists ( <path> )]] -- Determines whether the given path refers to an existing directory on disk | ||
+ | * [[Core Function DirCopy|DirCopy ( <sourcepath>, <destpath> )]] -- Copies a directory and all sub-directories and files (Similar to xcopy) | ||
+ | * [[Core Function DirMove|DirMove( <sourcepath>, <destpath> )]] -- Moves a directory to another location | ||
+ | * [[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 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 ===== | ||
+ | * [[Core Function FolderSelectDialog|FolderSelectDialog ( <text>, <dir>, <flag>, <init dir> )]] -- Initiates a Browse For Folder Dialog | ||
+ | |||
+ | ==== Path Functions ==== | ||
+ | * [[Core Function ParsePath|ParsePath ( <path> )]] -- Resolve a file name and locate its full path | ||
+ | * [[Core Function HasExtension|HasExtension ( <path> )]] -- Determines whether a path includes a file name extension | ||
+ | * [[Core Function GetFullPath|GetFullPath ( <path> )]] -- Returns the absolute path for the specified path string | ||
+ | * [[Core Function GetDirectoryName|GetDirectoryName ( <path> )]] -- Returns the directory information for the specified path string | ||
+ | * [[Core Function GetExtension|GetExtension ( <path> )]] -- Returns the extension of the specified path string | ||
+ | * [[Core Function GetFileName|GetFileName ( <path> )]] -- Returns the file name and extension of the specified path string | ||
+ | * [[Core Function GetFileNameWithoutExtension|GetFileNameWithoutExtension ( <path> )]] -- Returns the file name of the specified path string without the extension | ||
+ | * [[Core Function GetPathRoot|GetPathRoot ( <path> )]] -- Gets the root directory information of the specified path | ||
+ | * [[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 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 ==== | ||
+ | |||
+ | ===== HTTP Functions ===== | ||
+ | * [[Core Function HTTPFileExists|HTTPFileExists( <url> )]] -- Check if a file exists at a given URL | ||
+ | * [[Core Function HTTPGetString|HTTPGetString( <url> )]] -- Copy all text from a URL and return it as a string | ||
+ | * [[Core Function HTTPDownload|HTTPDownload( <url>, <dest>, <progress>, <completed>, <param> )]] -- Download a file from a given URL | ||
+ | |||
+ | ===== MySQL Functions ===== | ||
+ | * [[Core Function MySQLConnect|MySQLConnect( <ip/ip:port>, <login>, <password> )]] -- Connect to a MySQL database | ||
+ | * [[Core Function MySQLSelectDB|MySQLSelectDB( <mysql>, <db name> )]] -- Select a database | ||
+ | * [[Core Function MySQLQuery|MySQLQuery( <mysql>, <query> )]] -- Execute a query | ||
+ | * [[Core Function MySQLFill|MySQLFill( <mysql>, <query> )]] -- Grab a table or parts of it from the Database | ||
+ | * [[Core Function MySQLFetch|MySQLFetch( <mysql data> )]] -- Fetch the next row from a table | ||
+ | * [[Core Function MySQLFetchReset|MySQLFetchReset( <mysql data> )]] -- Reset the current position in the table rows to 0 | ||
+ | * [[Core Function MySQLFields|MySQLFields( <mysql data> )]] -- Return how many Fields are in the table | ||
+ | * [[Core Function MySQLRows|MySQLRows( <mysql data> )]] -- Return how many Rows are in the table | ||
+ | * [[Core Function MySQLClose|MySQLClose( <mysql> )]] -- Close a MySQL connection | ||
+ | |||
+ | ===== Sputnik Client/Server Functions (This is just for connecting Sputnik Clients to Sputnik Servers nothing else) ===== | ||
+ | * [[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 SSApprove|SSApprove( <client socket> )]] -- Approve 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( <client/client socket> )]] -- Get the status of a client or of our client | ||
+ | * [[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 SSRead|SSRead( <client/server>, <data type> )]] --Read data from a client/server | ||
+ | * [[Core Function SSDrop|SSDrop( <client socket>, <reason> )]] -- Kick a client off the 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) ===== | ||
+ | * [[Core Function SocketAccept|SocketAccept( <socket> )]] -- Creates a new <socket> for a newly created connection | ||
+ | * [[Core Function SocketAvailable|SocketAvailable( <socket> )]] -- Gets the amount of data that has been received from the network and is available to be read | ||
+ | * [[Core Function SocketBind|SocketBind( <socket>, <ip>, <port> )]] -- Associates a <socket> with a local endpoint | ||
+ | * [[Core Function SocketClose|SocketClose( <socket>, <wait> )]] -- Closes the <socket> connection and releases all associated resources | ||
+ | * [[Core Function SocketConnect|SocketConnect( <socket>, <ip>, <port> )]] -- Establishes a connection to a remote host | ||
+ | * [[Core Function SocketConnected|SocketConnected( <socket> )]] -- Checks if a socket is connected and ready for use or not | ||
+ | * [[Core Function SocketCreate|SocketCreate( <sockettype>, <protocoltype>, <addressfamily> )]] -- Create a new <socket> | ||
+ | * [[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 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 SocketSendTo|SocketSendTo( <socket>, <ip>, <port>, <binary-variable>, <length>, <flag> )]] -- Sends data to the specified ip + port | ||
+ | * [[Core Function SocketSendFile|SocketSendFile( <socket>, <file-name> )]] -- Sends a file as data to a connected <socket> | ||
+ | * [[Core Function SocketIP|SocketIP( <socket>, <remote/local> )]] -- Get the Remote or Local IP of a socket | ||
+ | * [[Core Function SocketShutdown|SocketShutdown( <socket>, <shutdown-type> )]] -- Disables sends and receives on a <socket> | ||
+ | * [[Core Function SocketPoll|SocketPoll( <socket>, <milliseconds>, <type> )]] -- Sends a kind of ping to determine the status of the <socket> | ||
+ | * [[Core Function SocketHandle|SocketHandle( <socket> )]] -- Gets the operating system handle for the <socket> | ||
+ | * [[Core Function SocketIsBound|SocketIsBound( <socket> )]] -- Gets a value that indicates whether the <socket> is bound to a specific local port | ||
+ | * [[Core Function SocketOpt|SocketOpt( <socket>, <option>, <value> )]] -- Get or Set a setting on a <socket> | ||
+ | |||
+ | ===== Misc Network Functions ===== | ||
+ | * [[Core Function HostResolve|HostResolve( <host name> )]] -- Resolves a host name such as google.com into an IP address | ||
+ | * [[Core Function Ping|Ping( <ip address/host name> )]] -- Pings a host and returns the roundtrip-time | ||
+ | |||
+ | ==== Memory Functions ==== | ||
+ | * [[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 Free|Free( <ptr> )]] -- Deallocate memory from a pointer | ||
+ | * [[Core Function StringToPTR|StringToPTR( <type>, <string> )]] -- Allocates memory for the string and writes the string to that memory and returns the pointer for that memory | ||
+ | * [[Core Function PTRToString|PTRToString( <type>, <ptr> )]] -- Reads a string from a memory pointer | ||
+ | * [[Core Function PTRRead|PTRRead( <ptr>, <type>, <offset> )]] -- Read data from a memory pointer optionally starting from a given index | ||
+ | * [[Core Function PTRWrite|PTRWrite( <ptr>, <type>, <offset>, <value> )]] -- Write data to a memory pointer optionally starting from a given index | ||
+ | * [[Core Function PTRToDLLStruct|PTRToDLLStruct( <def string>, <ptr> )]] -- Reads a DLLStruct from a memory pointer | ||
+ | * [[Core Function DLLStructCreateDef|DLLStructCreateDef( <name>, <def string> )]] -- Creates a named C/C++ style structure definition that can be used with DLLStructCreate and can also be placed inside other DLLStructs | ||
+ | * [[Core Function DLLStructGetDef|DLLStructGetDef( <name>/<dllstruct> )]] -- Return the <def string> of a given DLLStruct | ||
+ | * [[Core Function DLLStructCreate|DLLStructCreate( <def string> )]] -- Creates a C/C++ style structure to be used with DLLCall | ||
+ | * [[Core Function DLLStructCreateUnion|DLLStructCreateUnion( <def string> )]] -- Creates a C/C++ style structure (union) to be used with DLLCall | ||
+ | * [[Core Function DLLStructGetData|DLLStructGetData( <dllstruct>, <element>, <index> )]] -- Returns the data of an element of the struct | ||
+ | * [[Core Function DLLStructSetData|DLLStructSetData( <dllstruct>, <element>, <index> )]] -- Set the data of an element of the struct | ||
+ | * [[Core Function DllStructGetSize|DLLStructGetSize( <dllstruct> )]] -- Returns the size of the struct in bytes | ||
+ | * [[Core Function DllStructGetPtr|DLLStructGetPtr( <dllstruct>, <element>, <index> )]] -- Returns the pointer to the struct or an element in the struct or even a specific index of an array object within an elment | ||
+ | * [[Core Function DllStructGetVars|DLLStructGetVars( <dllstruct> )]] -- Create an array of all items and their array size with total byte size | ||
+ | |||
+ | ==== Clipboard Functions ==== | ||
+ | * [[Core Function ClipGet|ClipGet( <type> )]] -- Get data from the clipboard | ||
+ | * [[Core Function ClipSet|ClipSet( <type>, <expression> )]] -- Set data to the clipboard | ||
+ | |||
+ | ==== Registry Functions ==== | ||
+ | * [[Core Function RegRead|RegRead( <key>, <value>, <default> )]] -- Reads a value from the registry | ||
+ | * [[Core Function RegWrite|RegWrite( <key>, <value>, <type>, <data> )]] -- Sets a value in the registry | ||
+ | * [[Core Function RegDelete|RegDelete( <key>, <value> )]] -- Delete a key or value from the registry | ||
+ | * [[Core Function RegKeyList|RegKeyList( <key> )]] -- Return an array of all the keys at this location in the registry | ||
+ | * [[Core Function RegValueList|RegValueList( <key> )]] -- Return an array of all the values at this location in the registry | ||
+ | * [[Core Function RegKeyExists|RegKeyExists( <key> )]] -- Check if a key exists in the registry | ||
+ | * [[Core Function RegValueExists|RegValueExists( <key>, <value> )]] -- Check if a key value in the registry | ||
+ | |||
+ | ==== Time & Date Functions ==== | ||
+ | * [[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 TimerDiff|TimerDiff( <handle> )]] -- Returns the difference in time from a previous call to TimerInit() | ||
+ | * [[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 | ||
+ | |||
+ | ==== 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 ===== | ||
+ | * [[Core Function GUIMDICreate|GUICreate( "MDIWindow", <Text>, <Width>, <Height>, <Left>, <Top>, <Style> )]] -- Create a GUI Multi-Document-Interface window | ||
+ | * [[Core Function GUICreate|GUICreate( "Window", <Text>, <Width>, <Height>, <Left>, <Top>, <Style> )]] -- Create a GUI window | ||
+ | * [[Core Function DoEvents|DoEvents( )]] -- Keep GUI windows active by dispatching all messages in the queue | ||
+ | * [[Core Function GUILoad|GUILoad( <GUI Window> )]] -- Load a GUI window and display it (Usually after creation or after GUIUnload) | ||
+ | * [[Core Function GUIUnload|GUIUnload( <GUI Window> )]] -- Unload a GUI window and hide it (GUILoad will bring it back) | ||
+ | * [[Core Function GUIMDIParent|GUIMDIParent( <GUI Window>, <GUI Window> )]] -- Set the parent window (An MDI window) for another window to be created inside it | ||
+ | |||
+ | ===== Control Creation Functions ===== | ||
+ | * [[Core Function GUICreateButton|GUICreate( "Button", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a Button | ||
+ | * [[Core Function GUICreateDataGrid|GUICreate( "DataGrid", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a DataGrid | ||
+ | * [[Core Function GUICreateTimer|GUICreate( "Timer", <gui object>, <Interval> )]] -- Create a Timer | ||
+ | * [[Core Function GUICreateComboBox|GUICreate( "ComboBox", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a ComboBox | ||
+ | * [[Core Function GUICreateTextBox|GUICreate( "TextBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a TextBox | ||
+ | * [[Core Function GUICreateTextBoxEx|GUICreate( "TextBoxEx", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a Multiline TextBox | ||
+ | * [[Core Function GUICreateLabel|GUICreate( "Label", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a Label | ||
+ | * [[Core Function GUICreateGroupBox|GUICreate( "GroupBox", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a GroupBox | ||
+ | * [[Core Function GUICreatePictureBox|GUICreate( "PictureBox", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a PictureBox | ||
+ | * [[Core Function GUICreateProgressBar|GUICreate( "ProgressBar", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a ProgressBar | ||
+ | * [[Core Function GUICreateListBox|GUICreate( "ListBox", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a ListBox | ||
+ | * [[Core Function GUICreateContextMenu|GUICreate( "ContextMenu", <gui object> )]] -- Create a Context Menu which is used when right clicking the object | ||
+ | * [[Core Function GUICreateMenu|GUICreate( "Menu", <gui object> )]] -- Create a Menu | ||
+ | * [[Core Function GUICreateMenuItem|GUICreate( "MenuItem", <gui object>, <Text> )]] -- Create a MenuItem | ||
+ | * [[Core Function GUICreateTabSheet|GUICreate( "TabSheet", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a TabSheet | ||
+ | * [[Core Function GUICreateTabPage|GUICreate( "TabPage", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a TabPage | ||
+ | * [[Core Function GUICreateRichTextBox|GUICreate( "RichTextBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a RichTextBox | ||
+ | * [[Core Function GUICreateCodeBox|GUICreate( "CodeBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Creates a source code editor textbox the same as the one used in the Sputnik IDE | ||
+ | * [[Core Function GUICreateCheckBox|GUICreate( "CheckBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a CheckBox | ||
+ | * [[Core Function GUICreateRadioButton|GUICreate( "RadioButton", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a RadioButton | ||
+ | * [[Core Function GUICreateCodeBox|GUICreate( "CodeBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a textbox with syntax highlight and support for multiple and custom languages (Same thing Sputnik IDE uses) | ||
+ | * [[Core Function GUICreateHotkeyBox|GUICreate( "HotKeyBox", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a hotkeybox which a user can press a hotkey into it so you can make use of it | ||
+ | |||
+ | ====== NOT AVAILABLE YET ====== | ||
+ | * [[Core Function GUICreateDateTimePicker|GUICreate( "DateTimePicker", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a DateTimePicker | ||
+ | * [[Core Function GUICreateLinkLabel|GUICreate( "LinkLabel", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a LinkLabel | ||
+ | * [[Core Function GUICreateCheckedListBox|GUICreate( "CheckedListBox", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a CheckedListBox | ||
+ | * [[Core Function GUICreateListView|GUICreate( "ListView", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a ListView | ||
+ | * [[Core Function GUICreateMaskedTextBox|GUICreate( "MaskedTextBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a MaskedTextBox | ||
+ | * [[Core Function GUICreateMonthCalendar|GUICreate( "MonthCalendar", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a MonthCalendar | ||
+ | * [[Core Function GUICreateNumericUpDown|GUICreate( "NumericUpDown", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a NumericUpDown | ||
+ | * [[Core Function GUICreateToolTip|GUICreate( "ToolTip", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> )]] -- Create a ToolTip | ||
+ | * [[Core Function GUICreateTreeView|GUICreate( "TreeView", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a TreeView | ||
+ | * [[Core Function GUICreateWebBrowser|GUICreate( "WebBrowser", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a WebBrowser | ||
+ | * [[Core Function GUICreateStatusBar|GUICreate( "StatusBar", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a StatusBar | ||
+ | * [[Core Function GUICreateToolStrip|GUICreate( "ToolStrip", <gui object>, <Left>, <Top>, <Width>, <Height> )]] -- Create a ToolStrip | ||
+ | |||
+ | ===== 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. | ||
+ | |||
+ | * [[Core Function GUIWindow|GUIWindow( <window> )]] -- Properties & Functions specifically for Windows | ||
+ | * [[Core Function GUIRichTextBox|GUIRichTextBox( <richtextbox> )]] -- Properties & Functions specifically for RichTextBox | ||
+ | * [[Core Function GUIDataGrid|GUIDataGrid( <datagrid> )]] -- Properties & Functions specifically for DataGrid | ||
+ | * [[Core Function GUITimer|GUITimer( <timer> )]] -- Properties & Functions specifically for Timer | ||
+ | * [[Core Function GUICodeBox|GUIComboBox( <codebox> )]] -- Properties & Functions specifically for CodeBox | ||
+ | * [[Core Function GUIComboBox|GUIComboBox( <combobox> )]] -- Properties & Functions specifically for ComboBox | ||
+ | * [[Core Function GUICheckBox|GUICheckBox( <checkbox> )]] -- Properties & Functions specifically for CheckBox | ||
+ | * [[Core Function GUIRadioButton|GUIRadioButton( <radiobutton> )]] -- Properties & Functions specifically for RadioButton | ||
+ | * [[Core Function GUIHotkeyBox|GUIHotkeyBox( <hotkeybox> )]] -- Properties & Functions specifically for HotkeyBox | ||
+ | * [[Core Function GUIListBox|GUIListBox( <listbox> )]] -- Properties & Functions specifically for ListBox | ||
+ | * [[Core Function GUITabSheet|GUITabSheet( <tabsheet> )]] -- Properties & Functions specifically for TabSheet | ||
+ | * [[Core Function GUIProgressBar|GUIProgressBar( <progressbar> )]] -- Properties & Functions specifically for ProgressBar | ||
+ | * [[Core Function GUIPictureBox|GUIPictureBox( <picturebox> )]] -- Properties & Functions specifically for PictureBox | ||
+ | * [[Core Function GUIMsgFilter|GUIMsgFilter( <gui object>, <command> )]] -- Use a function to receive all messages windows sends to the GUI object (HWND, MSG, WPARAM, LPARAM). | ||
+ | * [[Core Function GUIWndProc|GUIWndProc( <gui>, <command> )]] -- Use a function to receive all the WindProc messages windows sends to the GUI window (HWND, MSG, WPARAM, LPARAM). | ||
+ | |||
+ | ===== Common Dialog/Control Properties Get/Set Functions ===== | ||
+ | * [[Core Function GUIGetProp|GUIGetProp( <gui object>, <prop> )]] -- Get 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 | ||
+ | |||
+ | ===== 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 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 ===== | ||
+ | * [[Core Function GUIStatus|GUIStatus( <gui window> )]] -- Check if a GUI window is loaded or unloaded | ||
+ | * [[Core Function GUIHideCaret|GUIHideCaret( <gui object> )]] -- Hide the caret in a GUI object | ||
+ | * [[Core Function GUIShowCaret|GUIShowCaret( <gui object> )]] -- Show the caret in a GUI object | ||
+ | * [[Core Function GUIRedraw|GUIRedraw( <gui object> )]] -- Redraw the object | ||
+ | * [[Core Function GUICreateFont|GUICreate( "Font", <name>, <size>, <flags> )]] -- Create a Font | ||
+ | * [[Core Function MsgBox|MsgBox( <message>, <title>, <flag>, <timeout> )]] -- Show a message dialog | ||
+ | * [[Core Function InputBox|InputBox( <title>, <message>, <default text> )]] -- Shows a box to input text | ||
+ | * [[Core Function InputBoxEx|InputBoxEx( <title>, <message>, <default text> )]] -- Shows a box to input multiple lines of text | ||
+ | * [[Core Function ChoiceBox|ChoiceBox( <title>, <message>, <options>, <flag> )]] -- Shows a window with choices for the user to pick from either none/one or many choices can be allowed | ||
+ | * [[Core Function ToolTip|ToolTip( <text>, <x>, <y> )]] -- Creates a tooltip anywhere on the screen | ||
+ | * [[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 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 | ||
+ | |||
+ | ===== Variable Type Checking etc ===== | ||
+ | * [[Core Function isVarGUIObject|isVarGUIObject( $variable )]] -- Check if a variable holds a GUI Object | ||
+ | * [[Core Function GetVarGUIObjType|GetVarGUIObjType( $variable )]] -- Get the common object type of a variable (If it is a GUI object) | ||
+ | |||
+ | ==== Keyboard Control Functions ==== | ||
+ | * [[Core Function HotKeySet|HotKeySet( <keydef>, <expression>, <param var> )]] -- Create a custom hotkey to run custom code or execute a function | ||
+ | * [[Core Function SendKeys|SendKeys( <keydef>, <flag> )]] -- Sends simulated keystrokes to the active window | ||
+ | * [[Core Function RealGetKeyState|RealGetKeyState( <vk_keycode/expression> )]] -- Checks if a key or series of keys is pressed down | ||
+ | * [[Core Function KeyHook|KeyHook( <name>, <command>, <param var> )]] -- Places a global system wide Keyhook with callback to a function or command | ||
+ | |||
+ | ==== Mouse Control Functions ==== | ||
+ | * [[Core Function MouseClick|MouseClick ( <button>, <x>, <y>, <clicks>, <speed> )]] -- Perform a mouse click operation | ||
+ | * [[Core Function MouseClickDrag|MouseClickDrag ( <button>, <x1>, <y1>, <x2>, <y2>, <speed> )]] -- Perform a mouse click and drag operation | ||
+ | * [[Core Function MouseDown|MouseDown ( <button> )]] -- Perform a mouse down event at the current mouse position | ||
+ | * [[Core Function MouseUp|MouseUp ( <button> )]] -- Perform a mouse up event at the current mouse position | ||
+ | * [[Core Function MouseMove|MouseMove ( <x>, <y>, <speed> )]] -- Moves the mouse pointer | ||
+ | * [[Core Function MouseGetPos|MouseGetPos ( )]] -- Retrieves the current position of the mouse cursor | ||
+ | * [[Core Function MouseWheel|MouseWheel ( <direction>, <clicks> )]] -- Moves the mouse wheel up or down | ||
+ | * [[Core Function MouseHook|MouseHook( <name>, <command>, <param var> )]] -- Places a global system wide MouseHook with callback to a function or command | ||
+ | |||
+ | ==== Window Management Functions ==== | ||
+ | (For info on using <title>, <text> See [[Window Titles and Text Advanced|Window Titles and Text (Advanced)]] ) | ||
+ | |||
+ | * [[Core Function WinActivate|WinActivate ( <title>, <text> )]] -- Activates (gives focus to) a window | ||
+ | * [[Core Function WinActive|WinActive ( <title>, <text> )]] -- Checks to see if a specified window exists and is currently active | ||
+ | * [[Core Function WinExists|WinExists ( <title>, <text> )]] -- Checks to see if a specified window exists | ||
+ | * [[Core Function WinGetClassList|WinGetClassList ( <title>, <text> )]] -- Retrieves the classes from a window | ||
+ | * [[Core Function WinGetHandle|WinGetHandle ( <title>, <text> )]] -- Retrieves the internal handle of a window | ||
+ | * [[Core Function WinGetPos|WinGetPos ( <title>, <text> )]] -- Retrieves the position and size of a given window | ||
+ | * [[Core Function WinGetCaretPos|WinGetCaretPos ( )]] -- Returns the coordinates of the caret in the foreground window | ||
+ | * [[Core Function WinGetTitle|WinGetTitle ( <title>, <text> )]] -- Retrieves the full title from a window | ||
+ | * [[Core Function WinGetText|WinGetText ( <title>, <text> )]] -- Retrieves the text from a window | ||
+ | * [[Core Function WinGetState|WinGetState ( <title>, <text> )]] -- Retrieves the state of a given window | ||
+ | * [[Core Function WinGetProcess|WinGetProcess ( <title>, <text> )]] -- Retrieves the Process ID (PID) associated with a window | ||
+ | * [[Core Function WinGetClientSize|WinGetClientSize ( <title>, <text> )]] -- Retrieves the size of a given window's client area | ||
+ | * [[Core Function WinClose|WinClose ( <title>, <text> )]] -- Closes a window | ||
+ | * [[Core Function WinKill|WinKill ( <title>, <text> )]] -- Forces a window to close | ||
+ | * [[Core Function WinMove|WinMove ( <title>, <text>, <x>, <y>, <width>, <height>, <speed> )]] -- Moves and/or resizes a window | ||
+ | * [[Core Function WinWait|WinWait ( <title>, <text>, <timeout> )]] -- Waits until the requested window exists | ||
+ | * [[Core Function WinWaitActive|WinWaitActive ( <title>, <text>, <timeout> )]] -- Waits until the requested window is active | ||
+ | * [[Core Function WinWaitNotActive|WinWaitNotActive ( <title>, <text>, <timeout> )]] -- Waits until the requested window is not active | ||
+ | * [[Core Function WinWaitClose|WinWaitClose ( <title>, <text>, <timeout> )]] -- Waits until the requested window does not exist | ||
+ | * [[Core Function WinSetTitle|WinSetTitle ( <title>, <text>, <newtitle> )]] -- Changes the title of a window | ||
+ | * [[Core Function WinSetState|WinSetState ( <title>, <text>, <flag> )]] -- Shows, hides, minimizes, maximizes, or restores a window | ||
+ | * [[Core Function WinSetTrans|WinSetTrans ( <title>, <text>, <transparency> )]] -- Sets the transparency of a window | ||
+ | * [[Core Function WinMinimizeAll|WinMinimizeAll ( )]] -- Minimizes all windows | ||
+ | * [[Core Function WinMinimizeAllUndo|WinMinimizeAllUndo ( )]] -- Undoes a previous WinMinimizeAll function | ||
+ | * [[Core Function WinFlash|WinFlash ( <title>, <text>, <flashes>, <delay> )]] -- Flashes a window in the taskbar | ||
+ | * [[Core Function WinMenuSelectItem|WinMenuSelectItem( <title>, <text>, <item>, <subitems> ... )]] -- Invokes a menu item of a window | ||
+ | * [[Core Function WinList|WinList ( <title>, <text> )]] -- Retrieves a list of windows | ||
+ | |||
+ | ===== Controls ===== | ||
+ | (For info on using <title>, <text> See [[Window Titles and Text Advanced|Window Titles and Text (Advanced)]] ) | ||
+ | |||
+ | * [[Core Function ControlClick|ControlClick ( <title>, <text>, <controlID>, <button>, <clicks>, <x>, <y> )]] -- Sends a mouse click command to a given control | ||
+ | * [[Core Function ControlSend|ControlSend ( <title>, <text>, <controlID>, <string> <flag> )]] -- Sends a string of characters to a control | ||
+ | * [[Core Function ControlGetFocus|ControlGetFocus ( <title>, <text> )]] -- Returns the ControlRef# of the control that has keyboard focus within a specified window | ||
+ | * [[Core Function ControlGetPos|ControlGetPos ( <title>, <text>, <controlID> )]] -- Retrieves the position and size of a control relative to it's window | ||
+ | * [[Core Function ControlDisable|ControlDisable ( <title>, <text>, <controlID> )]] -- Disables a control | ||
+ | * [[Core Function ControlEnable|ControlEnable ( <title>, <text>, <controlID> )]] -- Enables a control | ||
+ | * [[Core Function ControlShow|ControlShow ( <title>, <text>, <controlID> )]] -- Shows a control that was hidden | ||
+ | * [[Core Function ControlHide|ControlHide ( <title>, <text>, <controlID> )]] -- Hides a control | ||
+ | * [[Core Function ControlGetText|ControlGetText ( <title>, <text>, <controlID> )]] -- Retrieves text from a control | ||
+ | * [[Core Function ControlSetText|ControlSetText ( <title>, <text>, <controlID>, <text> )]] -- Sets text of a control | ||
+ | * [[Core Function ControlMove|ControlMove ( <title>, <text>, <controlID>, <x>, <y>, <width>, <height>, <speed> )]] -- Moves a control within a window | ||
+ | * [[Core Function ControlGetHandle|ControlGetHandle ( <title>, <text>, <controlID> )]] -- Retrieves the internal handle of a control | ||
+ | * [[Core Function ControlFocus|ControlFocus ( <title>, <text>, <controlID> )]] -- Sets input focus to a given control on a window | ||
+ | |||
+ | ====== NOT AVAILABLE YET ====== | ||
+ | * [[Core Function ControlCommand|ControlCommand ( <title>, <text>, <controlID>, <command>, <option> )]] -- Sends a command to a control | ||
+ | |||
+ | ==== Graphics/Pixel Functions ==== | ||
+ | * [[Core Function PixelGetColour|PixelGetColour ( <x>, <y> )]] -- Returns a pixel colour according to x, y pixel coordinates | ||
+ | * [[Core Function PixelGetMouse|PixelGetMouse ( )]] -- Returns a pixel colour according to x, y position of the mouse pointer | ||
+ | * [[Core Function PixelSearch|PixelSearch ( <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 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 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 | ||
+ | |||
+ | ==== Sputnik Plugins (Using .NET DLLs) ==== | ||
+ | * [[Core Function Use|Use( <name/array>, <flag> )]] -- Load a Sputnik plugin | ||
+ | * [[Core Function Unuse|Unuse( <name> )]] -- ??? | ||
+ | |||
+ | ==== Control Flow Functions ==== | ||
+ | * [[Core Function Return|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 | ||
+ | * [[Core Function Throw|Throw( <expression> )]] -- Throw an exception | ||
+ | * [[Core Function Die|Die( <expression> )]] -- Gives an error and terminates the program | ||
+ | * [[Core Function Break|Break( <scopes> )]] -- Ends execution of the current loop | ||
+ | * [[Core Function Continue|Continue( <scopes> )]] -- Continue the execution of a loop at its next iteration | ||
+ | * [[Core Function Redo|Redo( )]] -- Continue the execution of a loop at the start of the current iteration | ||
+ | |||
+ | ==== Internal Class Management and Information ==== | ||
+ | * [[Core Function ClassExists|ClassExists( <expression> )]] -- Check if a given Class exists | ||
+ | * [[Core Function ClassList|ClassList( <expression>, <inherits> )]] -- Return an array of all user defined classes (Or just ones fitting a given pattern) | ||
+ | * [[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 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 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 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 ConvertClass|ConvertClass( <oldClass>, <name>, <wakeUp> )]] -- Create a new instance of a class by its name and copy the values from another class | ||
+ | * [[Core Function IsOverloaded|IsOverloaded( <class>, <overload> )]] -- Check if a given cast/operator overload exists within a class | ||
+ | |||
+ | ==== 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 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 CallArray|CallArray( <function/array>, <array>)]] -- Calls a function contained in a string parameter | ||
+ | |||
+ | ==== 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 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 EvalGet|EvalGet( <evalObject>, <name>, <value> )]] -- Get a from variable inside an Eval Object | ||
==== Misc Functions ==== | ==== Misc Functions ==== | ||
− | * [[Core Function | + | * [[Core Function Exit|Exit( <exitCode> )]] -- Instantly terminate the program/script |
− | * [[Core Function | + | * [[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 | + | * [[Core Function Warn|Warn( <message> )]] -- Show a warning message with source file name and line number |
− | * [[Core Function GC|GC( <flag> )]] -- Use the garbage collector | + | * [[Core Function Clone|Clone( <object> )]] -- Create a clone of a clone-able object |
− | * [[Core Function Require|Require( <file>, <flag> )]] -- Add all functions etc from a file for use | + | * [[Core Function LineInfo|LineInfo( )]] -- Get a vast amount of *behind the scene* information the current line of source code being executed |
− | * [[Core Function Include|Include( <file>, <flag> )]] -- Add all functions etc from a file for use and execute all expressions. | + | * [[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 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 Opt|Opt( <option>, <value> )]] -- Changes the operation of various Sputnik functions/parameters | ||
+ | * [[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 VarToObj|VarToObj( <variable> )]] -- Convert a $variable to its compatible object (such as .NET base object) | ||
=== User Defined Functions === | === User Defined Functions === |
Latest revision as of 07:54, 20 December 2015
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
- <Expression> =~ tr/searchList/replacementList/flags -- Translate characters from one character set to another similar to StrTr() function
- <Expression> =~ m/pattern/flags -- Match a string to a regular expression pattern and check if it matches and optionally return captured groups
- <Expression> =~ s/pattern/replacement/flags -- Replace parts of a string using a regular expression pattern and optionally executing functions on the matched groups
- Goto Label; & Label: -- Jump to another section of the script
- <Scope> List( <expressions>, .. ) = <array> -- Extract some elements from an array into ready to use variables
- $ptr[<index>]:<type> = <value> -- Read and Write to memory pointers similar to PTRRead() and PTRWrite() but using [] to simulate like it's an array
- Array Splicing -- Copy parts out of an array and return them as a new array
- Function Variables -- Dynamically create function source code and place it in a variable and call it from the variable
Parser Engine
- Parser Engine -- Parse text and have classes created and returned to you
- Parser( <grammar>, <tokenName>, <trimRules> ) -- Create a new parser
- Parse( <parser>, <text> ) -- Parse text with a parser created with Parser()
- IsToken( <object> ) -- Check if a given object is a token created from the parser
- TokenClass( <token> ) -- Get the class the token is linked to
Console Functions
- Echo( ) -- Alias for Print( )
- Say( ) -- Alias for Println( )
- 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 character at the end.
- Printf( <expression>, <expressions>... ) -- Print a formatted string (similar to the C printf() function)
- VPrintf( <expression>, <expressions>... ) -- Print a formatted string (similar to the C printf() function) using an array as the parameters
- PrintfC( <format control>, <params> ) -- Print a formatted string to the console window
- Input( <prompt> ) -- Capture a string typed to console window
- InputC( <prompt/flag> ) -- Capture a char (or info about the char) typed to console window
- Pause( <expression> ) -- Pause the execution of the script on the console window until any key is pressed
- Cls( ) -- Alias for ConsoleClear( )
- ConsoleClear( ) -- Clear all text from the console window
- ConsoleKeyAvailable( ) -- Check if there is a key ready to be read from the console
- ConsoleCapsLock( ) -- Check if caps lock is down on the console
- ConsoleSetCursor( <posX>, <posY> ) -- Set the cursor position on the console
- ConsoleSetBuffer( <width>, <height> ) -- Set the console text buffer size
- ConsoleSetSize( <width>, <height> ) -- Set the console window size
- ConsoleHide( ) -- Hide the console window
- ConsoleShow( ) -- Show the console window
- ConsoleState( ) -- Get the console state (Visible, Hidden)
- ConsoleBeep( <freq>, <duration> ) -- Plays the sound of a beep of a specified frequency and duration through the console speaker
- ConsoleSeek( <x>, <y> ) -- Set the position of the console cursor
- ConsoleBackColour( <colour> ) -- Set the background (behind text) colour of the console
- ConsoleForeColour( <colour> ) -- Set the foreground (text) colour of the console
- ConsoleBufferWidth( <newval> ) -- Get or Set the buffer width of the console window
- ConsoleBufferHeight( <newval> ) -- Get or Set the buffer height of the console window
- ConsoleWidth( <newval> ) -- Get or Set the width of the console window
- ConsoleHeight( <newval> ) -- Get or Set the height of the console window
- ConsoleTitle( <newtitle> ) -- Get or Set the title of the console window
- ConsoleCursorLeft( <newval> ) -- Gets or sets the column position of the cursor within the buffer area
- ConsoleCursorTop( <newval> ) -- Gets or sets the row position of the cursor within the buffer area
- ConsoleCursorSize( <newval> ) -- Gets or sets the height of the cursor within a character cell
- ConsoleCursorVisible( <newval> ) -- Gets or sets a value indicating whether the cursor is visible
- CGIConsole( ) -- Changes the console printing to work best a CGI instead of stand alone terminal
Multi-Threading Functions
- ThreadCreate( <name>, <function>, <extra> ) -- Create a new thread and start it off executing a function or some code
- ThreadSleep( <name> ) -- Freeze a thread and make it sleep
- ThreadResume( <name> ) -- Unfreeze a thread and allow it to continue execution
- ThreadState( <name> ) -- Returns state of a thread
- ThreadKill( <name> ) -- Terminate a thread and remove it from the script
- ThreadExists( <name> ) -- Check if a thread exists by this name
- ThreadName( ) -- Returns the name of the current thread that is executing this code
- ThreadLock( <lockname> ) {} -- Locks a given section of code allowing only one thread to execute it at a time
- Threads( ) -- Return an array of all threads
Variable Type Conversions
- Bool( <expression> ) -- Returns the TRUE(1) or FALSE(0) representation of an expression
- Char( <expression> ) -- Returns the single letter representation of an expression
- Byte( <expression> ) -- Returns the unsigned 8-bit integer (whole number) representation of an expression
- SByte( <expression> ) -- Returns the signed 8-bit integer (whole number) representation of an expression
- Short( <expression> ) -- Returns the signed 16-bit integer (whole number) representation of an expression
- Int16( <expression> ) -- Returns the signed 16-bit integer (whole number) representation of an expression
- Int32( <expression> ) -- Returns the signed 32-bit integer (whole number) representation of an expression
- Int( <expression> ) -- Returns the signed 32-bit integer (whole number) representation of an expression
- Int64( <expression> ) -- Returns the signed 64-bit integer (whole number) representation of an expression
- Long( <expression> ) -- Returns the signed 64-bit integer (whole number) representation of an expression
- UShort( <expression> ) -- Returns the unsigned 16-bit integer (whole number) representation of an expression
- UInt16( <expression> ) -- Returns the unsigned 16-bit integer (whole number) representation of an expression
- UInt32( <expression> ) -- Returns the unsigned 32-bit integer (whole number) representation of an expression
- UInt( <expression> ) -- Returns the unsigned 32-bit integer (whole number) representation of an expression
- UInt64( <expression> ) -- Returns the unsigned 64-bit integer (whole number) representation of an expression
- ULong( <expression> ) -- Returns the unsigned 64-bit integer (whole number) representation of an expression
- Ptr( <expression> ) -- Returns the signed pointer representation of an expression
- IntPtr( <expression> ) -- Returns the signed pointer representation of an expression
- UPtr( <expression> ) -- Returns the unsigned pointer representation of an expression
- UIntPtr( <expression> ) -- Returns the unsigned pointer 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
- Ascii( <expression> ) -- Returns the String (In raw ASCII) representation of an expression
- Binary( <expression> ) -- Returns the Binary (raw bytes) representation of an expression
Common Variable Functions
Misc
- IsSet( $variable ) -- Determine if a variable is set and is not NULL
- Unset( $variable ) -- Delete a variable
- Ref( $variable ) -- Retrieve the variable at the lowest depth in references that the current variable links to
- IsDeclared( <variable name>, <flag> ) -- Check if a variable has been declared
- Printr( $variable, <newline>, <flag> ) -- Prints all details about a variable in a way thats easy for humans to read it (Will print arrays etc)
- VarDump( $variable, <newline> ) -- Dumps information about a variable
- Assign( <varname>, <data>, <flag> ) -- Assigns a variable by name with the data
- Atof( <variable>, <count>, <start> ) -- Convert string to Double
- Atoi( <variable>, <count>, <start> ) -- Convert string to Int32
- Atol( <variable>, <count>, <start> ) -- Convert string to Int64
- StrTol( <variable>, <count>, <base>, <start> ) -- Convert string to Int64
- StrToul( <variable>, <count>, <base>, <start> ) -- Convert string to UInt64
- IsNan( <variable> ) -- Check if a floating pointer value is NaN (Not a number)
- IsInf( <variable> ) -- Check if a floating pointer value is Infinity
- IsPosInf( <variable> ) -- Check if a floating pointer value is Positive-Infinity
- IsNegInf( <variable> ) -- Check if a floating pointer value is Negative-Infinity
- IsNormal( <variable> ) -- Check if a floating pointer value is neither NaN, PosInf, NegInf or Inf
- SignBit( <variable> ) -- Returns whether the sign of a variable is negative
Type Checking
- 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)
- isVarChar( $variable ) -- Checks if a variable is a char type
- isVarBool( $variable ) -- Checks if a variable is a boolean type
- isVarByte( $variable ) -- Checks if a variable is an unsigned 8-bit integer type
- isVarSByte( $variable ) -- Checks if a variable is a signed 8-bit integer type
- isVarShort( $variable ) -- Checks if a variable is a signed 16-bit integer type
- isVarInt16( $variable ) -- Checks if a variable is a signed 16-bit integer type
- isVarInt( $variable ) -- Checks if a variable is a signed 32-bit integer type
- isVarInt32( $variable ) -- Checks if a variable is a signed 32-bit integer type
- isVarInt64( $variable ) -- Checks if a variable is a signed 64-bit integer type
- isVarLong( $variable ) -- Checks if a variable is a signed 64-bit integer type
- isVarUShort( $variable ) -- Checks if a variable is an unsigned 16-bit integer type
- isVarUInt16( $variable ) -- Checks if a variable is an unsigned 16-bit integer type
- isVarUInt( $variable ) -- Checks if a variable is an unsigned 32-bit integer type
- isVarUInt32( $variable ) -- Checks if a variable is an unsigned 32-bit integer type
- isVarUInt64( $variable ) -- Checks if a variable is an unsigned 64-bit integer type
- isVarULong( $variable ) -- Checks if a variable is an unsigned 64-bit integer type
- isVarFloat( $variable ) -- Checks if a variable is a single precision floating point type
- isVarFP( $variable ) -- Checks if a check if a variable type is only a float/double nothing else
- isVarDouble( $variable ) -- Checks if a variable is a double precision floating point type
- isVarPtr( $variable ) -- Checks if a variable is an signed pointer type
- isVarIntPtr( $variable ) -- Checks if a variable is an signed pointer type
- isVarUPtr( $variable ) -- Checks if a variable is an unsigned pointer type
- isVarUIntPtr( $variable ) -- Checks if a variable is an unsigned pointer type
- isVarString( $variable ) -- Checks if a variable is a string type
- isVarNumber( $variable ) -- Checks if a variable is any integer or float/double type
- isVarNull( $variable ) -- Checks if a variable is null
- isVarBinary( $variable ) -- Checks if a variable is a binary type
- isVarFunction( $variable ) -- Checks if a variable is a function type
- isVarRef( $variable ) -- Check if a variable is an reference to another variable
- isVarArray( $variable ) -- Check if a variable is an array
- isVarObj( $variable, <type> ) -- Check if a variable is an object type (This includes classes, file handles etc)
- isVarClass( $variable, <type>, <strict> ) -- Check if a variable's object type is a class
- isVarDLLStruct( $variable ) -- Check if a variable holds a DLLStruct
- isVarServer( $variable ) -- Check if a variable holds a Server object from Listen()
- isVarClient( $variable ) -- Check if a variable holds a Client object from Connect()
- isVarClientSocket( $variable ) -- Check if a variable holds a Client socket object
- isVarSocket( $variable ) -- Check if a variable holds a Socket object
- isVarSigned( $variable ) -- Check if a variable holds a signed integer
- isVarUnsigned( $variable ) -- Check if a variable holds an unsigned integer
Get Type Directly
- GetVarType( $variable ) -- Get the common type of a variable
- GetVarTypeName( $variable ) -- Get the common type of a variable (as a string)
- GetVarObjType( $variable ) -- Get the common object type of a variable (If it is an object)
- GetVarObjTypeName( $variable ) -- Get the common object type of a variable (If it is an object) and return it as string
Binary Data Management Functions
- Bin( <args> ) -- Create a new binary variable
- Op( <opCodes> ) -- Create a new binary variable from a string of opCodes such as "AA 10 20"
- BinaryCreate( <size>, <fill> ) -- Create a new binary variable and its array size and fill data type
- BinaryClone( <binary-array> ) -- Clone a binary variable 100% and return a new binary variable with exactly same data as the old one
- BinaryContains( <binary-array>, <needle>, <start>, <length> ) -- Check if a binary variable contains a given byte or contains another binary variable
- BinaryCRC32( <binary-array> ) -- Calculates the crc32 polynomial of a binary array
- BinaryWipe( <binary-array> ) -- Wipes a binary variables data 100% and sets the variable to a blank int containing null
- BinaryFill( <binary-array>, <fillWith>, <start>, <length> ) -- Fill a binary variables data (replace all of it or part of it) with a given byte or zero
- BinaryStr( <binary-array>, <separator> ) -- Create a Hex string from a binary array
- BinaryHex( <expression>, <flag> ) -- Create a binary array from a hex string
- BinaryLen( <binary-array>, <newLen> ) -- Returns the number of bytes in a binary variable (or increase it's capacity for bytes)
- BinaryGet( <binary-array>, <index> ) -- Get the byte at an index of a binary variable
- BinarySet( <binary-array>, <index>, <value> ) -- Set the byte at an index of a binary variable
- BinaryReverse( <binary-array>, <start>, <length> ) -- Reverse the order bytes a binary variable
- BinaryRemove( <binary-array>, <start>, <length> ) -- Remove bytes from a binary variable
- BinaryExpand( <binary-array> ) -- Expand the bytes of a binary variable into a string along with the text they match up to so you can convert binary into something human readable
- BinaryStartsWith( <binary-array>, <binary-array2> ) -- Check if this binary variable starts with a specific sequence of bytes
- BinaryEndsWith( <binary-array>, <binary-array2> ) -- Check if this binary variable ends with a specific sequence of bytes
- BinaryIndexOf( <binary-array>, <needle>, <start>, <length> ) -- Find the first occurrence of the needle
- BinaryIndexOfAny( <binary-array>, <needles>, <start>, <length> ) -- Find the first occurrence of any of the needles
- BinaryLastIndexOf( <binary-array>, <needle>, <start>, <length> ) -- Find the last occurrence of the needle
- BinaryLastIndexOfAny( <binary-array>, <needles>, <start>, <length> ) -- Find the last occurrence of any of the needles
- BinaryRandom( <binary-array>, <seed> ) -- Randomize all bytes in a binary variable
- BinaryReplace( <binary-array>, <needle>, <replacement>, <maxReplacements> ) -- Search for a byte or string of bytes in a binary variable and replace it
- BinaryHash( <binary-array> ) -- Gain a unique Hash of the bytes in this binary variable
- BinaryMid( <binary-array>, <start>, <length> ) -- Create a binary variable by extracting a number of bytes from another binary variable
- BinaryMidReplace( <binary-array>, <replacement>, <start>, <length> ) -- Replace a section (from start to length) of the binary with the replacement binary
- BinaryConcat( <destination/array>, <values> ) -- Mass append a ton of Binary variables in an extremely fast and efficient way
- BinaryJoin( <separator>, <values>, <start>, <count> ) -- Create a new Binary by joining together a ton of Binary variables in an extremely fast and efficient way
- BinaryAppend( <binary-array>, <binary-array2>, <flag> ) -- Append a binary variables data onto the end or beginning of another binary variables data
- BinaryInsert( <binary-array>, <binary-array2>, <index>, <overwrite> ) -- Insert a binary variables data into another binary variable at a specific location
- BinaryUnshift( <binary-array>, <byte> ) -- Add a byte to the beginning of a binary variable
- BinaryPush( <binary-array>, <byte> ) -- Add a byte to the end of a binary variable
- BinaryShift( <binary-array> ) -- Delete the first byte from a binary variable
- BinaryPop( <binary-array> ) -- Delete the last byte from a binary variable
- BinaryResize( <binary-array>, <size>, <data> ) -- Resize a binary variables data array
- BinaryPadLeft( <binary-array>, <padSize>, <padWith> ) -- Left pad a binary variable with a number of bytes or pad it to a total number of bytes
- BinaryPadRight( <binary-array>, <padSize>, <padWith> ) -- Right pad a binary variable with a number of bytes or pad it to a total number of bytes
- BinarySHA1( <binary-array> ) -- Returns the SHA1 hash of a binary variable
- BinaryFromStr( <string>, <flag> ) -- Returns a new binary variable created from a strings raw bytes
- BinaryToStr( <binary-array>, <flag>, <start>, <length> ) -- Returns a new string containing the binary data as raw bytes
- BinaryMD5( <binary-array> ) -- Returns the MD5 hash of a binary variable
- BinaryCompare( <binary-array>, <offset>, <needle, <needleOffset>, <length>, <ignoreCase> ) -- Compare two binary variables
- BinaryCompress( <binary-array> ) -- Compress a binary variables data
- BinaryUncompress( <binary-array> ) -- Uncompress a binary variable data
- BinaryToLower( <binary-array> ) -- Convert any ASCII characters to lowercase
- BinaryToUpper( <binary-array> ) -- Convert any ASCII characters to uppercase
- BinaryTrim( <binary-array>, <trimBytes> ) -- Trim any single-byte ASCII characters '\r', '\n', '\t', and ' ' (or provide your own) to the left or right
- BinaryTrimLeft( <binary-array>, <trimBytes> ) -- Trim any single-byte ASCII characters '\r', '\n', '\t', and ' ' (or provide your own) to the left
- BinaryTrimRight( <binary-array>, <trimBytes> ) -- Trim any single-byte ASCII characters '\r', '\n', '\t', and ' ' (or provide your own) to the right
- BinaryStripNull( <binary-array> ) -- Strip all NULL bytes (0x00) from a binary variable
- BinaryUUEncode( <binary-array> ) -- Encodes a binary variable using the uuencode algorithm
- BinaryUUDecode( <binary-array> ) -- Decodes a binary variable that was encode using the uuencode algorithm
- BinarySave( <binary-array>, <file>, <flag> ) -- Save a binary variable data to file
- BinaryLoad( <file>, <flag> ) -- Create a new binary variable by loading binary data from a file
Binary packer/unpacker
- Pack( <format>, <args> ) -- Pack data into a binary array
- Unpack( <format>, <data/binary-array>, <flag> ) -- Unpack data from a binary array
- PackSingle( <format>, <value> ) -- Pack a single value into a binary array
- UnpackSingle( <format>, <data/binary-array>, <position> ) -- Unpack a single value from a binary array optionally from a given index
Bit Vector
- Vec( <binary-array>, <offset>, <bits> ) -- Treats binary variable as a bit vector made up of elements of width bits and returns the value of the element specified by offset as an unsigned integer and optionally sets bits in the string to a given value
Bits
- SetBit( <binary-array>, <index>, <value> ) -- Set the bit at a given index
- GetBit( <binary-array>, <index> ) -- Get the bit at a given index
- InvertBit( <binary-array>, <index> ) -- Invert the bit at a given index
- ClearBit( <binary-array>, <index> ) -- Clear the bit at a given index
- FillBit( <binary-array>, <value> ) -- Set all bits to the value
BinHex 5.0
- BinHexEncode( <name>, <type>, <creator>, <resourceFork>, <dataFork>, <flag1>, <flag2> ) -- Encode data (usually a file) to BinHex 5.0 format
- BinHexDecode( <binhex-binary> ) -- Decode data (usually a file) from BinHex 5.0 format
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
- ByteBufferNew( <nothing/capacity/binary/byteBuffer> ) -- Make a new ByteBuffer
- ByteBufferGet( <byteBuffer>, <type>, <index> ) -- Get data from a ByteBuffer
- ByteBufferPut( <byteBuffer>, <type>, <variable> ) -- Add data to a ByteBuffer
- ByteBufferPeek( <byteBuffer>, <type> ) -- Peek at data from a ByteBuffer (same as get but without moving the position forward)
- 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)
- ByteBufferCapacity( <byteBuffer> ) -- Get the current capacity of a ByteBuffer
- ByteBufferRewind( <byteBuffer> ) -- Set the position of a ByteBuffer back to the start
- ByteBufferLimit( <byteBuffer> ) -- Get the current capacity/length that can be written (based on its currently allocated size) of a ByteBuffer
- ByteBufferPosition( <byteBuffer>, <newPosition> ) -- Get and set the position of a ByteBuffer to any value
- ByteBufferRemaining( <byteBuffer> ) -- Get how many bytes are possible to read from current position of a ByteBuffer
- ByteBufferHasRemaining( <byteBuffer> ) -- Check if its possible to read at least one byte from the ByteBuffer
- ByteBufferClear( <byteBuffer> ) -- Clear all data from a ByteBuffer (reset it back to new) also if the mark is defined then it is discarded
- 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
- ByteBufferMark( <byteBuffer> ) -- Mark the position in a ByteBuffer
- ByteBufferReset( <byteBuffer> ) -- Reset the position to the previously marked position in a ByteBuffer
- ByteBufferCompare( <byteBuffer>, <byteBuffer> ) -- Compare two ByteBuffers to see if they are equal
- ByteBufferClone( <byteBuffer> ) -- Clone a ByteBuffer
- 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.
- NBT( <value> ) -- Convert a variable into an accurate NBT representation of it
- NBTNew( <nbt-type>, <key>, <value> ) -- Create a new NBT of a given type and optionally give it a name and starting value
- NBTCompare( <nbt>, <nbt> ) -- Compare two NBT variables to see if they contain the same data
- NBTCopy( <nbt> ) -- Make a clone of an NBT
- NBTGetId( <nbt> ) -- Get the ID type of an NBT
- NBTGetName( <nbt> ) -- Get the name (tag key) of an NBT
- NBTGetName( <nbt>, <new-name> ) -- Set the name (tag key) of an NBT
- NBTHash( <nbt> ) -- Compute the CRC32 hash of an NBT
- NBTToString( <nbt> ) -- Return a string representation of an NBT
- NBTToVar( <nbt> ) -- Return the Sputnik variable representation of an NBT
- IsVarNBT( <value> ) -- Check if a variable is contains an NBT
NBTTagCompound
- NBTCompoundClear( <nbtCompound> ) -- Clear all tags
- NBTCompoundCount( <nbtCompound> ) -- Return the amount of tags
- NBTCompoundGet( <nbtCompound>, <tag> ) -- Get a tag by name
- NBTCompoundSet( <nbtCompound>, <tag>, <value> ) -- Set a tag by name
- NBTCompoundGetKeys( <nbtCompound> ) -- Get an array of all keys
- NBTCompoundGetTags( <nbtCompound> ) -- Get an array of all tags
- NBTCompoundGetMap( <nbtCompound> ) -- Get an associative array of all keys and tags
- NBTCompoundHasKey( <nbtCompound>, <tag> ) -- Check if a given tag exists by name
- NBTCompoundIsEmpty( <nbtCompound> ) -- Check if there are no tags
- NBTCompoundRemove( <nbtCompound>, <tag>, <value> ) -- Remove a specific tag by name
- NBTCompoundWrite( <nbtCompound>, <buffer> ) -- Write the NBTTagCompound to binary or a buffer
- NBTCompoundRead( <binary-variable/buffer> ) -- Create a new NBTTagCompound from a binary array or a buffer
- NBTCompoundWriteFile( <nbtCompound>, <file>, <compression> ) -- Write the NBTTagCompound to a file
- NBTCompoundReadFile( <file>, <compression> ) -- Create a new NBTTagCompound from reading a file
- NBTCompoundCompress( <nbtCompound> ) -- Compress the NBTTagCompound to binary
- NBTCompoundDecompress( <binary-variable> ) -- Decompress a NBTTagCompound from binary
- NBTCompoundWriteCompressed( <nbtCompound>, <buffer> ) -- Compress the NBTTagCompound and write it to a buffer
- NBTCompoundReadCompressed( <buffer> ) -- Decompress a NBTTagCompound from a buffer
NBTTagList/NBTTagListEx
- NBTListAppend( <nbtList>, <value> ) -- Add an NBT to the end of the list
- NBTListCount( <nbtList> ) -- Return how many tags exist in the list
- NBTListGet( <nbtList>, <index> ) -- Get a tag at the given index
- NBTListHasId( <nbtList>, <index> ) -- Check if an index is valid and contains a tag
- NBTListRemove( <nbtList>, <index> ) -- Remove the tag at the given index
Misc Binary Functions
- TB( <string> ) -- Convert a string of up to 4 chars into a 32-Bit unsigned number (network order)
- BT( <number> ) -- Convert a 32-Bit unsigned number (network order) into a string
Bit Flag Functions
- HasFlag( <enumInst>, <flag/flags> ) -- Check if a flag (or array of flags) is enabled in a given enum instance
- HasFlagAny( <enumInst>, <flags>... ) -- Check if any flag is enabled in a given enum instance
- SetFlag( <enumInst>, <flag/flags>, <state> ) -- Enable or Disable a flag (or array of flags) in a given enum instance
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
- ATan( <expression> ) -- Calculates the arctangent of a number
- ATan2( <expression>, <expression2> ) -- Compute arc tangent with two parameters
- Angle2D( <x1>, <y1>, <x2>, <y2> ) -- Calculates the angle of a line defined by two points on a 2D surface
- Barycentric( <value1>, <value2>, <value3>, <amount1>, <amount2> ) -- Returns the Cartesian coordinate for one axis of a point that is defined by a given triangle and two normalized barycentric (areal) coordinates
- CatmullRom( <value1>, <value2>, <value3>, <value4>, <amount> ) -- Performs a Catmull-Rom interpolation using the specified positions
- BaseConv( <number>, <frombase>, <tobase> ) -- Convert a number between arbitrary bases
- BitAND( <expression>, <expression2>, <n> ) -- Performs a bitwise AND operation
- BitNOT( <expression> ) -- Performs a bitwise NOT operation
- BitOR( <expression>, <expression2>, <n> ) -- Performs a bitwise OR operation
- BitSHIFT( <value>, <shift> ) -- Performs a bit shifting operation
- BitTripleSHIFT( <value>, <shift> ) -- Performs a triple bit shifting operation
- BitXOR( <expression>, <expression2>, <n> ) -- Performs a bitwise exclusive OR (XOR) operation
- BitROTATE( <expression>, <shift>, <size> ) -- Performs a bit shifting operation, with rotation
- BitSwap( <expression> ) -- Byte-swap (little-endian <-> big-endian)
- Ceiling( <expression> ) -- Returns a number rounded up to the next integer
- Clamp( <value>, <min>, <max> ) -- Clamps the specified value
- Cos( <expression> ) -- Calculates the cosine of a number
- Cosh( <expression> ) -- Returns the hyperbolic cosine of the specified angle
- DegreesToRadians( <value> ) -- Converts degrees to radians
- DegreesToRevolutions( <value> ) -- Converts degrees to revolutions
- 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
- Distance( <value1>, <value2> ) -- Calculates the absolute value of the difference of two values
- Distance2D( <x1>, <y1>, <x2>, <y2> ) -- Finds the distance between two points on a 2D surface
- Distance3D( <x1>, <y1>, <z1>, <x2>, <y2>, <z2> ) -- Finds the distance between two points on a 3D surface
- Exp( <expression> ) -- Returns e raised to the specified power
- Floor( <expression> ) -- Returns the largest integer less than or equal to the specified number
- frexp( <x> ) -- Returns m and e such that x = m2e, e is an integer and the absolute value of m is in the range [0.5, 1) (or zero when x is zero)
- Gauss( <amplitude>, <x>, <y>, <radX>, <radY>, <sigmaX>, <sigmaY> ) -- Get the result of the Gaussian function
- GradiansToRevolutions( <value> ) -- Converts gradians to revolutions
- GradiansToDegrees( <value> ) -- Converts gradians to degrees
- GradiansToRadians( <value> ) -- Converts gradians to radians
- Hermite( <value1>, <tangent1>, <value2>, <tangent2>, <amount> ) -- Performs a Hermite spline interpolation
- IsDivisible( <expression>, <divisor>, <flag> ) -- Check if an expression is divisible by a given divisor optionally comparing as double/int64
- IsOdd( <expression> ) -- Check if an expression is an odd number
- IsEven( <expression> ) -- Check if an expression is an even number
- IntToRom( <expression> ) -- Returns the roman numerical value of an integer
- ldexp( <m>, <n> ) -- Returns the value of m * 2^n
- Lerp( <from>, <to>, <amount> ) -- Interpolates between two values using a linear function by a given amount
- Log( <expression>, <newbase> ) -- Returns the logarithm of a specified number
- Log10( <expression> ) -- Returns the common (base-10) logarithm of a specified number
- Math( <expression> ) -- Parse a string containing mathematical equations
- Max( <expression>, <expression2> ) -- Find the greater number and return it
- Min( <expression>, <expression2> ) -- Find the lesser number and return it
- Mod( <expression>, <expression2> ) -- Performs the modulus operation
- Modf( <x>, <intpart> ) -- Breaks x into an integral and a fractional part
- Mod2PI( <value> ) -- Calculates the modulo 2*PI of the specified value
- MatlabMod( <expression>, <expression2> ) -- Performs the Matlab modulus operation
- OffsetCalc( <size>, <start>, <length> ) -- Calculate the START and LENGTH of an array index
- Pow( <expression>, <expression2> ) -- Returns a specified number raised to the specified power
- RadiansToDegrees( <value> ) -- Converts radians to degrees
- RadiansToRevolutions( <value> ) -- Converts radians to revolutions
- RadiansToGradians( <value> ) -- Converts radians to gradians
- Random( <minValue>, <maxValue>, <flag> ) -- Get a random number from the defined area
- RandomVar( <seed>, <flag>, <flag> ) -- Generator a random number
- RandomSeed( <flag>, <size> ) -- Generator a cryptographically strong random number for use as a seed
- RandomSeedSet( <seed> ) -- Set the seed of Sputniks random number generator
- RevolutionsToDegrees( <value> ) -- Converts revolutions to degrees.
- RevolutionsToRadians( <value> ) -- Converts revolutions to radians.
- RevolutionsToGradians( <value> ) -- Converts revolutions to gradians.
- Round( <expression>, <decimalplaces> ) -- Returns a number rounded to a specified number of decimal places
- RomToInt( <expression> ) -- Returns the integer value of a roman numerical sequence
- Sin( <expression> ) -- Returns the sine of the specified angle
- Sinh( <expression> ) -- Returns the hyperbolic sine of the specified angle
- SmoothStep( <value1>, <value2>, <amount> ) -- Interpolates between two values using a cubic equation
- Sqrt( <expression> ) -- Returns the square root of a specified number
- Sum( <expressions> ) -- Returns the sum of all the parameters
- Tan( <expression> ) -- Returns the tangent of the specified angle
- Tanh( <expression> ) -- Returns the hyperbolic tangent of the specified angle
- Truncate( <expression> ) -- Calculates the integral part of a specified decimal number
- WithinEpsilson( <value1>, <value2>, <epsilon> ) -- Checks if value1 - value2 are almost equals within a float epsilon.
- Wrap( <value>, <min>, <max> ) -- Wraps the specified value into a range
- WrapAngle( <value> ) -- Reduces a given angle to a value between π and -π.
- IsPrime( <expression> ) -- Check if a number is a Prime number
String Functions
- AddCSlashes( <str>, <charlist> ) -- Escape a string with slashes in a C style
- AddBR( <str> ) -- Add HTML breaks to strings at newlines
- Asc( <char> ) -- Returns the ASCII code of a character
- AscW( <char> ) -- Returns the UNICODE code of a character
- AscArray( <char> ) -- Returns an array of ASCII characters of a string
- AscWArray( <char> ) -- Returns an array of UNICODE characters of a string
- Between( <haystack>, <firstneedle>, <secondneedle>, <case> ) -- Return the text between a start and end substring
- BCrypt( <expression>, <rounds> ) -- Hash a string (usually password) with BCrypt.
- BCryptVerify( <expression>, <hash> ) -- Verify a hash to a string (usually password) with BCrypt.
- CSetMatch( <expression>, <charset>, <case> ) -- Check if a string contains only characters from a substring(charset)
- CSetDel( <expression>, <charset>, <case> ) -- Delete all characters found in the charset from a string
- ChunkSplit( <body>, <chunklen>, <end> ) -- Split a string into smaller chunks
- Chop( <variable> ) -- Removes and returns the last character from a string
- Chomp( <variable> ) -- Removes trailing newlines and returns the number of characters removed
- CountChars( <string> ) -- Return information about characters used in a string
- CountWords( <string>, <format>, <charlist>, <outputArray> ) -- Return information about words used in a string
- Chr( <expression> ) -- Returns a character corresponding to an ASCII code
- ChrW( <expression> ) -- Returns a character corresponding to an UNICODE code
- ChrArray( <expression> ) -- Returns a string corresponding to an array ASCII codes
- ChrWArray( <expression> ) -- Returns a string corresponding to an array UNICODE codes
- CRC32( <string> ) -- Calculates the crc32 polynomial of a string
- Crypt( <string>, <salt> ) -- One-way string hashing
- Contains( <srting>, <string>, <casesense>) -- Check if string contains a sub string
- ContainsAny( <srting>, <array>, <casesense>) -- Check if string contains any of the given strings from an array
- CountFields( <string>, <delim>, <quote>, <quoteescape>, <comment>, <trimtype> ) -- Returns the number of values (fields) in the string passed that are separated by the separator string passed
- CSV( <string>, <delim>, <quote>, <quoteescape>, <comment>, <trimtype> ) -- Split strings and parse a CSV text into an array
- DecOct( <expression> ) -- Decimal to octal
- Dec( <expression> ) -- Returns a integer representation of a hexadecimal string
- FDec( <expression> ) -- Returns a float representation of a hexadecimal string
- DDec( <expression> ) -- Returns a double representation of a hexadecimal string
- DecPad( <expression>, <count> ) -- Pads numeric string to a given number of chars (Filling in the gap with zeros)
- DecryptString( <expression>, <password> ) -- Decrypt a string with a given password
- Decode64( <expression>, <strict> ) -- Decodes string with MIME base64
- Encode64( <expression> ) -- Encodes string with MIME base64
- Escape( <expression>, <custom> ) -- Add escapes to a string
- EscapeMeta( <expression>, <custom> ) -- Add escapes to meta characters
- EscapeShellArg( <arg> ) -- Escape a string to be used as a shell argument
- EscapeShellCmd( <command> ) -- Escape shell metacharacters
- EncryptString( <expression>, <password> ) -- Encrypt a string with a given password
- EndsWith( <expression>, <expression2>, <flag> ) -- Check if a string ends with a substring
- Hash( <expression> ) -- Generate a unique hash code for a string value
- Hebrev( <hebrew_text>, <max_chars_per_line> ) -- Convert logical Hebrew text to visual text
- Hebrevc( <hebrew_text>, <max_chars_per_line> ) -- Convert logical Hebrew text to visual text with newline conversion
- Hex2Str( <expression>, <flag> ) -- Convert a hex string back to a normal string
- Hex( <expression>, <length> ) -- Returns a string representation of an integer type converted to hexadecimal
- HTMLTranslationTable( <the_table>, <flags>, <encoding> ) -- Returns the translation table used by HTMLSpecialChars() and HTMLEntities()
- HTMLEntities( <string>, <flags>, <encoding>, <double_encode> ) -- Convert all applicable characters to HTML entities
- HTMLEntityDecode( <string>, <flags>, <encoding>, <double_encode> ) -- Convert all HTML entities to their applicable characters
- HTMLSpecialChars( <string>, <flags>, <encoding>, <double_encode> ) -- Convert special characters to HTML entities
- HTMLSpecialCharsDecode( <string>, <flags> ) -- Convert special HTML entities back to characters
- HTTPMakeQuery( <array> ) -- Converts an array into a properly formatted HTTP query string for use with requests etc
- HTTPParseQuery( <string> ) -- Parse an HTTP query string into an array
- Fmt( <format control>, <params> ) -- Create a formatted string
- FmtNumber( <number>, <decimals>, <dec_point>, <thousands_sep> ) -- Format a number with grouped thousands
- FHex( <expression> ) -- Returns a string representation of an float type converted to hexadecimal
- DHex( <expression> ) -- Returns a string representation of an double type converted to hexadecimal
- Find( <string>, <pattern>, <offset>, <plain> ) -- Search for a match in a string and return the match with its found position and length
- GMatch( <string>, <pattern>, <asKeypair>, <offset> ) -- Extract the patterns from a string and return as array or associative array
- 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)
- InStr( <string>, <substirng>, <ignoreCase>, <occurrence>, <start> ) -- Checks if a string contains a given substring
- InStrRev( <string>, <substirng>, <ignoreCase>, <occurrence>, <start> ) -- Same as InStr() but searches from right to left instead of left to right
- isAlpha( <expression> ) -- Checks if string contains only Alphabetic characters
- isAlphaNumeric( <expression> ) -- Checks if string contains only AlphaNumeric(A-Z, 0-9), Characters
- isASCII( <expression> ) -- Check if string contains only ASCII chars
- isControl( <expression> ) -- Check if string contains only control chars
- isEmpty( <expression> ) -- Checks if a string is completely empty
- isEmptyOrNull( <expression> ) -- Checks if a string is completely empty or if the variable is null or if the variable translates to false (zero)
- IsGraph( <expression> ) -- Checks if a string is completely only characters that have a graphical representation
- isDigit( <expression> ) -- Checks if string only contains numbers
- isFloat( <expression> ) -- Check if string contains a floating point and could be converted
- isLower( <expression> ) -- Checks if string contains only lowercase letters
- isNumeric( <expression> ) -- Checks if string only contains numbers (Allows for float/double)
- isSpace( <expression> ) -- Check if string contains only whitespace
- isSymbol( <expression> ) -- Check if string contains only symbol chars
- IsPunctuation( <expression> ) -- Check if string contains only characters categorized as a punctuation marks
- IsSeparator( <expression> ) -- Check if string contains only characters categorized as a separator character
- IsBlank( <expression> ) -- Check if string contains only spaces and tabs
- isString( <expression> ) -- Check if variable contains only string chars
- isUpper( <expression> ) -- Check if string contains only uppercase chars
- isXDigit( <expression> ) -- Check if string contains only hex chars
- IndexOf( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the first occurrence of the specified string in a string
- IndexOfAny( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the first occurrence of any characters or array of strings in a specified string
- IndexNotOf( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the first none occurrence of the specified string in the current string
- IndexNotOfAny( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the first none occurrence of any characters or array of strings in a specified string
- LastIndexOf( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the last occurrence of the specified string in the current string
- LastIndexOfAny( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the last occurrence of any characters or array of strings in a specified string
- LastIndexNotOf( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the last none occurrence of the specified string in the current string
- LastIndexNotOfAny( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the last none occurrence of any characters or array of strings in a specified string
- JsonEncode( <value>, <options> ) -- Returns the JSON representation of a value
- JsonDecode( <value>, <options> ) -- Decodes a JSON string
- Levenshtein( <str1>, <str2>, <cost_ins>, <cost_rep>, <cost_de> ) -- Calculate Levenshtein distance between two strings
- LC( <expression> ) -- Returns string in all lower case
- LCFirst( <expression> ) -- Lower Cases first letter of string
- LCLast( <expression> ) -- Lower Cases last letter of string
- LCWords( <expression> ) -- Lower Cases first letter of each word in string
- Left( <expression>, <count> ) -- Returns a number of characters from the left-hand side of a string
- Lines( <expression> ) -- Returns an array containing all the lines from a string
- Match( <string>, <pattern>, <offset> ) -- Search for the first match of pattern in a string if found return the captures from the pattern
- Metaphone( <string>, <phonemes> ) -- Calculate the metaphone key of a string
- MD5( <expression> ) -- Creates MD5 Hash of specified string
- NthField( <string>, <delim>, <index>, <quote>, <quoteescape>, <comment>, <trimtype> ) -- Returns a field from a row of data (such as comma separated text)
- Ord( <char> ) -- Returns the ASCII code of a character
- OrdW( <char> ) -- Returns the UNICODE code of a character
- Oct( <string> ) -- Converts an octal string into the numerical corresponding value
- PadLeft( <expression>, <pad>, <count> ) -- Pad the left of a string a given number of times with another string
- PadRight( <expression>, <pad>, <count> ) -- Pad the right of a string a given number of times with another string
- PrintableEncode( <string ) -- Convert a quoted-printable string to an 8 bit string
- PrintableDecode( <string ) -- Convert a 8 bit string to a quoted-printable string
- RandStr( <count>, <allowEscapes>, <allowVariables>, <allowCode> ) -- Generate a random sequence of characters at a given length
- RegexMatch( <expression>, <pattern>, <matches>, <offset> ) -- Perform a regular expression match
- RegexReplace( <expression>, <pattern>, <replacement>, <limit>, <count>, <offset> ) -- Perform a regular expression search and replace
- RegexEscape( <expression>, <delimiter> ) -- Escape regular expression characters
- RegexUnescape( <expression> ) -- Remove any escapes regular expression characters
- ResolveStr( <expression>, <allowEscapes>, <allowVariables>, <allowCode> ) -- Treat a given string as if it was a Sputnik "string" and parse all stuff inside it such as $variables etc
- Repeat( <expression>, <count>, <flag> ) -- Create a new string or new array containing repeats of a string provided
- Replace( <expression>, <find>, <replace>, <case-sensitive-flag> ) -- Replace substrings within a string with other strings
- Reverse( <expression> ) -- Reverse all characters in a string
- RevHex( <expression> ) -- Reverse a string of hex digits
- Right( <expression>, <count> ) -- Returns a number of characters from the right-hand side of a string
- Rot13( <str> ) -- Perform the rot13 transform on a string
- Scanf( <expression>, <def> ) -- Parses input from a string according to a format
- SHA1( <expression> ) -- Returns SHA1 hash of string
- Serialize( <variable> ) -- Convert a variable, array, class etc a string you can save to file or transfer over the internet
- SimilarText( <first>, <second>, <percent> ) -- Calculates the similarity between two input strings and return a percentage of the matching between the two input strings
- Split( <expression>, <delim/pattern>, <flag> ) -- Splits up a string into substrings depending on the given delimiters.
- SPrintf( <format control>, <params>... ) -- Returns a formatted string (similar to the C sprintf() function)
- StartsWith( <expression>, <expression2>, <flag> ) -- Check if a string starts with a substring
- StrChr( <haystack>, <char>, <start>, <count> ) -- Locate first occurrence of character in string
- StrrChr( <haystack>, <char>, <start>, <count> ) -- Locate last occurrence of character in string
- StrShuffle( <str> ) -- Randomly shuffles a string
- Strpbrk( <haystack>, <needle>, <start>, <count> ) -- Locate a list of possible characters in string and return the position of it
- StripCSlashes( <str> ) -- Unescape string escaped with AddCSlashes()
- StripTags( <str>, <allowable_tags> ) -- Strip HTML tags from a string
- StripWS( <str>, <flags>, <charList> ) -- Strips the white space in a string or given characters.
- StrSpn( <subject>, <mask>, <start>, <length> ) -- Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask
- StrCSpn( <subject>, <mask>, <start>, <length> ) -- Find length of initial segment not matching mask
- StrCmp( <str1>, <str2>, <ignoreCase>, <start>, <length> ) -- String comparison
- StrNatCmp( <str1>, <str2>, <ignoreCase> ) -- String comparisons using a "natural order" algorithm
- StrVersCmp( <str1>, <str2>, <ignoreCase> ) -- String comparison holding name and indices/version numbers
- Soundex( <str> ) -- Calculate the soundex key of a string
- Str2Hex( <expression>, <flag> ) -- Convert a string to a hex string
- StrNew( <char>, <length>, <flag> -- Create a new string of a given length filled with a given char
- StrInsert( <expression>, <index>, <expression2> ) -- Insert a string at a given index of another string and return the new string
- StrIndex( <expression>, <index>, <value> ) -- Get or set a char from/to a string at a specific index
- StrIncrement( <str> ) -- Increment a string the same way as doing ++ on a string like $a++
- StrPos( <haystack>, <needle>, <flags>, <start>, <length> ) -- Find the position of the first/last occurrence of a substring in a string
- StrTr( <str>, <from-to/replace_pairs> ) -- Translate characters or replace substrings
- StrTok( <str/token>, <token> ) -- Tokenize string
- StrStr( <haystack>, <needle>, <before_needle>, <find_last>, <case>, <start>, <length> ) -- Find the first/last occurrence of a string
- StrLen( <expression> ) -- Returns length of specified string
- SubStr( <expression>, <start>, <count>, <replacement> ) -- Return part of a string or replace it
- SubStrCount( <expression>, <expression2>, <offset>, <length>, <flag> ) -- Count the number of substring occurrences
- SubStrCmp( <main_str>, <str>, <offset>, <length>, <ignoreCase> ) -- Comparison of two strings from an offset, up to length characters
- SubStrReplace( <expression>, <replacement>, <start>, <length> ) -- Replace text within a portion of a string
- Sub( <expression>, <start>, <end>, <replacement> ) -- Return part of a string or replace it
- StrSplit( <expression>, <split_length>, <flag> ) -- Convert a string to an array
- StrCompress( <expression> ) -- Compress a string
- StrUncompress( <expression> ) -- Uncompress a string
- Trim( <expression>, <chars> ) -- Removes whitespace from the beginning and end of a string
- TrimLeft( <expression>, <chars> ) -- Strip whitespace from the start of a string
- TrimRight( <expression>, <chars> ) -- Strip whitespace from the end of a string
- TrimToNull( <string> ) -- Strip all zero chars (nulls) from the end of a string
- UC( <expression> ) -- Returns string in all Upper Case
- UCFirst( <expression> ) -- Upper Cases first letter of string
- UCLast( <expression> ) -- Upper Cases last letter of string
- UCWords( <expression> ) -- Upper Cases first letter of each word in string
- UUEncode( <expression> ) -- Encodes a string using the uuencode algorithm
- UUDecode( <expression> ) -- Decodes a string that was encode using the uuencode algorithm
- Unescape( <expression>, <custom> ) -- Remove all escapes from a string
- Unserialize( <string> ) -- Convert a string (Created with Serialize()) into its original variable/class/array etc
- 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
- 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
- VSPrintf( <format control>, <params>... ) -- Returns a formatted string (similar to the C sprintf() function) but accepts arrays as the arguments
- WordWrap( <str>, <width>, <break>, <cut> ) -- Wraps a string to a given number of characters
Array Functions
- 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
- ArrayScope( <array>, <scope> ) -- Get or Set an arrays internal Sputnik scope (Only to be used by Sputnik library developers)
- 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)
- 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)
- 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)
- 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
- Array( <expressions> ) -- Create a new array
- Clear( <array>, <flag> ) -- Remove all items from an array
- Join( <array>, <separator> ) -- Join an array into a string with an optional separator
- JoinKV( <array>, <separator> ) -- Join an array (as keys and values) into a string with an optional separator
- Count( <array/binary-array/class> ) -- Returns the size of array (How many elements it currently has stored)
- Fill( <start>, <num>, <value> ) -- Fill an array with values
- FillKeys( <keys>, <value> ) -- Fill an array with values, specifying keys
- UBound( <array/binary-array> ) -- Returns the index of the highest element in an array
- LBound( <array/binary-array> ) -- Returns the index of the lowest element in an array
- Push( <array>, <expressions> ) -- Add items to the end of an array
- PushArray( <array>, <expressions> ) -- Add arrays to the end of an array
- Insert( <array>, <id>, <expressions> ) -- Add items to an array at a given location
- InsertArray( <array>, <id>, <arrays> ) -- Add arrays to an array at a given location
- Pad( <array>, <size>, <value> ) -- Pad array to the specified length with a value
- Unshift( <array>, <expressions> ) -- Add items to the beginning of an array
- UnshiftArray( <array>, <expressions> ) -- Add arrays to the beginning of an array
- Pop( <array> ) -- Delete the last item in an array
- Shift( <array> ) -- Delete the first item in an array
- Range( <start>, <end>, <step> ) -- Create an array containing a range of elements
- Remove( <array>, <start-id>, <end-id> ) -- Delete items from an array starting at a given location and stopping at a given location
- RemoveValue( <array>, <needle>, <useStrict>, <removeAll>, <recursive>, <returnCopy> ) -- Remove a specific value or all matching values from an array
- RemoveValues( <array>, <needles>, <useStrict>, <removeAll>, <recursive>, <returnCopy> ) -- Remove an array of specific values from an array
- RemoveKey( <array>, <key>, <returnCopy> ) -- Remove a specific key from an array
- RemoveKeys( <array>, <keys>, <returnCopy> ) -- Remove an array of keys from an recursively from an array
- IsIndexSet( <array>, <index> ) -- Check if an element exist at a given index ID within an array
- Grep( <array>, <pattern>, <flag> ) -- Returns a new array consisting of the elements of the input arrays values that match the given regex pattern
- GrepKeys( <array>, <pattern>, <flag> ) -- Returns a new array consisting of the elements of the input arrays keys that match the given regex pattern
- Search( <array>, <value>, <flag>, <invert_flag>, <returnKeys> ) -- Returns a new array consisting of the elements of the input array that match the given value
- Combine( <array-keys>, <array-values> ) -- Creates a hash (Dictionary) by using the values from the keys array as keys and the values from the values array as the corresponding values
- Walk( <array>, <function> ) -- Walk through the arrays items and execute a user defined function on each one
- Rev( <array> ) -- Returns a new array consisting of the reverse of another array
- IsKeySet( <array>, <key> ) -- Check if given key exists within an array
- IsKeysSet( <array>, <keys>, <flag> ) -- Check if any/all/none of a given key from a key array was found inside an array
- Keys( <array>, <flag> ) -- Create an array containing all KEYS from an array
- Values( <array>, <flag> ) -- Create an array containing all VALUES from an array
- InArray( <array>, <needle>, <strict>, <flag> ) -- Checks if a value exists in an array
- Flip( <array> ) -- Exchanges all keys with their associated values in an array
- Splice( <array>, <offset>, <length>, <replace_with> ) -- Cut out and return a chunk or portion of an array and optionally replace the cut out section with new data.
- Order( <array>, <flag> ) -- Fix the order of numeric array elements from 0 to whatever.
- Sort( <array>, <flag>, <function> ) -- Sort an array by value or keys optionally modify it in place or return new and optionally use a custom function to decide how to sort it
- CountValues( <array> ) -- Counts all the values of an array
- SumKeys( <array> ) -- Counts the sum total of all the keys of an array
- SumValues( <array> ) -- Counts the sum total of all the values of an array
- IndexOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks if a value exists in an array and returns its index value
- IndexOfValueAny( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks if a value (from an array) exists in an array and returns its index value
- IndexNotOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks for the non-occurrence of a value in an array and returns the first index that does not contain the value
- IndexNotOfValueAny( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks for the non-occurrence of a value (from an array) in an array and returns the first index that does not contain any of the values
- LastIndexOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks if a value exists in an array and returns the index of the last occurrence of the value
- LastIndexOfValueAny( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks if a value (from an array of values) exists in an array and returns the index of the last occurrence of the value (from the value array)
- LastIndexNotOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks for the non-occurrence of a value in an array and returns the last index that does not contain the value
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.
- All( <array>, <query> ) -- Check of all elements in the query are a true match
- Any( <array>, <query> ) -- Check of any of the elements in the query are a true match
- Concat( <array>, <array>... ) -- Join multiple arrays (query results?) together
- First( <array>, <query> ) -- Return the first matching element from the query
- FirstOrDefault( <array>, <query>, <default> ) -- Return the first matching element from the query or return the default variable given
- Last( <array>, <query> ) -- Return the last matching element from the query
- LastOrDefault( <array>, <query>, <default> ) -- Return the last matching element from the query or return the default variable given
- Where( <array>, <query> ) -- Filters an array based on a query and returns all matching
- WhereNot( <array>, <query> ) -- Filters an array based on a query and all non matching
- SumInt( <array>, <query> ) -- Adds up all matching elements from the query and returns it as an Int64
- SumUInt( <array>, <query> ) -- Adds up all matching elements from the query and returns it as a UInt64
- SumDouble( <array>, <query> ) -- Adds up all matching elements from the query and returns it as a Double
- 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
- Enumerate( <enum> ) -- Cycle through all Name + Values in an enum
- EnumKey( <enum>, <value> ) -- Return the string KEY for a given integer value
- EnumValue( <enum>, <value> ) -- Return the integer value for a given string KEY
- EnumAdd( <enum>, <key>, <value> ) -- Add a new key and value to an existing enum
- EnumDel( <enum>, <key> ) -- Delete a key and value from an existing enum
- EnumIsDefined( <enum>, <value> ) -- Check if a given value exists within an enum
Process Functions
- DLLCall( <Dll/DLLName>, <FunctionName/Alias>, <ReturnType>, <ParameterType>, <CharSet/CallingConvention>, <Parms> ) -- Dynamically call a function in a DLL
- DLLOpen( <DLLName>, <FunctionName/Alias>, <ReturnType>, <ParameterType>, <CharSet/CallingConvention> ) -- Open a DLL and get a function from it and return it as a ready to call object function that is already compiled (vastly speeding up the repeat call speed)
- DLLClose( <DLL> ) -- Close and unset a return value from DLLOpen()
- DLLImport( <varies...> ) -- Dynamically load a function from a DLL and transform it to act and behave like a normal Sputnik function (Can load thousands functions at a time and even save the loaded stuff to DLL for quick access later)
- Exec( <command>, <output>, <return_var> ) -- Execute an external program
- ExecShell( <command> ) -- Execute command via shell and return the complete output as a string
- ExecSystem( <command>, <return_var> ) -- Execute an external program and display the output
- Passthru( <command>, <return_var> ) -- Execute an external program and display raw output
- System( <expression> ) -- Execute system command
- Run( <file>, <arguments>, <workdir>, <flag>, <show options> ) -- Runs an external program
- RunWait( <file>, <timeout>, <arguments>, <workdir>, <flag>, <show options> ) -- Runs an external program and waits until the program finishes
- RunShell( <file>, <arguments>, <workdir>, <flag>, <show options> ) -- Runs an external program (Using ShellExecute)
- RunShellWait( <file>, <timeout>, <arguments>, <workdir>, <flag>, <show options> ) -- Runs an external program (Using ShellExecute) and waits until the program finishes
- RunAsSet( <user>, <domain>, <password>, <options> ) -- Initialise a set of user credentials to use during Run and RunWait operations.
- RunCapture( <file>, <arguments>, <workdir>, <flag>, <function> ) -- Run a program in a hidden window and capture its printed output as strings
- PHandle( ) -- Get the process handle of this program
- ProcessClose( <pid/name> ) -- Terminates a named process
- ProcessID( <name> ) -- Gets the process ID of a given name
- ProcessExists( <pid/name> ) -- Checks to see if a specified process exists
- ProcessList( <name> ) -- Returns an array listing the currently running processes (names and PIDs)
- ProcessSetPriority( <pid/name>, <priority> ) -- Changes the priority of a process
- ProcessWait( <pid/name>, <timeout> ) -- Pauses the current thread until a given process exists or optional the timeout expires
- ProcessWaitClose( <pid/name>, <timeout> ) -- Pauses the current thread until a given process no longer exists or optional the timeout expires
- Shutdown( <shutdown code> ) -- Shuts down the system
- Debug( <flag> ) -- Enter or leave debug mode in debug state the program can interact with operating system processes that run in a special mode by enabling the native property SeDebugPrivilege on the current thread
Environment Management
- EnvExpand( <expression> ) -- Convert a string containing %name% env tags and return complete string with names resolved
- EnvGet( <tag> ) -- Get the value of an environment variable
- EnvSet( <tag>, <expression> ) -- Set the value of an environment variable
- EnvUpdate( ) -- Refreshes the OS environment
File Functions
File Create/Read/Write Functions
- FileOpen( <FileName>, <flag> ) -- Opens a file for reading or writing
- FileOpenText( <FileName> ) -- Opens a file for reading only (text files only)
- FileClose( <file> ) -- Closes a previously opened file
- FileWrite( <file>, <expression>, <useAscii> ) -- Write text to previously opened file at the current File Steam pointer location
- FileWriteBinary( <file>, <binary-array> ) -- Write the data from a binary variable to previously opened file at the current File Steam pointer location
- FileWriteLines( <file>, <array>, <lineBreak>, <useAscii> ) -- Write an array of lines to previously opened file at the current File Steam pointer location
- FileAppend( <file>, <expression>, <useAscii> ) -- Append a line of text to the end of a previously opened text file
- FileAppendBinary( <file>, <binary-array> ) -- Append the data from a binary variable to the end of a previously opened file
- FileAppendLines( <file>, <array>, <lineBreak>, <useAscii> ) -- Append an array of lines to the end of previously opened 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 bytes from a text file starting from current File Steam pointer location and return them as a string
- FileReadBinary( <file>, <expression> ) -- Read a number of bytes from a 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)
- FileReadText( <file>, <format>, <length> ) -- Read text from a file opened by FileOpenText() using the format and length params
- FileTemp( ) -- Create a uniquely named, zero-byte temporary file on disk and returns the full path of it
- FileSave( <file>, <expression>, <useAscii> ) -- Save all text to a file
- FileLoad( <file> ) -- Load all text from a file
Misc
- FileMove( <file1>, <file2>, <flag> ) -- Move a file
- FileCopy( <file1>, <file2>, <flag> ) -- Copy a file
- FileDelete( <file> ) -- Delete a file
- FileExists( <file> ) -- Check if a given file exists
- FileCreationTime( <file>, <flag> ) -- Get the creation time of a file
- FileWriteTime( <file>, <flag> ) -- Get the last write time of a file
- FileAccessTime( <file>, <flag> ) -- Get the last access time of a file
- FileEncrypt( <file> ) -- Encrypt a file so only the windows account used to encrypt it can decrypt it
- FileDecrypt( <file> ) -- Decrypt a file previously encrypted by this windows user account
- FileMD5( <file> ) -- Calculate the MD5 checksum of a file
- FileSHA1( <file> ) -- Calculate the SHA1 checksum of a file
- FileSize( <file>, <flag> ) -- Returns the file size in bytes (or return the formatted size)
- FileIsText( <file>, <length> ) -- Returns true if the file contains only text
- FileRecycleEmpty( <root> ) -- Empty the recycle bin with no GUI, sound or confirmation
- FileRecycle( <filename> ) -- Move a file or directory to the recycle bin
- FileMatch( <pattern>, <string>, <flags> ) -- Match filename against a Glob pattern
Dialogs
- FileSaveDialog ( <title>, <dir>, <filter>, <options>, <default name> ) -- Initiates a Save File Dialog
- FileOpenDialog ( <title>, <dir>, <filter>, <options>, <default name> ) -- Initiates a Load File Dialog
Directory Functions
- GetFiles ( <path>, <pattern> ) -- Get an array of all files in a directory
- GetFolders ( <path>, <pattern> ) -- Get an array of all folders in a directory
- Glob( <pattern>, <flags> ) -- Find files/folders matching a pattern
- MKDir ( <path> ) -- Creates all directories and subdirectories as specified by path
- RMDir ( <path>, <flag> ) -- Deletes the specified directory and, if indicated, any subdirectories in the directory
- DirExists ( <path> ) -- Determines whether the given path refers to an existing directory on disk
- DirCopy ( <sourcepath>, <destpath> ) -- Copies a directory and all sub-directories and files (Similar to xcopy)
- DirMove( <sourcepath>, <destpath> ) -- Moves a directory to another location
- DirSize( <path> ) -- Returns the size in bytes of a whole directory
- CurDir ( <path> ) -- Get or Set the current working directory
- CombinePath( <path1>, <path2> ) -- Safe way to combine two paths into one
- GetRelativePath( <Path1>, <path2> ) -- Try makes a path relative to another
Dialogs
- FolderSelectDialog ( <text>, <dir>, <flag>, <init dir> ) -- Initiates a Browse For Folder Dialog
Path Functions
- ParsePath ( <path> ) -- Resolve a file name and locate its full path
- HasExtension ( <path> ) -- Determines whether a path includes a file name extension
- GetFullPath ( <path> ) -- Returns the absolute path for the specified path string
- GetDirectoryName ( <path> ) -- Returns the directory information for the specified path string
- GetExtension ( <path> ) -- Returns the extension of the specified path string
- GetFileName ( <path> ) -- Returns the file name and extension of the specified path string
- GetFileNameWithoutExtension ( <path> ) -- Returns the file name of the specified path string without the extension
- GetPathRoot ( <path> ) -- Gets the root directory information of the specified path
- IsPathRooted ( <path> ) -- Gets a value indicating whether the specified path string contains absolute or relative path information
- GetDosPath( <path> ) -- Returns a given path in DOS friendly style (shortened)
- AddPath( <path> ) -- Add a directory to the search list when using ParsePath() and all other functions such as Include(), Require() etc
- DelPath( <path> ) -- Remove a directory from the search list when using ParsePath() and all other functions such as Include(), Require() etc
Network Functions
HTTP Functions
- HTTPFileExists( <url> ) -- Check if a file exists at a given URL
- HTTPGetString( <url> ) -- Copy all text from a URL and return it as a string
- HTTPDownload( <url>, <dest>, <progress>, <completed>, <param> ) -- Download a file from a given URL
MySQL Functions
- MySQLConnect( <ip/ip:port>, <login>, <password> ) -- Connect to a MySQL database
- MySQLSelectDB( <mysql>, <db name> ) -- Select a database
- MySQLQuery( <mysql>, <query> ) -- Execute a query
- MySQLFill( <mysql>, <query> ) -- Grab a table or parts of it from the Database
- MySQLFetch( <mysql data> ) -- Fetch the next row from a table
- MySQLFetchReset( <mysql data> ) -- Reset the current position in the table rows to 0
- MySQLFields( <mysql data> ) -- Return how many Fields are in the table
- MySQLRows( <mysql data> ) -- Return how many Rows are in the table
- MySQLClose( <mysql> ) -- Close a MySQL connection
Sputnik Client/Server Functions (This is just for connecting Sputnik Clients to Sputnik Servers nothing else)
- SSListen( <port>, <max connections>, <name> ) -- Create a server and begin listening for clients to connect
- SSConnect( <ip>, <port>, <connection string>, <name> ) -- Connect to a server
- SSApprove( <client socket> ) -- Approve a client to connect to the server
- SSDisapprove( <client socket> ) -- Disapprove a client to connect to the server
- SSClientStatus( <client/client socket> ) -- Get the status of a client or of our client
- SSClientIP( <client socket> ) -- Get the IP of a client socket
- SSRecv( <server/client> ) -- Check for a message recieved from client/server
- SSRead( <client/server>, <data type> ) --Read data from a client/server
- SSDrop( <client socket>, <reason> ) -- Kick a client off the server
- SSSend( /* depends... /* ) -- Send data to client or server
- SSBufferNew( <nothing/server/client> ) -- Create a new net buffer to store data to send to the client/server
- SSBufferPut( <netBuffer>, <type>, <data> ) -- Add data to a net buffer
Raw Sockets (TCP/UDP etc)
- SocketAccept( <socket> ) -- Creates a new <socket> for a newly created connection
- SocketAvailable( <socket> ) -- Gets the amount of data that has been received from the network and is available to be read
- SocketBind( <socket>, <ip>, <port> ) -- Associates a <socket> with a local endpoint
- SocketClose( <socket>, <wait> ) -- Closes the <socket> connection and releases all associated resources
- SocketConnect( <socket>, <ip>, <port> ) -- Establishes a connection to a remote host
- SocketConnected( <socket> ) -- Checks if a socket is connected and ready for use or not
- SocketCreate( <sockettype>, <protocoltype>, <addressfamily> ) -- Create a new <socket>
- SocketListen( <socket>, <backlog> ) -- Places a <socket> in a listening state
- SocketReceive( <socket>, <buffersize> ) -- Receives data from a bound <socket> into a receive buffer
- SocketReadChar( <socket>, <count> ) -- Receives a single (or a specified amount) of char(s) from a bound <socket>
- SocketReadLine( <socket> ) -- Receives the next line from a bound <socket> (useful for Telnet style stuff)
- SocketSend( <socket>, <binary-variable>, <offset>, <length>, <flag> ) -- Sends data to a connected <socket>
- SocketSendTo( <socket>, <ip>, <port>, <binary-variable>, <length>, <flag> ) -- Sends data to the specified ip + port
- SocketSendFile( <socket>, <file-name> ) -- Sends a file as data to a connected <socket>
- SocketIP( <socket>, <remote/local> ) -- Get the Remote or Local IP of a socket
- SocketShutdown( <socket>, <shutdown-type> ) -- Disables sends and receives on a <socket>
- SocketPoll( <socket>, <milliseconds>, <type> ) -- Sends a kind of ping to determine the status of the <socket>
- SocketHandle( <socket> ) -- Gets the operating system handle for the <socket>
- SocketIsBound( <socket> ) -- Gets a value that indicates whether the <socket> is bound to a specific local port
- SocketOpt( <socket>, <option>, <value> ) -- Get or Set a setting on a <socket>
Misc Network Functions
- HostResolve( <host name> ) -- Resolves a host name such as google.com into an IP address
- Ping( <ip address/host name> ) -- Pings a host and returns the roundtrip-time
Memory Functions
- Alloc( <size>, <filler> ) -- Allocate memory and return the pointer to it
- Realloc( <ptr>, <size> ) -- Resizes a block of memory previously allocated with Alloc()
- Free( <ptr> ) -- Deallocate memory from a pointer
- StringToPTR( <type>, <string> ) -- Allocates memory for the string and writes the string to that memory and returns the pointer for that memory
- PTRToString( <type>, <ptr> ) -- Reads a string from a memory pointer
- PTRRead( <ptr>, <type>, <offset> ) -- Read data from a memory pointer optionally starting from a given index
- PTRWrite( <ptr>, <type>, <offset>, <value> ) -- Write data to a memory pointer optionally starting from a given index
- PTRToDLLStruct( <def string>, <ptr> ) -- Reads a DLLStruct from a memory pointer
- DLLStructCreateDef( <name>, <def string> ) -- Creates a named C/C++ style structure definition that can be used with DLLStructCreate and can also be placed inside other DLLStructs
- DLLStructGetDef( <name>/<dllstruct> ) -- Return the <def string> of a given DLLStruct
- DLLStructCreate( <def string> ) -- Creates a C/C++ style structure to be used with DLLCall
- DLLStructCreateUnion( <def string> ) -- Creates a C/C++ style structure (union) to be used with DLLCall
- DLLStructGetData( <dllstruct>, <element>, <index> ) -- Returns the data of an element of the struct
- DLLStructSetData( <dllstruct>, <element>, <index> ) -- Set the data of an element of the struct
- DLLStructGetSize( <dllstruct> ) -- Returns the size of the struct in bytes
- DLLStructGetPtr( <dllstruct>, <element>, <index> ) -- Returns the pointer to the struct or an element in the struct or even a specific index of an array object within an elment
- DLLStructGetVars( <dllstruct> ) -- Create an array of all items and their array size with total byte size
Clipboard Functions
- ClipGet( <type> ) -- Get data from the clipboard
- ClipSet( <type>, <expression> ) -- Set data to the clipboard
Registry Functions
- RegRead( <key>, <value>, <default> ) -- Reads a value from the registry
- RegWrite( <key>, <value>, <type>, <data> ) -- Sets a value in the registry
- RegDelete( <key>, <value> ) -- Delete a key or value from the registry
- RegKeyList( <key> ) -- Return an array of all the keys at this location in the registry
- RegValueList( <key> ) -- Return an array of all the values at this location in the registry
- RegKeyExists( <key> ) -- Check if a key exists in the registry
- RegValueExists( <key>, <value> ) -- Check if a key value in the registry
Time & Date Functions
- Time( <array> ) -- Returns the current time or calculates the time in seconds from an associative array
- MicroTime( <returnAsDouble> ) -- Returns the current Unix timestamp with microseconds
- 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
- TimerInit( ) -- Returns a handle that can be passed to TimerDiff() to calculate the difference in milliseconds
- TimerDiff( <handle> ) -- Returns the difference in time from a previous call to TimerInit()
- Sleep( <milliseconds>, <doEvents> ) -- Pause the current executing thread for the given milliseconds
- USleep( <microseconds> ) -- Pause the current executing thread for the given microseconds
- TickCount( <ticks> ) -- Retrieves the number of milliseconds that have elapsed since the current instance of Sputnik was started
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
- GUICreate( "MDIWindow", <Text>, <Width>, <Height>, <Left>, <Top>, <Style> ) -- Create a GUI Multi-Document-Interface window
- GUICreate( "Window", <Text>, <Width>, <Height>, <Left>, <Top>, <Style> ) -- Create a GUI window
- DoEvents( ) -- Keep GUI windows active by dispatching all messages in the queue
- GUILoad( <GUI Window> ) -- Load a GUI window and display it (Usually after creation or after GUIUnload)
- GUIUnload( <GUI Window> ) -- Unload a GUI window and hide it (GUILoad will bring it back)
- GUIMDIParent( <GUI Window>, <GUI Window> ) -- Set the parent window (An MDI window) for another window to be created inside it
Control Creation Functions
- GUICreate( "Button", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a Button
- GUICreate( "DataGrid", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a DataGrid
- GUICreate( "Timer", <gui object>, <Interval> ) -- Create a Timer
- GUICreate( "ComboBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ComboBox
- GUICreate( "TextBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a TextBox
- GUICreate( "TextBoxEx", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a Multiline TextBox
- GUICreate( "Label", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a Label
- GUICreate( "GroupBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a GroupBox
- GUICreate( "PictureBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a PictureBox
- GUICreate( "ProgressBar", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ProgressBar
- GUICreate( "ListBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ListBox
- GUICreate( "ContextMenu", <gui object> ) -- Create a Context Menu which is used when right clicking the object
- GUICreate( "Menu", <gui object> ) -- Create a Menu
- GUICreate( "MenuItem", <gui object>, <Text> ) -- Create a MenuItem
- GUICreate( "TabSheet", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a TabSheet
- GUICreate( "TabPage", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a TabPage
- GUICreate( "RichTextBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a RichTextBox
- GUICreate( "CodeBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Creates a source code editor textbox the same as the one used in the Sputnik IDE
- GUICreate( "CheckBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a CheckBox
- GUICreate( "RadioButton", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a RadioButton
- GUICreate( "CodeBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a textbox with syntax highlight and support for multiple and custom languages (Same thing Sputnik IDE uses)
- GUICreate( "HotKeyBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a hotkeybox which a user can press a hotkey into it so you can make use of it
NOT AVAILABLE YET
- GUICreate( "DateTimePicker", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a DateTimePicker
- GUICreate( "LinkLabel", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a LinkLabel
- GUICreate( "CheckedListBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a CheckedListBox
- GUICreate( "ListView", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ListView
- GUICreate( "MaskedTextBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a MaskedTextBox
- GUICreate( "MonthCalendar", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a MonthCalendar
- GUICreate( "NumericUpDown", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a NumericUpDown
- GUICreate( "ToolTip", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a ToolTip
- GUICreate( "TreeView", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a TreeView
- GUICreate( "WebBrowser", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a WebBrowser
- GUICreate( "StatusBar", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a StatusBar
- GUICreate( "ToolStrip", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ToolStrip
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.
- GUIWindow( <window> ) -- Properties & Functions specifically for Windows
- GUIRichTextBox( <richtextbox> ) -- Properties & Functions specifically for RichTextBox
- GUIDataGrid( <datagrid> ) -- Properties & Functions specifically for DataGrid
- GUITimer( <timer> ) -- Properties & Functions specifically for Timer
- GUIComboBox( <codebox> ) -- Properties & Functions specifically for CodeBox
- GUIComboBox( <combobox> ) -- Properties & Functions specifically for ComboBox
- GUICheckBox( <checkbox> ) -- Properties & Functions specifically for CheckBox
- GUIRadioButton( <radiobutton> ) -- Properties & Functions specifically for RadioButton
- GUIHotkeyBox( <hotkeybox> ) -- Properties & Functions specifically for HotkeyBox
- GUIListBox( <listbox> ) -- Properties & Functions specifically for ListBox
- GUITabSheet( <tabsheet> ) -- Properties & Functions specifically for TabSheet
- GUIProgressBar( <progressbar> ) -- Properties & Functions specifically for ProgressBar
- GUIPictureBox( <picturebox> ) -- Properties & Functions specifically for PictureBox
- GUIMsgFilter( <gui object>, <command> ) -- Use a function to receive all messages windows sends to the GUI object (HWND, MSG, WPARAM, LPARAM).
- GUIWndProc( <gui>, <command> ) -- Use a function to receive all the WindProc messages windows sends to the GUI window (HWND, MSG, WPARAM, LPARAM).
Common Dialog/Control Properties Get/Set Functions
- GUIGetProp( <gui object>, <prop> ) -- Get the value of a GUI objects property
- GUISetProp( <gui object>, <prop>, <value> ) -- Set the value of a GUI objects property
- 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
GUI Link (Event) Functions
- GUILink( <gui object>, <linktype>, <action>, <param var> ) -- Add an event (link) to a GUI object such as Click, MouseDown etc
- GUILinkValid( <gui object>, <linktype> ) -- Check if a given event (link) is valid for the given GUI object
Graphics/Pixel Functions
- Colour( <name> ) -- Get the colour INT value of a given colours name
- ColourDialog( ) -- Allows the user to select a colour and allows you to get the RED, GREEN, BLUE etc values
- FontDialog( ) -- Allows the user to select a font and allows you to get the Name, size, bold etc values
Bitmap Functions
- BitmapCreate( <width>, <height> ) -- Create a new blank bitmap object
- BitmapGetPixel( <bitmap>, <x>, <y> ) -- Get a pixel on a bitmap object
- BitmapSetPixel( <bitmap>, <x>, <y>, <colour> ) -- Alter a pixel on a bitmap object
Other GUI Functions
- GUIStatus( <gui window> ) -- Check if a GUI window is loaded or unloaded
- GUIHideCaret( <gui object> ) -- Hide the caret in a GUI object
- GUIShowCaret( <gui object> ) -- Show the caret in a GUI object
- GUIRedraw( <gui object> ) -- Redraw the object
- GUICreate( "Font", <name>, <size>, <flags> ) -- Create a Font
- MsgBox( <message>, <title>, <flag>, <timeout> ) -- Show a message dialog
- InputBox( <title>, <message>, <default text> ) -- Shows a box to input text
- InputBoxEx( <title>, <message>, <default text> ) -- Shows a box to input multiple lines of text
- ChoiceBox( <title>, <message>, <options>, <flag> ) -- Shows a window with choices for the user to pick from either none/one or many choices can be allowed
- ToolTip( <text>, <x>, <y> ) -- Creates a tooltip anywhere on the screen
- ToolTipKill( <ToolTip> ) -- Delete a tooltip that was made using ToolTip()
- PSet( <gui object>, <x>, <y>, <object> ) -- Draw at a pixel
- GUISendToBack( <gui object> ) -- Send a GUI object to the back of the ZOrder
- GUIBringToFront( <gui object> ) -- Send a GUI object to the front of the ZOrder
Variable Type Checking etc
- isVarGUIObject( $variable ) -- Check if a variable holds a GUI Object
- GetVarGUIObjType( $variable ) -- Get the common object type of a variable (If it is a GUI object)
Keyboard Control Functions
- HotKeySet( <keydef>, <expression>, <param var> ) -- Create a custom hotkey to run custom code or execute a function
- SendKeys( <keydef>, <flag> ) -- Sends simulated keystrokes to the active window
- RealGetKeyState( <vk_keycode/expression> ) -- Checks if a key or series of keys is pressed down
- KeyHook( <name>, <command>, <param var> ) -- Places a global system wide Keyhook with callback to a function or command
Mouse Control Functions
- MouseClick ( <button>, <x>, <y>, <clicks>, <speed> ) -- Perform a mouse click operation
- MouseClickDrag ( <button>, <x1>, <y1>, <x2>, <y2>, <speed> ) -- Perform a mouse click and drag operation
- MouseDown ( <button> ) -- Perform a mouse down event at the current mouse position
- MouseUp ( <button> ) -- Perform a mouse up event at the current mouse position
- MouseMove ( <x>, <y>, <speed> ) -- Moves the mouse pointer
- MouseGetPos ( ) -- Retrieves the current position of the mouse cursor
- MouseWheel ( <direction>, <clicks> ) -- Moves the mouse wheel up or down
- MouseHook( <name>, <command>, <param var> ) -- Places a global system wide MouseHook with callback to a function or command
Window Management Functions
(For info on using <title>, <text> See Window Titles and Text (Advanced) )
- WinActivate ( <title>, <text> ) -- Activates (gives focus to) a window
- WinActive ( <title>, <text> ) -- Checks to see if a specified window exists and is currently active
- WinExists ( <title>, <text> ) -- Checks to see if a specified window exists
- WinGetClassList ( <title>, <text> ) -- Retrieves the classes from a window
- WinGetHandle ( <title>, <text> ) -- Retrieves the internal handle of a window
- WinGetPos ( <title>, <text> ) -- Retrieves the position and size of a given window
- WinGetCaretPos ( ) -- Returns the coordinates of the caret in the foreground window
- WinGetTitle ( <title>, <text> ) -- Retrieves the full title from a window
- WinGetText ( <title>, <text> ) -- Retrieves the text from a window
- WinGetState ( <title>, <text> ) -- Retrieves the state of a given window
- WinGetProcess ( <title>, <text> ) -- Retrieves the Process ID (PID) associated with a window
- WinGetClientSize ( <title>, <text> ) -- Retrieves the size of a given window's client area
- WinClose ( <title>, <text> ) -- Closes a window
- WinKill ( <title>, <text> ) -- Forces a window to close
- WinMove ( <title>, <text>, <x>, <y>, <width>, <height>, <speed> ) -- Moves and/or resizes a window
- WinWait ( <title>, <text>, <timeout> ) -- Waits until the requested window exists
- WinWaitActive ( <title>, <text>, <timeout> ) -- Waits until the requested window is active
- WinWaitNotActive ( <title>, <text>, <timeout> ) -- Waits until the requested window is not active
- WinWaitClose ( <title>, <text>, <timeout> ) -- Waits until the requested window does not exist
- WinSetTitle ( <title>, <text>, <newtitle> ) -- Changes the title of a window
- WinSetState ( <title>, <text>, <flag> ) -- Shows, hides, minimizes, maximizes, or restores a window
- WinSetTrans ( <title>, <text>, <transparency> ) -- Sets the transparency of a window
- WinMinimizeAll ( ) -- Minimizes all windows
- WinMinimizeAllUndo ( ) -- Undoes a previous WinMinimizeAll function
- WinFlash ( <title>, <text>, <flashes>, <delay> ) -- Flashes a window in the taskbar
- WinMenuSelectItem( <title>, <text>, <item>, <subitems> ... ) -- Invokes a menu item of a window
- WinList ( <title>, <text> ) -- Retrieves a list of windows
Controls
(For info on using <title>, <text> See Window Titles and Text (Advanced) )
- ControlClick ( <title>, <text>, <controlID>, <button>, <clicks>, <x>, <y> ) -- Sends a mouse click command to a given control
- ControlSend ( <title>, <text>, <controlID>, <string> <flag> ) -- Sends a string of characters to a control
- ControlGetFocus ( <title>, <text> ) -- Returns the ControlRef# of the control that has keyboard focus within a specified window
- ControlGetPos ( <title>, <text>, <controlID> ) -- Retrieves the position and size of a control relative to it's window
- ControlDisable ( <title>, <text>, <controlID> ) -- Disables a control
- ControlEnable ( <title>, <text>, <controlID> ) -- Enables a control
- ControlShow ( <title>, <text>, <controlID> ) -- Shows a control that was hidden
- ControlHide ( <title>, <text>, <controlID> ) -- Hides a control
- ControlGetText ( <title>, <text>, <controlID> ) -- Retrieves text from a control
- ControlSetText ( <title>, <text>, <controlID>, <text> ) -- Sets text of a control
- ControlMove ( <title>, <text>, <controlID>, <x>, <y>, <width>, <height>, <speed> ) -- Moves a control within a window
- ControlGetHandle ( <title>, <text>, <controlID> ) -- Retrieves the internal handle of a control
- ControlFocus ( <title>, <text>, <controlID> ) -- Sets input focus to a given control on a window
NOT AVAILABLE YET
- ControlCommand ( <title>, <text>, <controlID>, <command>, <option> ) -- Sends a command to a control
Graphics/Pixel Functions
- PixelGetColour ( <x>, <y> ) -- Returns a pixel colour according to x, y pixel coordinates
- PixelGetMouse ( ) -- Returns a pixel colour according to x, y position of the mouse pointer
- PixelSearch ( <left>, <top>, <right>, <bottom>, <colour>, <shade>, <padding>, <step> ) -- Searches a rectangle of pixels for the pixel colour provided
- PixelSearchHWND ( <hwnd>, <left>, <top>, <right>, <bottom>, <colour>, <shade>, <padding>, <step> ) -- Searches a rectangle of pixels for the pixel colour provided
- PixelChecksum ( <left>, <top>, <right>, <bottom>, <step>, <hwnd> ) -- Generates a checksum for a region of pixels
- RGB( <red>, <green>, <blue> ) -- Get the colour INT value of given red, green and blue bytes
- GetRValue( <colour> ) -- Get the red byte from a colour INT value
- GetGValue( <colour> ) -- Get the green byte from a colour INT value
- GetBValue( <colour> ) -- Get the blue byte from a colour INT value
Sputnik Plugins (Using .NET DLLs)
- Use( <name/array>, <flag> ) -- Load a Sputnik plugin
- Unuse( <name> ) -- ???
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
- ClassExists( <expression> ) -- Check if a given Class exists
- ClassList( <expression>, <inherits> ) -- Return an array of all user defined classes (Or just ones fitting a given pattern)
- ClassInfo( <class-name> ) -- Get a vast amount of *behind the scene* information on a class and its functions, properties and so on
- ClassStack( <variable> ) -- Return a reference to a classes internal variable stack (as an array) (or set the class stack from an existing array)
- 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)
- UnsetClass( <class-name> ) -- Delete a previous user defined Class from Sputnik
- 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
- newClass( <name>, <params> ) -- Create a new instance of a class by its name as a string
- NewClassFromArray( <name>, <array>, <wakeUp> ) -- Create a new instance of a class by its name and an array of its values
- ConvertClass( <oldClass>, <name>, <wakeUp> ) -- Create a new instance of a class by its name and copy the values from another class
- IsOverloaded( <class>, <overload> ) -- Check if a given cast/operator overload exists within a class
Internal Function Management and Information
- FunctionExists( <expression> ) -- Check if a given Function exists
- FunctionList( <expression>, <class> ) -- Return an array of all user defined functions (Or just ones fitting a given pattern)
- FunctionInfo( <function-name> ) -- Get a vast amount of *behind the scene* information on a function
- UnsetFunction( <function-name> ) -- Delete a previous user defined Function from Sputnik
- UnsetCoreFunction( <function-name> ) -- Delete a core function from Sputnik
- CoreFunctionExists( <expression> ) -- Check if a given Core Function exists
- CoreFunctionList( <expression> ) -- Return an array of all core functions (Or just ones fitting a given pattern)
- Eval( <expression>, <flag>, <cleanup>, <printToReturn> ) -- Evaluate a string as Sputnik code
- MKFunc(<params>, <body>) -- Create a user defined function to be called from a variable
- CallFunc( <function>, <array>) -- Calls a user defined function contained in a variable
- Call(<function/array>, <expressions>) -- Calls a function contained in a string parameter
- CallArray( <function/array>, <array>) -- Calls a function contained in a string parameter
Internal Enum Management and Information
- EnumExists( <expression> ) -- Check if a given Enum exists
- EnumList( <expression> ) -- Return an array of all user defined enums (Or just ones fitting a given pattern)
- UnsetEnum( <enum-name> ) -- Delete a previous user defined Enum from Sputnik
Internal DLLImport Management and Information
- DLLImportExists( <expression> ) -- Check if a given DLLImport exists
- DLLImportList( <expression> ) -- Return an array of all user defined dllimports (Or just ones fitting a given pattern)
- UnsetDLLImport( <dllimport-function-name> ) -- Delete a function imported using the DLLImport() function
Internal DLLStruct Management and Information
- DLLStructExists( <expression> ) -- Check if a given DLLStruct exists
- DLLStructList( <expression> ) -- Return an array of all user defined dllstructs (Or just ones fitting a given pattern)
- UnsetDLLStruct( <dllstruct-name> ) -- Delete a previous user defined DLLStruct from Sputnik
Internal Variable/Scope Information
- VarList( <varScope/class> ) -- Obtain information on all variables that exist in a given scope or class
- VarTypeToString( <varType> ) -- Convert a raw variable type into it's string representation
- VarTypeFromString( <string> ) -- Convert a variable type from it's string representation into it's raw type
- VarObjTypeToString( <varObjType> ) -- Convert a raw variable object type into it's string representation
- VarObjTypeFromString( <string> ) -- Convert a variable object type from it's string representation into it's raw type
- VarScopeToString( <varScope> ) -- Convert a raw variable scope into it's string representation
- VarScopeFromString( <string> ) -- Convert a variable scope from it's string representation into it's raw type
- ScopeToString( <scope> ) -- Convert a raw scope into it's string representation
- ScopeFromString( <string> ) -- Convert a scope from it's string representation into it's raw type
Eval Functions
- EvalSyntax( <expression> ) -- Evaluate a string as Sputnik code but only check if it's syntax is valid
- EvalCreate( ) -- Create an Eval object for use with Eval()
- EvalSet( <evalObject>, <name>, <value> ) -- Set a variable inside an Eval Object
- EvalGet( <evalObject>, <name>, <value> ) -- Get a from variable inside an Eval Object
Misc Functions
- Exit( <exitCode> ) -- Instantly terminate the program/script
- 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
- Warn( <message> ) -- Show a warning message with source file name and line number
- Clone( <object> ) -- Create a clone of a clone-able object
- LineInfo( ) -- Get a vast amount of *behind the scene* information the current line of source code being executed
- GC( <flag> ) -- Use the garbage collector
- HWND( ) -- Get the HWND of the hidden window used by this program (It handles hotkeys etc)
- Require( <file>, <flag> ) -- Add all functions etc from a file for use
- Include( <file>, <flag> ) -- Add all functions etc from a file for use and execute all expressions
- Opt( <option>, <value> ) -- Changes the operation of various Sputnik functions/parameters
- IsAdmin( ) -- Check if the script is running in admin mode or not (Run as administrator)
- ObjToVar( <variable> ) -- Convert a $variable's object to its compatible $variable data type
- VarToObj( <variable> ) -- Convert a $variable to its compatible object (such as .NET base object)
User Defined Functions
These functions are created using Sputnik and are not part of the Sputnik core language.