LuaScript Xojo and Real Studio Plugin

LuaScriptContext Class (console safe)

This class is used in Xojo or Real Studio functions that you expose to Lua. The purpose of this class is to get parameters from Lua and to send return values to Lua. This class is also the base class of the LuaScript class.

Object
   LuaScriptContext

class LuaScriptContext

Constructors

LuaScriptContextConstructor that constructs the LuaScriptContext from a Ptr in a REALbasic function that Lua is calling.

Properties

ParameterCount (console safe) Returns the number of parameters.

Methods

GetBoolean (console safe) Fetches a boolean value from the stack
GetCurrentLine (console safe) Returns the current line that is executing in the Lua script.
GetDouble (console safe) Fetches a double value from the stack
GetGlobalBoolean (console safe) Gets a global boolean variable by name.
GetGlobalDouble (console safe) Gets a global Double variable by name.
GetGlobalInteger (console safe) Gets a global integer variable by name.
GetGlobalObject (console safe) Gets a global Xojo or Real Studio object variable by name.
GetGlobalString (console safe) Gets a global string variable by name.
GetGlobalTable (console safe) Gets a global table variable by name and puts it at top of the stack.
GetInteger (console safe) Fetches a integer value from the stack
GetLength (console safe) If checking length of a string element then this returns the string length, if checking the length of a Lua table then this returns the same as the Lua # operator returns.
GetNext (console safe) Used to traverse tables. Returns zero if no next element was found else non zero value
GetObject (console safe) Fetches a Xojo or Real Studio object value from the stack
GetStackTrace (console safe) Gets stack trace of the current code execution.
GetString (console safe) Fetches a string value from the stack
GetTableValue (console safe) Pushes a table value to the top of the stack
IsBoolean (console safe) Checks if a item on the stack is a boolean variable.
IsNil (console safe) Checks if a item on the stack is a nil.
IsNone (console safe) Checks if a item on the stack is none.
IsNumber (console safe) Checks if a item on the stack is a double variable.
IsObject (console safe) Checks if a item on the stack is a REALbasic object variable.
IsString (console safe) Checks if a item on the stack is a string variable.
IsTable (console safe) Checks if a item on the stack is a table.
NewTable (console safe) Creates a new empty table structure.
Pop (console safe) Pops one item from the stack.
Push (console safe) Pushes a Integer value to the stack. This is often used to return values from a function.
Push (console safe) Pushes a Double value to the stack. This is often used to return values from a function.
Push (console safe) Pushes a String value to the stack. This is often used to return values from a function.
Push (console safe) Pushes a Boolean value to the stack. This is often used to return values from a function.
Push (console safe) Pushes a Xojo or Real Studio object to the stack. This is often used to return values from a function.
PushFunction (console safe) Pushes a function to the stack. (This is often used to define classes from within Xojo or Real Studio that are exposed to Lua)
PushNil (console safe) Pushes a Lua nil onto the stack. This is sometimes used when traversing table content.
SetError (console safe) Raises a error. Use this function from within a Xojo or Real Studio function that is registered to be exposed to Lua.
SetGlobal (console safe) Sets a global Boolean variable.
SetGlobal (console safe) Sets a global double variable.
SetGlobal (console safe) Sets a global integer variable.
SetGlobal (console safe) Sets a global string variable.
SetGlobal (console safe) Sets the top most element of the stack as global. (This is often used for tables)
SetGlobal (console safe) Sets a global Xojo or Real Studio object variable.
SetTableValue (console safe) Takes two top most elements on the stacks and sets them as table element pair. (Key and Value)
WireInstanceToClass (console safe) Wires a table instance that represents the data of a class to a Lua class declaration.

Supported Platforms:

  • MacOS X Carbon
  • MacOS X Cocoa
  • Win32 - Windows
  • Linux x86

    Unsupported Platforms: