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
lwdalton3Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lwdalton3Author Commented:
Actually I have partly answered my question. I guess I would use a shell script of which I know little of how to write. So lets begin with two cpp programs. If we have a program  "parameters.cpp" and another program  "process.cpp"
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
0
jkrCommented:
A script would indeed be the easiest way to accomplish that regardless of the programming languages involved. Be sure to check out http://www.freeos.com/guides/lsst/ ("Linux Shell Scripting Tutorial") and http://www.hsrl.rutgers.edu/ug/shell_help.html ("How to write a shell script"). The script itself probably will turn out to be quite simple, the idea would be to


#!/bin/bash
/path/RealBasicProc # execute part 1
/path/parameters # execute part 2
/path/process # execute part 3
echo "Done"

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lwdalton3Author Commented:
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
0
lwdalton3Author Commented:
Thank you. The shell references helped alot
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.