lwdalton3
asked on
Turning control of a RealBasic program over to C++(G++)
Hello. I don't really want to write a plug-in for RealBasic per se. As per prior questions I find the C++ GUI's (especially Qt) extremely difficult. While not GNU I have to give RealBasic credit for writing a GUI interface that is much more intuitive than Qt. Therefore I would like to use RealBasic's GUI to enter data, and then execute C++ programs I have already written. The C++ application is some datamining software I use for my peculiar area of research. All I need to do is store data entry from RealBasic into to a file and then when the C++ program is executed it reads the RealBasic generated "parameters" file and knows how to process the file in question. I was running the C++ application from the console, and entering parameters with a spreadsheet form, but now want to pretty all up with a customized GUI. So the outline is:
Begin RealBasic --> data entry --> RealBasic stores data entry into file "parameters.txt" --> RealBasic quits and C++ program takes over -->
C++ loads parameters.txt and also File_to_be_mined.txt --> C++ writes processed file.
It is the passing of the baton from RealBasic to G++ that I can't figure out
I use G++ under Linux Fedora 7. I checked VB, but use RealBasic
Please if possible write the exact command(s) I need (a snippet) if such exists.
I appreciate your help in advance
Thanks LD
Begin RealBasic --> data entry --> RealBasic stores data entry into file "parameters.txt" --> RealBasic quits and C++ program takes over -->
C++ loads parameters.txt and also File_to_be_mined.txt --> C++ writes processed file.
It is the passing of the baton from RealBasic to G++ that I can't figure out
I use G++ under Linux Fedora 7. I checked VB, but use RealBasic
Please if possible write the exact command(s) I need (a snippet) if such exists.
I appreciate your help in advance
Thanks LD
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello
Using hints about shell I finished answering my own question. RealBasic has a shell class. I built a pushbutton and an edifield, and thats all that is needed for the very basics The folowing code in realbasic will execute a C++ program (C++ program and makefile in same directory as realbasic exec) The command line results will be displayed in the RealBasic editfield. One doesnt need to have the command line open. So this was much easier for me than dealing with Qt
dim cmd as string
dim cmd2 as string
dim s as new shell
s = new shell
#if targetmacos or targetlinux and not(targetmacosclassic)
cmd="make"
cmd2 =" ./dm_toolkit_class"
#elseif targetwin32
cmd="set"
#endif
s.execute cmd //runs make
s.execute cmd2 // runs object
if s.errorcode=0 then
editfield1.text = s.result
else
editfield1.text = "error " +str(s.errorcode)
end if
Using hints about shell I finished answering my own question. RealBasic has a shell class. I built a pushbutton and an edifield, and thats all that is needed for the very basics The folowing code in realbasic will execute a C++ program (C++ program and makefile in same directory as realbasic exec) The command line results will be displayed in the RealBasic editfield. One doesnt need to have the command line open. So this was much easier for me than dealing with Qt
dim cmd as string
dim cmd2 as string
dim s as new shell
s = new shell
#if targetmacos or targetlinux and not(targetmacosclassic)
cmd="make"
cmd2 =" ./dm_toolkit_class"
#elseif targetwin32
cmd="set"
#endif
s.execute cmd //runs make
s.execute cmd2 // runs object
if s.errorcode=0 then
editfield1.text = s.result
else
editfield1.text = "error " +str(s.errorcode)
end if
ASKER
Thank you. The shell references helped alot
ASKER
how would the shell script look to run "parameters.cpp" followed by "process.cpp"
After I see how two .cpp programs are run consecutively maybe I can figure out how to do the same with a basic to a cpp.
Thanks LD