Function Reference

From Sputnik Wiki
Jump to: navigation, search


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

Type Checking
Get Type Directly

Binary Data Management Functions

Binary packer/unpacker
Bit Vector
BinHex 5.0

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.

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

Directory Functions


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
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) )


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


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