MBS Xojo Plugin Tutorial Videos

PHP Source

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /kunden/macsw.de/webseiten/monkeybreadsoftware-video/rbformat/rbcode.php on line 244
Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = E&xit
Const kEditClear = &Delete
End Class

Class Window1
Inherits Window
// Event implementations
Sub Open()
dim p as PHPMBS

p=new MyPHP

if not p.LoadAPI("C:\Programme\PHP\php5ts.dll") then
MsgBox "Failed to load php library."
end if

if p.init then
'MsgBox p.Execute("echo ""PHP version: "".phpversion();")

p.setVariable "test","REALbasic"

'MsgBox p.Execute("echo ""Hello world from $test."";")

'MsgBox p.Execute("print_r(get_loaded_extensions());")

'MsgBox p.Execute("echo callRealbasic(""add"",4,5);")

if p.run("echo ""Hello World"";") then
// ok
end if

if p.run("echo 1+2;") then
// ok
end if

if p.run("3u") then
MsgBox "OK"
MsgBox "failed to compile"
end if

end if

End Sub
End Class

Class MyPHP
Inherits PHPMBS
// Event implementations
Function Callback() As variant
if CallbackArgumentCount=3 then
if CallbackArgumentString(0)="add" then
dim a,b as double


Return a+b
end if
end if

Return "Hello from the callback event"

End Function
Sub Write(data as string)
MsgBox "Write got this data: "+data
End Sub
End Class

All movies

MBS Xojo PDF Plugins