Function Reference

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Misc Functions)
(Misc Functions)
Line 1,035: Line 1,035:
 
* [[Core Function Redo|Redo( )]] -- Continue the execution of a loop at the start of the current iteration
 
* [[Core Function Redo|Redo( )]] -- Continue the execution of a loop at the start of the current iteration
  
==== Misc Functions ====
+
==== Internal Class Management and Information ====
* [[Core Function Exit|Exit( <exitCode> )]] -- Instantly terminate the program/script
+
* [[Core Function ClassExists|ClassExists( <expression> )]] -- Check if a given Class exists
* [[Core Function Serialize|Serialize( <variable> )]] -- Convert a variable, array, class etc a string you can save to file or transfer over the internet
+
* [[Core Function ClassList|ClassList( <expression>, <inherits> )]] -- Return an array of all user defined classes (Or just ones fitting a given pattern)
* [[Core Function Unserialize|Unserialize( <string> )]] -- Convert a string (Created with Serialize()) into its original variable/class/array etc
+
* [[Core Function ClassInfo|ClassInfo( <class> )]] -- Get a vast amount of *behind the scene* information on a class and its functions, properties and so on
* [[Core Function Assert|Assert( <toCheck>, <errorMsg> )]] -- Check if value is true (if so returns it) if it is notthen an exception is thrown with a default or user provided (second argument) error message
+
* [[Core Function ClassStack|ClassStack( <variable> )]] -- Return a reference to a classes internal variable stack (as an array) (or set the class stack from an existing array)
* [[Core Function IsOverloaded|IsOverloaded( <class>, <overload> )]] -- Check if a given cast/operator overload exists within a class
+
* [[Core Function ClassName|ClassName( <variable> )]] -- Return the name of the class on a variable or a class this code is running inside of (automatically uses $this if no param is given)
 +
* [[Core Function UnsetClass|UnsetClass( <class-name> )]] -- Delete a previous user defined Class from Sputnik
 
* [[Core Function New|New( <classConstruction> )]] -- Create a new instance of a given class name optionally with parameters to be sent to the __Construct function of the new class
 
* [[Core Function New|New( <classConstruction> )]] -- Create a new instance of a given class name optionally with parameters to be sent to the __Construct function of the new class
* [[Core Function Clone|Clone( <object> )]] -- Create a clone of a clone-able object
 
* [[Core Function Warn|Warn( <message> )]] -- Show a warning message with source file name and line number
 
 
* [[Core Function NewClass|newClass( <name>, <params> )]] -- Create a new instance of a class by its name as a string
 
* [[Core Function NewClass|newClass( <name>, <params> )]] -- Create a new instance of a class by its name as a string
 
* [[Core Function NewClassFromArray|NewClassFromArray( <name>, <array>, <wakeUp> )]] -- Create a new instance of a class by its name and an array of its values
 
* [[Core Function NewClassFromArray|NewClassFromArray( <name>, <array>, <wakeUp> )]] -- Create a new instance of a class by its name and an array of its values
 
* [[Core Function ConvertClass|ConvertClass( <oldClass>, <name>, <wakeUp> )]] -- Create a new instance of a class by its name and copy the values from another class
 
* [[Core Function ConvertClass|ConvertClass( <oldClass>, <name>, <wakeUp> )]] -- Create a new instance of a class by its name and copy the values from another class
* [[Core Function AddPath|AddPath( <path> )]] -- Add a directory to the search list when using ParsePath() and all other functions such as Include(), Require() etc
+
* [[Core Function IsOverloaded|IsOverloaded( <class>, <overload> )]] -- Check if a given cast/operator overload exists within a class
* [[Core Function DelPath|DelPath( <path> )]] -- Remove a directory from the search list when using ParsePath() and all other functions such as Include(), Require() etc
+
 
 +
==== Internal Function Management and Information ====
 +
* [[Core Function FunctionExists|FunctionExists( <expression> )]] -- Check if a given Function exists
 +
* [[Core Function FunctionList|FunctionList( <expression>, <class> )]] -- Return an array of all user defined functions (Or just ones fitting a given pattern)
 +
