Function Reference

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Get Type Directly)
(NBTTagCompound)
 
(37 intermediate revisions by one user not shown)
Line 163: Line 163:
 
* [[Core Function isVarClass|isVarClass( $variable, <type>, <strict> )]] -- Check if a variable's object type is a class
 
* [[Core Function isVarClass|isVarClass( $variable, <type>, <strict> )]] -- Check if a variable's object type is a class
 
* [[Core Function isVarDLLStruct|isVarDLLStruct( $variable )]] -- Check if a variable holds a DLLStruct
 
* [[Core Function isVarDLLStruct|isVarDLLStruct( $variable )]] -- Check if a variable holds a DLLStruct
* [[Core Function isVarGUIObject|isVarGUIObject( $variable )]] -- Check if a variable holds a GUI Object
 
 
* [[Core Function isVarServer|isVarServer( $variable )]] -- Check if a variable holds a Server object from Listen()
 
* [[Core Function isVarServer|isVarServer( $variable )]] -- Check if a variable holds a Server object from Listen()
 
* [[Core Function isVarClient|isVarClient( $variable )]] -- Check if a variable holds a Client object from Connect()
 
* [[Core Function isVarClient|isVarClient( $variable )]] -- Check if a variable holds a Client object from Connect()
Line 179: Line 178:
 
==== Binary Data Management Functions ====
 
==== Binary Data Management Functions ====
 
* [[Core Function Bin|Bin( <args> )]] -- Create a new binary variable
 
* [[Core Function Bin|Bin( <args> )]] -- Create a new binary variable
 +
* [[Core Function Op|Op( <opCodes> )]] -- Create a new binary variable from a string of opCodes such as "AA 10 20"
 
* [[Core Function BinaryCreate|BinaryCreate( <size>, <fill> )]] -- Create a new binary variable and its array size and fill data type  
 
* [[Core Function BinaryCreate|BinaryCreate( <size>, <fill> )]] -- Create a new binary variable and its array size and fill data type  
 
* [[Core Function BinaryClone|BinaryClone( <binary-array> )]] -- Clone a binary variable 100% and return a new binary variable with exactly same data as the old one
 
* [[Core Function BinaryClone|BinaryClone( <binary-array> )]] -- Clone a binary variable 100% and return a new binary variable with exactly same data as the old one
Line 204: Line 204:
 
* [[Core Function BinaryMid|BinaryMid( <binary-array>, <start>, <length> )]] -- Create a binary variable by extracting a number of bytes from another binary variable
 
* [[Core Function BinaryMid|BinaryMid( <binary-array>, <start>, <length> )]] -- Create a binary variable by extracting a number of bytes from another binary variable
 
* [[Core Function BinaryMidReplace|BinaryMidReplace( <binary-array>, <replacement>, <start>, <length> )]] -- Replace a section (from start to length) of the binary with the replacement binary
 
* [[Core Function BinaryMidReplace|BinaryMidReplace( <binary-array>, <replacement>, <start>, <length> )]] -- Replace a section (from start to length) of the binary with the replacement binary
* [[Core Function BinaryConcat|BinaryConcat( <values> )]] -- Mass append a ton of Binary variables in an extremely fast and efficient way
+
* [[Core Function BinaryConcat|BinaryConcat( <destination/array>, <values> )]] -- Mass append a ton of Binary variables in an extremely fast and efficient way
 
* [[Core Function BinaryJoin|BinaryJoin( <separator>, <values>, <start>, <count> )]] -- Create a new Binary by joining together a ton of Binary variables in an extremely fast and efficient way
 
* [[Core Function BinaryJoin|BinaryJoin( <separator>, <values>, <start>, <count> )]] -- Create a new Binary by joining together a ton of Binary variables in an extremely fast and efficient way
 
* [[Core Function BinaryAppend|BinaryAppend( <binary-array>, <binary-array2>, <flag> )]] -- Append a binary variables data onto the end or beginning of another binary variables data
 
* [[Core Function BinaryAppend|BinaryAppend( <binary-array>, <binary-array2>, <flag> )]] -- Append a binary variables data onto the end or beginning of another binary variables data
Line 301: Line 301:
 
