Platforms to show: All Mac Windows Linux Cross-Platform

Back to PHPMBS class.

PHPMBS.CallbackArgumentCount as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Returns the number of arguments to the callback event.
Notes: Returns 0 on any error.
PHPMBS.CallbackArgumentDouble(index as Integer) as Double
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Converts the parameter with the given index to double and returns it.
Notes: Returns 0 on any error.
PHPMBS.CallbackArgumentInteger(index as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Converts the parameter with the given index to integer and returns it.
Notes: Returns 0 on any error.
PHPMBS.CallbackArgumentString(index as Integer) as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Converts the parameter with the given index to string and returns it.
Notes: Returns an empty string on any error.

Some examples using this method:

PHPMBS.Constructor
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Initializes the PHP engine.
Example:
const path="php.dll"
call PHPMBS.LoadLibrary(path) // load the dll
dim p as new PHPMBS // initialize

if p.inited then // worked?
msgbox "ok"
end if
Notes: In older plugins this work was done by the method Init.
PHPMBS.Execute(code as string) as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Runs php code.
Example:
dim p as PHPMBS

p=new PHPMBS
MsgBox p.Execute("echo ""Hello"";")
Notes: Same as run, but does not call the write event, but return the whole output as one big string.
PHPMBS.existsVariable(name as string) as boolean
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Checks whether variable exists or not.
Notes: getVariable returns "" for variables which don't exist, but your variable may just be an empty string so this function lets you know whether the variable actually exists.
PHPMBS.getVariable(name as string) as string
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Returns value of the variable with the given name.
Notes: Returns an empty string if the variable name is wrong.

Some examples using this method:

PHPMBS.Run(code as string) as boolean
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Runs PHP code.
Example:
dim php as PHPMBS // your php object

if php.run("echo 1+2;") then
// ok
else
// failed
end if
Notes:
Returns true on success.
Returns false on any compilation error or the library is not loaded/available.

You need to wrap your code into exception handlers as the plugin will ignore all exceptions and if you want to find errors, you need to catch them yourself.
PHPMBS.setVariable(name as string, value as string)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method PHP MBS Tools Plugin 12.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Sets the variable with the given name to the given value.

The items on this page are in the following plugins: MBS Tools Plugin.


💬 Ask a question or report a problem
The biggest plugin in space...