* [[Core Function FunctionInfo|FunctionInfo( <function> )]] -- Get a vast amount of *behind the scene* information on a function
 +
* [[Core Function UnsetFunction|UnsetFunction( <function-name> )]] -- Delete a previous user defined Function from Sputnik
 +
* [[Core Function UnsetCoreFunction|UnsetCoreFunction( <function-name> )]] -- Delete a core function from Sputnik
 +
* [[Core Function CoreFunctionExists|CoreFunctionExists( <expression> )]] -- Check if a given Core Function exists
 +
* [[Core Function CoreFunctionList|CoreFunctionList( <expression> )]] -- Return an array of all core functions (Or just ones fitting a given pattern)
 +
* [[Core Function Eval|Eval( <expression>, <flag>, <cleanup>, <printToReturn> )]] -- Evaluate a string as Sputnik code
 
* [[Core Function MKFunc|MKFunc(<params>, <body>)]] -- Create a user defined function to be called from a variable
 
* [[Core Function MKFunc|MKFunc(<params>, <body>)]] -- Create a user defined function to be called from a variable
 
* [[Core Function CallFunc|CallFunc( <function>, <array>)]] -- Calls a user defined function contained in a variable
 
* [[Core Function CallFunc|CallFunc( <function>, <array>)]] -- Calls a user defined function contained in a variable
 
* [[Core Function Call|Call(<function/array>, <expressions>)]] -- Calls a function contained in a string parameter
 
* [[Core Function Call|Call(<function/array>, <expressions>)]] -- Calls a function contained in a string parameter
 
* [[Core Function CallArray|CallArray( <function/array>, <array>)]] -- Calls a function contained in a string parameter
 