* [[Core Function NBTCompoundWrite|NBTCompoundWrite( <nbtCompound>, <buffer> )]] -- Write the NBTTagCompound to binary or a buffer
 
* [[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 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 NBTCompoundWriteFile|NBTCompoundWriteFile( <nbtCompound>, <file>, <compression> )]] -- Write the NBTTagCompound to a file
* [[Core Function NBTCompoundReadFile|NBTCompoundReadFile( <file> )]] -- Create a new NBTTagCompound from reading 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 NBTCompoundCompress|NBTCompoundCompress( <nbtCompound> )]] -- Compress the NBTTagCompound to binary
 
* [[Core Function NBTCompoundDecompress|NBTCompoundDecompress( <binary-variable> )]] -- Decompress a NBTTagCompound from binary
 
* [[Core Function NBTCompoundDecompress|NBTCompoundDecompress( <binary-variable> )]] -- Decompress a NBTTagCompound from binary
Line 318: Line 318:
 
* [[Core Function TB|TB( <string> )]] -- Convert a string of up to 4 chars into a 32-Bit unsigned number (network order)
 
* [[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
 
* [[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 343: Line 348:
 
* [[Core Function DegreesToRadians|DegreesToRadians( <value> )]] -- Converts degrees to radians
 
* [[Core Function DegreesToRadians|DegreesToRadians( <value> )]] -- Converts degrees to radians
 
* [[Core Function DegreesToRevolutions|DegreesToRevolutions( <value> )]] -- Converts degrees to revolutions
 
* [[Core Function DegreesToRevolutions|DegreesToRevolutions( <value> )]] -- Converts degrees to revolutions
 +
* [[Core Function DiffCalc|DiffCalc( <first>, <second>, <isDouble> )]] -- Calculates the difference between two values and returns information about it that can help you convert the first into the second for future needs
 
* [[Core Function Distance|Distance( <value1>, <value2> )]] -- Calculates the absolute value of the difference of two values
 
* [[Core Function Distance|Distance( <value1>, <value2> )]] -- Calculates the absolute value of the difference of two values
 
* [[Core Function Distance2D|Distance2D( <x1>, <y1>, <x2>, <y2> )]] -- Finds the distance between two points on a 2D surface
 
* [[Core Function Distance2D|Distance2D( <x1>, <y1>, <x2>, <y2> )]] -- Finds the distance between two points on a 2D surface
Line 369: Line 375:
 
* [[Core Function Mod2PI|Mod2PI( <value> )]] -- Calculates the modulo 2*PI of the specified value
 
* [[Core Function Mod2PI|Mod2PI( <value> )]] -- Calculates the modulo 2*PI of the specified value
 
* [[Core Function MatlabMod|MatlabMod( <expression>, <expression2> )]] -- Performs the Matlab modulus operation
 
* [[Core Function MatlabMod|MatlabMod( <expression>, <expression2> )]] -- Performs the Matlab modulus operation
 +
* [[Core Function OffsetCalc|OffsetCalc( <size>, <start>, <length> )]] -- Calculate the START and LENGTH of an array index
 
* [[Core Function Pow|Pow( <expression>, <expression2> )]] -- Returns a specified number raised to the specified power
 
* [[Core Function Pow|Pow( <expression>, <expression2> )]] -- Returns a specified number raised to the specified power
 
* [[Core Function RadiansToDegrees|RadiansToDegrees( <value> )]] -- Converts radians to degrees
 
* [[Core Function RadiansToDegrees|RadiansToDegrees( <value> )]] -- Converts radians to degrees
Line 455: Line 462:
 
* [[Core Function GMatch|GMatch( <string>, <pattern>, <asKeypair>, <offset> )]] -- Extract the patterns from a string and return as array or associative array
 
* [[Core Function GMatch|GMatch( <string>, <pattern>, <asKeypair>, <offset> )]] -- Extract the patterns from a string and return as array or associative array
 
* [[Core Function GSub|GSub( <string>, <pattern>, <repl>, <max> )]] -- Returns a copy of the string in which all occurrences of the pattern have been replaced by a replacement string (Or fills an array/callback function)
 
* [[Core Function GSub|GSub( <string>, <pattern>, <repl>, <max> )]] -- Returns a copy of the string in which all occurrences of the pattern have been replaced by a replacement string (Or fills an array/callback function)
* [[Core Function InStr|InStr( <string>, <substirng>, <casesense>, <occurrence>, <start> )]] -- Checks if a string contains a given substring.
+
* [[Core Function InStr|InStr( <string>, <substirng>, <ignoreCase>, <occurrence>, <start> )]] -- Checks if a string contains a given substring
 +
* [[Core Function InStrRev|InStrRev( <string>, <substirng>, <ignoreCase>, <occurrence>, <start> )]] -- Same as InStr() but searches from right to left instead of left to right
 
* [[Core Function isAlpha|isAlpha( <expression> )]] -- Checks if string contains only Alphabetic characters
 
* [[Core Function isAlpha|isAlpha( <expression> )]] -- Checks if string contains only Alphabetic characters
 
* [[Core Function isAlphaNumeric|isAlphaNumeric( <expression> )]] -- Checks if string contains only AlphaNumeric(A-Z, 0-9), Characters
 
* [[Core Function isAlphaNumeric|isAlphaNumeric( <expression> )]] -- Checks if string contains only AlphaNumeric(A-Z, 0-9), Characters
Line 522: Line 530:
 
* [[Core Function SPrintf|SPrintf( <format control>, <params>... )]] -- Returns a formatted string (similar to the C sprintf() function)
 
* [[Core Function SPrintf|SPrintf( <format control>, <params>... )]] -- Returns a formatted string (similar to the C sprintf() function)
 
* [[Core Function StartsWith|StartsWith( <expression>, <expression2>, <flag> )]] -- Check if a string starts with a substring
 
* [[Core Function StartsWith|StartsWith( <expression>, <expression2>, <flag> )]] -- Check if a string starts with a substring
* [[Core Function StrChr|StrChr( <haystack>, <char>, <start> )]] --  Locate first occurrence of character in string
+
* [[Core Function StrChr|StrChr( <haystack>, <char>, <start>, <count> )]] --  Locate first occurrence of character in string
* [[Core Function StrrChr|StrrChr( <haystack>, <char>, <start> )]] --  Locate last occurrence of character in string
+
* [[Core Function StrrChr|StrrChr( <haystack>, <char>, <start>, <count> )]] --  Locate last occurrence of character in string
 
* [[Core Function StrShuffle|StrShuffle( <str> )]] --  Randomly shuffles a string
 
* [[Core Function StrShuffle|StrShuffle( <str> )]] --  Randomly shuffles a string
* [[Core Function Strpbrk|Strpbrk( <haystack>, <needle>, <start> )]] --  Locate a list of possible characters in string and return the position of it
+
* [[Core Function Strpbrk|Strpbrk( <haystack>, <needle>, <start>, <count> )]] --  Locate a list of possible characters in string and return the position of it
 
* [[Core Function StripCSlashes|StripCSlashes( <str> )]] -- Unescape string escaped with AddCSlashes()
 
* [[Core Function StripCSlashes|StripCSlashes( <str> )]] -- Unescape string escaped with AddCSlashes()
 
* [[Core Function StripTags|StripTags( <str>, <allowable_tags> )]] -- Strip HTML tags from a string
 
* [[Core Function StripTags|StripTags( <str>, <allowable_tags> )]] -- Strip HTML tags from a string
Line 531: Line 539:
 
* [[Core Function StrSpn|StrSpn( <subject>, <mask>, <start>, <length> )]] --  Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask
 
* [[Core Function StrSpn|StrSpn( <subject>, <mask>, <start>, <length> )]] --  Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask
 
* [[Core Function StrCSpn|StrCSpn( <subject>, <mask>, <start>, <length> )]] --  Find length of initial segment not matching mask
 
* [[Core Function StrCSpn|StrCSpn( <subject>, <mask>, <start>, <length> )]] --  Find length of initial segment not matching mask
* [[Core Function StrCmp|StrCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparison
+
* [[Core Function StrCmp|StrCmp( <str1>, <str2>, <ignoreCase>, <start>, <length> )]] -- String comparison
 
* [[Core Function StrNatCmp|StrNatCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparisons using a "natural order" algorithm
 
* [[Core Function StrNatCmp|StrNatCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparisons using a "natural order" algorithm
 
* [[Core Function StrVersCmp|StrVersCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparison holding name and indices/version numbers
 
* [[Core Function StrVersCmp|StrVersCmp( <str1>, <str2>, <ignoreCase> )]] -- String comparison holding name and indices/version numbers
 
* [[Core Function Soundex|Soundex( <str> )]] -- Calculate the soundex key of a string
 
* [[Core Function Soundex|Soundex( <str> )]] -- Calculate the soundex key of a string
 
* [[Core Function Str2Hex|Str2Hex( <expression>, <flag> )]] -- Convert a string to a hex string
 
* [[Core Function Str2Hex|Str2Hex( <expression>, <flag> )]] -- Convert a string to a hex string
 +
* [[Core Function StrNew|StrNew( <char>, <length>, <flag> ]] -- Create a new string of a given length filled with a given char
 
* [[Core Function StrInsert|StrInsert( <expression>, <index>, <expression2> )]] -- Insert a string at a given index of another string and return the new string
 
* [[Core Function StrInsert|StrInsert( <expression>, <index>, <expression2> )]] -- Insert a string at a given index of another string and return the new string
 
* [[Core Function StrIndex|StrIndex( <expression>, <index>, <value> )]] -- Get or set a char from/to a string at a specific index
 
* [[Core Function StrIndex|StrIndex( <expression>, <index>, <value> )]] -- Get or set a char from/to a string at a specific index
* [[Core Function StrPos|StrPos( <haystack>, <needle>, <offset>, <flags> )]] -- Find the position of the first/last occurrence of a substring in a string
+
* [[Core Function StrIncrement|StrIncrement( <str> )]] -- Increment a string the same way as doing ++ on a string like $a++
* [[Core Function StrTr|StrTr( <str>, <from> <to>, <replace_pairs> )]] -- Translate characters or replace substrings
+
* [[Core Function StrPos|StrPos( <haystack>, <needle>, <flags>, <start>, <length> )]] -- Find the position of the first/last occurrence of a substring in a string
 +
* [[Core Function StrTr|StrTr( <str>, <from-to/replace_pairs> )]] -- Translate characters or replace substrings
 
* [[Core Function StrTok|StrTok( <str/token>, <token> )]] -- Tokenize string
 
* [[Core Function StrTok|StrTok( <str/token>, <token> )]] -- Tokenize string
* [[Core Function StrStr|StrStr( <haystack>, <needle>, <before_needle>, <find_last>, <case> )]] -- Find the first/last occurrence of a string
+
* [[Core Function StrStr|StrStr( <haystack>, <needle>, <before_needle>, <find_last>, <case>, <start>, <length> )]] -- Find the first/last occurrence of a string
 
* [[Core Function StrLen|StrLen( <expression> )]] -- Returns length of specified string
 
* [[Core Function StrLen|StrLen( <expression> )]] -- Returns length of specified string
 
* [[Core Function SubStr|SubStr( <expression>, <start>, <count>, <replacement> )]] -- Return part of a string or replace it
 
* [[Core Function SubStr|SubStr( <expression>, <start>, <count>, <replacement> )]] -- Return part of a string or replace it
Line 554: Line 564:
 
* [[Core Function TrimLeft|TrimLeft( <expression>, <chars> )]] -- Strip whitespace from the start of a string
 
* [[Core Function TrimLeft|TrimLeft( <expression>, <chars> )]] -- Strip whitespace from the start of a string
 
* [[Core Function TrimRight|TrimRight( <expression>, <chars> )]] -- Strip whitespace from the end of a string
 
* [[Core Function TrimRight|TrimRight( <expression>, <chars> )]] -- Strip whitespace from the end of a string
 +
* [[Core Function TrimToNull|TrimToNull( <string> )]] -- Strip all zero chars (nulls) from the end of a string
 
* [[Core Function UC|UC( <expression> )]] -- Returns string in all Upper Case
 
* [[Core Function UC|UC( <expression> )]] -- Returns string in all Upper Case
 
* [[Core Function UCFirst|UCFirst( <expression> )]] -- Upper Cases first letter of string
 
* [[Core Function UCFirst|UCFirst( <expression> )]] -- Upper Cases first letter of string
Line 566: Line 577:
 
* [[Core Function VSPrintf|VSPrintf( <format control>, <params>... )]] -- Returns a formatted string (similar to the C sprintf() function) but accepts arrays as the arguments
 
* [[Core Function VSPrintf|VSPrintf( <format control>, <params>... )]] -- Returns a formatted string (similar to the C sprintf() function) but accepts arrays as the arguments
 
* [[Core Function WordWrap|WordWrap( <str>, <width>, <break>, <cut> )]] -- Wraps a string to a given number of characters
 
* [[Core Function WordWrap|WordWrap( <str>, <width>, <break>, <cut> )]] -- Wraps a string to a given number of characters
 
==== CharPtr Functions ====
 
Note the [[Fixed|Fixed]] statement is tied directly with CharPtr
 
* [[Core Function StrNew|StrNew( <char>, <length>, <flag> ]] -- Create a new string of a given length filled with a given char (or optionally return it as a CharPtr rather than a new string)
 
* [[Core Function CharCopy|CharCopy( <dest>, <src>, <length> )]] -- Copy a length of characters from the source pointer to the destination pointer
 
* [[Core Function CharCopyRev|CharCopyRev( <dest>, <src>, <length> )]] -- Copy a length of characters from the source pointer to the destination pointer (in reverse so Hello becomes olleH)
 
  
 
==== Array Functions ====
 
==== Array Functions ====
Line 577: Line 582:
 
* [[Core Function ArrayScope|ArrayScope( <array>, <scope> )]] -- Get or Set an arrays internal Sputnik scope (Only to be used by Sputnik library developers)
 
* [[Core Function ArrayScope|ArrayScope( <array>, <scope> )]] -- Get or Set an arrays internal Sputnik scope (Only to be used by Sputnik library developers)
 
* [[Core Function IsHash|IsHash( <array> )]] -- Check if all the keys in an array are Strings rather than numeric (Making it a full hashmap rather than full array or mixed)
 
* [[Core Function IsHash|IsHash( <array> )]] -- Check if all the keys in an array are Strings rather than numeric (Making it a full hashmap rather than full array or mixed)
 +
* [[Core Function IsHashAny|IsHashAny( <array> )]] -- Check if any of the keys in an array are Strings rather than numeric (Making it a possible hashmap rather than full array or mixed)
 
* [[Core Function IsArray|IsArray( <array> )]] -- Check if all the keys in an array are Numeric and none are String (Making it a full array rather than full hashmap or mixed)
 
* [[Core Function IsArray|IsArray( <array> )]] -- Check if all the keys in an array are Numeric and none are String (Making it a full array rather than full hashmap or mixed)
 
* [[Core Function IsList|IsList( <array> )]] -- Same as IsArray but also checks to make sure the keys start at 0 and end at the highest with no gaps which makes it a perfect list
 
* [[Core Function IsList|IsList( <array> )]] -- Same as IsArray but also checks to make sure the keys start at 0 and end at the highest with no gaps which makes it a perfect list
Line 583: Line 589:
 
* [[Core Function Join|Join( <array>, <separator> )]] -- Join an array into a string with an optional separator
 
* [[Core Function Join|Join( <array>, <separator> )]] -- Join an array into a string with an optional separator
 
* [[Core Function JoinKV|JoinKV( <array>, <separator> )]] -- Join an array (as keys and values) into a string with an optional separator
 
* [[Core Function JoinKV|JoinKV( <array>, <separator> )]] -- Join an array (as keys and values) into a string with an optional separator
* [[Core Function Count|Count( <array/binary-array> )]] -- Returns the size of array (How many elements it currently has stored)
+
* [[Core Function Count|Count( <array/binary-array/class> )]] -- Returns the size of array (How many elements it currently has stored)
 
* [[Core Function Fill|Fill( <start>, <num>, <value> )]] -- Fill an array with values
 
* [[Core Function Fill|Fill( <start>, <num>, <value> )]] -- Fill an array with values
 
* [[Core Function FillKeys|FillKeys( <keys>, <value> )]] -- Fill an array with values, specifying keys
 
* [[Core Function FillKeys|FillKeys( <keys>, <value> )]] -- Fill an array with values, specifying keys
Line 821: Line 827:
  
 
==== Memory Functions ====
 
==== Memory Functions ====
* [[Core Function WriteMem|WriteMem( < Caption / PID >, <Class>, <Address>, <value> )]] -- Write a value to an address in an application's memory (Supports multiple values and even binary variables for writing multiple bytes)
 
* [[Core Function ReadMem|ReadMem( < Caption / PID >, <Class>, <Address>, <defs>, <size> )]] -- Read bytes from an application's memory at an address and create variables using same defs and return values as Unpack()
 
 
* [[Core Function Alloc|Alloc( <size>, <filler> )]] -- Allocate memory and return the pointer to it
 
* [[Core Function Alloc|Alloc( <size>, <filler> )]] -- Allocate memory and return the pointer to it
 
* [[Core Function Realloc|Realloc( <ptr>, <size> )]] -- Resizes a block of memory previously allocated with Alloc()
 
* [[Core Function Realloc|Realloc( <ptr>, <size> )]] -- Resizes a block of memory previously allocated with Alloc()
Line 856: Line 860:
 
==== Time & Date Functions ====
 
==== Time & Date Functions ====
 
* [[Core Function Time|Time( <array> )]] -- Returns the current time or calculates the time in seconds from an associative array
 
* [[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 Date|Date( <format>, <time> )]] -- Returns a string with the date and time formatted according to the format given. If no time is supplied defaults to the current time
 
* [[Core Function TimerInit|TimerInit( )]] -- Returns a handle that can be passed to TimerDiff() to calculate the difference in milliseconds
 
* [[Core Function TimerInit|TimerInit( )]] -- Returns a handle that can be passed to TimerDiff() to calculate the difference in milliseconds
Line 863: Line 868:
 
* [[Core Function TickCount|TickCount( <ticks> )]] -- Retrieves the number of milliseconds that have elapsed since the current instance of Sputnik was started
 
* [[Core Function TickCount|TickCount( <ticks> )]] -- Retrieves the number of milliseconds that have elapsed since the current instance of Sputnik was started
  
==== GUI Functions ====
+
==== Old GUI Functions ====
 +
 
 +
All the functions below are part of the SputnikOldGUI.dll basically these functions are *to be* depreciated and replaced with something much better in the future.
 +
 
 +
However you can still use these and even after they have been replaced with a new GUI system you will still be able to use these functions (and GUI programs made with them) anyway by using the SputnikOldGUI.dll into your project.
 +
 
 +
To use any of these functions you must include the SputnikOldGUI.dll to do that you must add this code to the top of your script.
 +
 
 +
<syntaxhighlight lang="sputnik">
 +
use('SputnikOldGUI.dll', true);
 +
</syntaxhighlight>
 +
 
 +
Here is an example of using "GUICreate" in a full example and including the SputnikOldGUI.dll
 +
 
 +
<syntaxhighlight lang="sputnik">
 +
// Load the old GUI system
 +
// Since this an old GUI example
 +
use('SputnikOldGUI.dll', true);
 +
// Create the GUI
 +
Global $GUI = GUICreate("Window", "My Title", 200, 200);
 +
// Create a button -- This button will simply display a message
 +
Global $Button = GUICreate("Button", $GUI, "Press Me!", 8, 8);
 +
// Add a link to the button
 +
GUILink($Button, "Click", 'myFunction();'); // Call function
 +
// Show the GUI
 +
GUILoad( $GUI );
 +
// Keep the GUI running as long as long as the window is open
 +
While ( GUIStatus( $GUI ) )
 +
DoEvents( );
 +
// This function is called when the button is clicked
 +
Function myFunction()
 +
{
 +
MsgBox("Hello from the button");
 +
}
 +
</syntaxhighlight>
 +
 
 +
Make note however that the examples below do not include the SputnikOldGUI.dll in their scripts you must do that part yourself!.
  
 
===== Dialog Creation Functions =====
 
===== Dialog Creation Functions =====
Line 935: Line 976:
 
* [[Core Function GUISetProp|GUISetProp( <gui object>, <prop>, <value> )]] -- Set the value of a GUI objects property
 
* [[Core Function GUISetProp|GUISetProp( <gui object>, <prop>, <value> )]] -- Set the value of a GUI objects property
 
* [[Core Function GUIGetPropList|GUIGetPropList( <gui object>, <searchfor>, <flag> )]] -- Get an array of the the names and types of all compatible/incompatible/all properties that the GUI object offers
 
* [[Core Function GUIGetPropList|GUIGetPropList( <gui object>, <searchfor>, <flag> )]] -- Get an array of the the names and types of all compatible/incompatible/all properties that the GUI object offers
 
===== Common Dialog/Control Functions =====
 
* [[Core Function GUIInvoke|GUIInvoke( <gui object>, <method name>, <params> )]] -- Call a method on a GUI object
 
  
 
===== GUI Link (Event) Functions =====
 
===== GUI Link (Event) Functions =====
 
* [[Core Function GUILink|GUILink( <gui object>, <linktype>, <action>, <param var> )]] -- Add an event (link) to a GUI object such as Click, MouseDown etc
 
* [[Core Function GUILink|GUILink( <gui object>, <linktype>, <action>, <param var> )]] -- Add an event (link) to a GUI object such as Click, MouseDown etc
 
* [[Core Function GUILinkValid|GUILinkValid( <gui object>, <linktype> )]] -- Check if a given event (link) is valid for the given GUI object
 
* [[Core Function GUILinkValid|GUILinkValid( <gui object>, <linktype> )]] -- Check if a given event (link) is valid for the given GUI object
 +
 +
===== Graphics/Pixel Functions =====
 +
* [[Core Function Colour|Colour( <name> )]] -- Get the colour INT value of a given colours name
 +
* [[Core Function ColourDialog|ColourDialog( )]] -- Allows the user to select a colour and allows you to get the RED, GREEN, BLUE etc values
 +
* [[Core Function FontDialog|FontDialog( <font> )]] -- Allows the user to select a font and allows you to get the Name, size, bold etc values
 +
 +
===== Bitmap Functions =====
 +
* [[Core Function BitmapCreate|BitmapCreate( <width>, <height> )]] -- Create a new blank bitmap object
 +
* [[Core Function BitmapGetPixel|BitmapGetPixel( <bitmap>, <x>, <y> )]] -- Get a pixel on a bitmap object
 +
* [[Core Function BitmapSetPixel|BitmapSetPixel( <bitmap>, <x>, <y>, <colour> )]] -- Alter a pixel on a bitmap object
  
 
===== Other GUI Functions =====
 
===== Other GUI Functions =====
Line 956: Line 1,004:
 
* [[Core Function ToolTipKill|ToolTipKill( <ToolTip> )]] -- Delete a tooltip that was made using ToolTip()
 
* [[Core Function ToolTipKill|ToolTipKill( <ToolTip> )]] -- Delete a tooltip that was made using ToolTip()
 
* [[Core Function PSet|PSet( <gui object>, <x>, <y>, <object> )]] -- Draw at a pixel
 
* [[Core Function PSet|PSet( <gui object>, <x>, <y>, <object> )]] -- Draw at a pixel
 +
* [[Core Function GUISendToBack|GUISendToBack( <gui object> )]] -- Send a GUI object to the back of the ZOrder
 +
* [[Core Function GUIBringToFront|GUIBringToFront( <gui object> )]] -- Send a GUI object to the front of the ZOrder
  
==== Bitmap Functions ====
+
===== Variable Type Checking etc =====
* [[Core Function BitmapCreate|BitmapCreate( <width>, <height> )]] -- Create a new blank bitmap object
+
* [[Core Function isVarGUIObject|isVarGUIObject( $variable )]] -- Check if a variable holds a GUI Object
* [[Core Function BitmapGetPixel|BitmapGetPixel( <bitmap>, <x>, <y> )]] -- Get a pixel on a bitmap object
+
* [[Core Function GetVarGUIObjType|GetVarGUIObjType( $variable )]] -- Get the common object type of a variable (If it is a GUI object)
* [[Core Function BitmapSetPixel|BitmapSetPixel( <bitmap>, <x>, <y>, <colour> )]] -- Alter a pixel on a bitmap object
+
  
 
==== Keyboard Control Functions ====
 
==== Keyboard Control Functions ====
Line 1,040: Line 1,089:
 
* [[Core Function GetBValue|GetBValue( <colour> )]] -- Get the blue byte from a colour INT value
 
* [[Core Function GetBValue|GetBValue( <colour> )]] -- Get the blue byte from a colour INT value
  
==== .NET Functions and Features ====
+
==== Sputnik Plugins (Using .NET DLLs) ====
* [[Core Function DotNet|DotNet Objects]] -- Create/use .NET objects and call instance/static method and get/set properties
+
* [[Core Function Use|Use( <name/array>, <flag> )]] -- Load a Sputnik plugin
* [[Core Function Use|Use( <name>, <flag> )]] -- Define a .NET assemblies namespace + full qualified name for use in creating .NET objects
+
* [[Core Function Unuse|Unuse( <name> )]] -- ???
* [[Core Function Unuse|Unuse( <name> )]] -- Remove a .NET namespacefrom Sputniks search group (Added by Use() function)
+
* [[Core Function UnuseAssembly|UnuseAssembly( <name> )]] -- Remove a .NET assembly from Sputniks search group (Added by Compile() function)
+
* [[Core Function Compile|Compile( <sourceCode>, <outputFile/outputType>, <includeDLLs>, <options>, <compileroptions> )]] -- Compile C# source code into a DLL(or in ram) for use in using its classes, functions etc as if they were part of Sputnik
+
* [[Core Function ObjToDotNet|ObjToDotNet( <object> )]] -- Convert a Sputnik raw object such as a TextBox from GUICreate() or anything that uses OBJECT type into a useable DotNet type
+
  
 
==== Control Flow Functions ====
 
==== Control Flow Functions ====

Latest revision as of 07:54, 20 December 2015

Contents

Function Reference

How to create a Function

To create your own funtions see the Function page.

Core Functions

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

Language Features

Parser Engine

Console Functions

Multi-Threading Functions

Variable Type Conversions

Common Variable Functions

Misc
Type Checking
Get Type Directly

Binary Data Management Functions

Binary packer/unpacker
Bit Vector
Bits
BinHex 5.0
ByteBuffer

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

NBT (Named Binary Tag)

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

NBTTagCompound
NBTTagList/NBTTagListEx
Misc Binary Functions

Bit Flag Functions

Math Functions

String Functions

Array Functions

Linq (Integrated Language Query) Functions

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

Enum Functions

Process Functions

Environment Management

File Functions

File Create/Read/Write Functions
Misc
Dialogs

Directory Functions

Dialogs

Path Functions

Network Functions

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

Memory Functions

Clipboard Functions

Registry Functions

Time & Date Functions

Old GUI Functions

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

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

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

use('SputnikOldGUI.dll', true);

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

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

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

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

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

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

Keyboard Control Functions

Mouse Control Functions

Window Management Functions

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

Controls

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

NOT AVAILABLE YET

Graphics/Pixel Functions

Sputnik Plugins (Using .NET DLLs)

Control Flow Functions

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

Internal Class Management and Information

Internal Function Management and Information

Internal Enum Management and Information

Internal DLLImport Management and Information

Internal DLLStruct Management and Information

Internal Variable/Scope Information

Eval Functions

Misc Functions

User Defined Functions

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

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox