Xojo Conferences

« Real Studio Black Fri… | Home | MBS Real Studio Plugi… »

Tip of the day: Console support in GUI app

You can have a GUI application in Real Studio and still take command line parameters and output to console. This means that people can launch your app by double clicking and use it normally. But someone else can write a shell script (or batch file on Windows) to call your app with command line parameters and just do a certain task. After the task is done, the app quits so it can be called again for the next batch job.

In order to do this, we have StdOutMBS class in our plugins and our latest 12.5pr plugins contain a sample project for this. You can use StdOutMBS.Write to write to the console. Be aware that some actions like showing a msgbox turn your app into a GUI app which may make it impossible to write to the standard output.

Check out the example and try to see if you can find an use for this. If you have questions, please do not hesitate to contact us.

Real Software engineers, how about having a command line switch for the Real Studio IDE to load a project, build it and quit? This way we could easier batch build projects.
23 11 12 - 18:08
two comments

How about getting the arguments passed to the app? System.Commandline is quite broken because it uses blanks as argument delimiters, making it impossible to pass paths with blanks in them as arguments,
I solved this by using declares in OSX and wih custom code in Windows, but I found no solution for Linux so far.
Does MBS offer a function that returns the arguments as an array of strings, which are built directly from the argv array?
Thomas Tempelmann (Email) - 30 11 12 - 14:24

In our sample code is a function to give arguments in string array on Mac and Windows. But not for linux so far.
Christian Schmitz (URL) - 30 11 12 - 15:42

Remember personal info?

Emoticons / Textile

Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.