exec()
Re: exec()
What kind of script are you talking about? VBS, Javascript, LUA....
I may look like a mule, but I'm not a complete ass.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: exec()
Purebasic is not a script language.cybergeek wrote:purebasic of course
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: exec()
There is no 'of course' about it since, as Gnozal points out, Purebasic is not a scripting language and is not offered as such by the PB team.cybergeek wrote:purebasic of course
I may look like a mule, but I'm not a complete ass.
- flaith
- Enthusiast
- Posts: 704
- Joined: Mon Apr 25, 2005 9:28 pm
- Location: $300:20 58 FC 60 - Rennes
- Contact:
Re: exec()
can call an external program if you wantRunProgram
“Fear is a reaction. Courage is a decision.” - WC
Re: exec()
sorry... i didnt mean script but a programming language
i want an exec function
PBcode$ = ;code + # LF + code
exec(pbcode$)
should work dynamically
i want an exec function
PBcode$ = ;code + # LF + code
exec(pbcode$)
should work dynamically
PUREBASIC is AWSUM
Re: exec()
Then you will have to write a scripting engine which works with PB type source.
You cannot expect this natively of what is a native compiler.
You cannot expect this natively of what is a native compiler.
I may look like a mule, but I'm not a complete ass.
Re: exec()
looked at a thread RUN TIME COMPILER http://www.purebasic.fr/english/viewtop ... 3&p=332022
need like that
damn needed this
need like that
damn needed this
PUREBASIC is AWSUM
-
- User
- Posts: 10
- Joined: Thu Aug 05, 2010 4:15 pm
Re: exec()
I hope this code can help you!cybergeek wrote:sorry... i didnt mean script but a programming language
i want an exec function
PBcode$ = ;code + # LF + code
exec(pbcode$)
should work dynamically
Code: Select all
Prototype CallHandler()
Declare gogo()
WinH = OpenWindow(0,50,50,320,200,"MainWindow",#PB_Window_SystemMenu)
If WinH <> 0
handler.Callhandler
ButtonGadget(0,50,50,120,50,"OK")
handler = @gogo()
Repeat
Event = WindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 0
handler()
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
End
Procedure gogo()
MessageRequester("Message","Sucess!")
EndProcedure
Re: exec()
He wants to execute PB code dynamically from his own application, not trap a button click! 

I may look like a mule, but I'm not a complete ass.
-
- Addict
- Posts: 4777
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: exec()
cybergeek,
you might want to take a look at Lua. It's a nice scripting language, that can co-operate with PB. AFAIR there's a PB library for this purpose somewhere around here.
Regards, Little John
you might want to take a look at Lua. It's a nice scripting language, that can co-operate with PB. AFAIR there's a PB library for this purpose somewhere around here.
Regards, Little John
- NicknameFJ
- User
- Posts: 90
- Joined: Tue Mar 17, 2009 6:36 pm
- Location: Germany
Re: exec()
Hi,
I think I can remember that in the german Forum someone has written a script language with PB-Syntax. I don´t know who it was, just right now, but I´m searching for.
This script language, I guess, is like an PB-Interpreter which can execute PB-Syntax-Scripts dynamically.
Greetings
NicknameFJ
/edit: I found it - here´s the link
http://www.purebasic.fr/german/viewtopi ... 46&start=0
I think I can remember that in the german Forum someone has written a script language with PB-Syntax. I don´t know who it was, just right now, but I´m searching for.
This script language, I guess, is like an PB-Interpreter which can execute PB-Syntax-Scripts dynamically.
Greetings
NicknameFJ
/edit: I found it - here´s the link
http://www.purebasic.fr/german/viewtopi ... 46&start=0
PS: Sorry for my weird english, but english is not my native language.


Re: exec()
thx.. but i dont know german ... transalation is very bad ..NicknameFJ wrote:Hi,
/edit: I found it - here´s the link
http://www.purebasic.fr/german/viewtopi ... 46&start=0
but still tried and couldnt get it to work
Code: Select all
Define *ByteCode
script.s = "MessageRequester(" + Chr(34) + "Information" + Chr(34) + "," + Chr(34) + "Just a short information text" + Chr(34) + "," + Chr(34) + "#PB_MessageRequester_Ok)"
*ByteCode = PBSCompileScriptString(script)
If PBSOpenByteMemory(0, *ByteCode)
PBSStartByteCode(0)
EndIf
PUREBASIC is AWSUM
Re: exec()
perhaps this will work for you
looks like you had an extra Chr(34) in there
Code: Select all
Define *ByteCode
script.s = "MessageRequester(" + Chr(34) + "Information" + Chr(34) + "," + Chr(34) + "Just a short information text" + Chr(34) + "," + "#PB_MessageRequester_Ok)"
*ByteCode = PBSCompileScriptString(script)
If PBSOpenByteMemory(0, *ByteCode)
PBSStartByteCode(0)
EndIf
there is no sig, only zuul (and the following disclaimer)
WARNING: may be talking out of his hat
WARNING: may be talking out of his hat