Platforms to show: All Mac Windows Linux Cross-Platform
Back to PHPMBS class.
PHPMBS.CallbackArgumentCount as Integer
Function:
Returns the number of arguments to the callback event.
Notes: Returns 0 on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Returns 0 on any error.
PHPMBS.CallbackArgumentDouble(index as Integer) as Double
Function:
Converts the parameter with the given index to double and returns it.
Notes: Returns 0 on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Returns 0 on any error.
PHPMBS.CallbackArgumentInteger(index as Integer) as Integer
Function:
Converts the parameter with the given index to integer and returns it.
Notes: Returns 0 on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Returns 0 on any error.
PHPMBS.CallbackArgumentString(index as Integer) as string
Function:
Converts the parameter with the given index to string and returns it.
Notes: Returns an empty string on any error.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Returns an empty string on any error.
Some examples using this method:
PHPMBS.Constructor
Function:
Initializes the PHP engine.
Example:
Notes:
In older plugins this work was done by the method Init.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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
PHPMBS.Execute(code as string) as string
Function:
Runs php code.
Example: Notes: Same as run, but does not call the write event, but return the whole output as one big string.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example: 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
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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
Function:
Returns value of the variable with the given name.
Notes: Returns an empty string if the variable name is wrong.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Notes: Returns an empty string if the variable name is wrong.
Some examples using this method:
PHPMBS.Run(code as string) as boolean
Function:
Runs PHP code.
Example:
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.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Example:
dim php as PHPMBS // your php object
if php.run("echo 1+2;") then
// ok
else
// failed
end if
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)
Function:
Sets the variable with the given name to the given value.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | PHP | MBS Tools Plugin | 12.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The items on this page are in the following plugins: MBS Tools Plugin.