* [[Core Function CallArray|CallArray( <function/array>, <array>)]] -- Calls a function contained in a string parameter
* [[Core Function 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)
+
==== Internal Enum Management and Information ====
* [[Core Function Eval|Eval( <expression>, <flag>, <cleanup>, <printToReturn> )]] -- Evaluate a string as Sputnik code
+
* [[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
 +
 
 +
==== Eval Functions ====
 
* [[Core Function EvalSyntax|EvalSyntax( <expression> )]] -- Evaluate a string as Sputnik code but only check if it's syntax is valid
 
* [[Core Function EvalSyntax|EvalSyntax( <expression> )]] -- Evaluate a string as Sputnik code but only check if it's syntax is valid
 
* [[Core Function EvalCreate|EvalCreate( )]] -- Create an Eval object for use with Eval()
 
* [[Core Function EvalCreate|EvalCreate( )]] -- Create an Eval object for use with Eval()
 
* [[Core Function EvalSet|EvalSet( <evalObject>, <name>, <value> )]] -- Set a variable inside an Eval Object
 
* [[Core Function EvalSet|EvalSet( <evalObject>, <name>, <value> )]] -- Set a variable inside an Eval Object
 
* [[Core Function EvalGet|EvalGet( <evalObject>, <name>, <value> )]] -- Get a from variable inside an Eval Object
 
* [[Core Function EvalGet|EvalGet( <evalObject>, <name>, <value> )]] -- Get a from variable inside an Eval Object
 +
 +
==== Misc Functions ====
 +
* [[Core Function Exit|Exit( <exitCode> )]] -- Instantly terminate the program/script
 +
* [[Core Function Assert|Assert( <toCheck>, <errorMsg> )]] -- Check if value is true (if so returns it) if it is notthen an exception is thrown with a default or user provided (second argument) error message
 +
* [[Core Function Clone|Clone( <object> )]] -- Create a clone of a clone-able object
 +
* [[Core Function Warn|Warn( <message> )]] -- Show a warning message with source file name and line number
 
* [[Core Function GC|GC( <flag> )]] -- Use the garbage collector
 
* [[Core Function GC|GC( <flag> )]] -- Use the garbage collector
 
* [[Core Function HWND|HWND( )]] -- Get the HWND of the hidden window used by this program (It handles hotkeys etc)
 
* [[Core Function HWND|HWND( )]] -- Get the HWND of the hidden window used by this program (It handles hotkeys etc)
 
* [[Core Function Require|Require( <file>, <flag> )]] -- Add all functions etc from a file for use
 
* [[Core Function Require|Require( <file>, <flag> )]] -- Add all functions etc from a file for use
 
* [[Core Function Include|Include( <file>, <flag> )]] -- Add all functions etc from a file for use and execute all expressions
 
* [[Core Function Include|Include( <file>, <flag> )]] -- Add all functions etc from a file for use and execute all expressions
* [[Core Function CGIConsole|CGIConsole( )]] -- Changes the console printing to work best a CGI instead of stand alone terminal
 
 
* [[Core Function Opt|Opt( <option>, <value> )]] -- Changes the operation of various Sputnik functions/parameters
 
* [[Core Function Opt|Opt( <option>, <value> )]] -- Changes the operation of various Sputnik functions/parameters
* [[Core Function UnsetFunction|UnsetFunction( <function-name> )]] -- Delete a previous user defined Function from Sputnik
 
* [[Core Function UnsetCoreFunction|UnsetCoreFunction( <function-name> )]] -- Delete a core function from Sputnik
 
* [[Core Function UnsetClass|UnsetClass( <class-name> )]] -- Delete a previous user defined Class from Sputnik
 
* [[Core Function UnsetEnum|UnsetEnum( <enum-name> )]] -- Delete a previous user defined Enum from Sputnik
 
* [[Core Function UnsetDLLStruct|UnsetDLLStruct( <dllstruct-name> )]] -- Delete a previous user defined DLLStruct from Sputnik
 
* [[Core Function UnsetDLLImport|UnsetDLLImport( <dllimport-function-name> )]] -- Delete a function imported using the DLLImport() function
 
* [[Core Function FunctionExists|FunctionExists( <expression> )]] -- Check if a given Function exists
 
* [[Core Function ClassName|ClassName( <variable> )]] -- Return the name of the class on a variable or a class this code is running inside of (automatically uses $this if no param is given)
 
* [[Core Function ClassStack|ClassStack( <variable> )]] -- Return a reference to a classes internal variable stack (as an array) (or set the class stack from an existing array)
 
* [[Core Function ClassExists|ClassExists( <expression> )]] -- Check if a given Class exists
 
* [[Core Function EnumExists|EnumExists( <expression> )]] -- Check if a given Enum exists
 
* [[Core Function DLLStructExists|DLLStructExists( <expression> )]] -- Check if a given DLLStruct exists
 
* [[Core Function DLLImportExists|DLLImportExists( <expression> )]] -- Check if a given DLLImport exists
 
* [[Core Function FunctionList|FunctionList( <expression>, <class> )]] -- Return an array of all user defined functions (Or just ones fitting a given pattern)
 
* [[Core Function ClassList|ClassList( <expression>, <inherits> )]] -- Return an array of all user defined classes (Or just ones fitting a given pattern)
 
* [[Core Function EnumList|EnumList( <expression> )]] -- Return an array of all user defined enums (Or just ones fitting a given pattern)
 
* [[Core Function DLLStructList|DLLStructList( <expression> )]] -- Return an array of all user defined dllstructs (Or just ones fitting a given pattern)
 
* [[Core Function DLLImportList|DLLImportList( <expression> )]] -- Return an array of all user defined dllimports (Or just ones fitting a given pattern)
 
 
* [[Core Function IsAdmin|IsAdmin( )]] -- Check if the script is running in admin mode or not (Run as administrator)
 
* [[Core Function IsAdmin|IsAdmin( )]] -- Check if the script is running in admin mode or not (Run as administrator)
 
* [[Core Function ObjToVar|ObjToVar( <variable> )]] -- Convert a $variable's object to its compatible $variable data type
 
* [[Core Function ObjToVar|ObjToVar( <variable> )]] -- Convert a $variable's object to its compatible $variable data type

Revision as of 09:24, 21 June 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

Math Functions

String Functions

CharPtr Functions

Note the Fixed statement is tied directly with CharPtr

Array Functions

Linq (Integrated Language Query) Functions

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

GUI Functions

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
Common Dialog/Control Functions
GUI Link (Event) Functions
Other GUI Functions

Bitmap Functions

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

.NET Functions and Features

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

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