Author Topic: command line options  (Read 514 times)

0 Members and 1 Guest are viewing this topic.

Offline IronMan

  • Newbie
  • Posts: 38
command line options
« on: March 27, 2020, 06:52:11 PM »
I have a small application that i am using InForm to show one Form with a progress bar. That's all it does is pop up, show the progress bar why the app is running, and then ends. Would there be a way to run the application and be able to use a command line option to run it without showing the Form and progress bar? in other words, if I executed the application with a command line option like /n or whatever, to avoid showing the Form and running it in a non-graphical mode. Would this be possible?

Something like:

 application.exe          '   Runs normal and displays graphical version

 application.exe  /n     '  Does not show Form or anything on screen by still runs

Hope this is not too confusing.

Any help is appreciated.

- Kent

Marked as best answer by IronMan on March 27, 2020, 11:34:02 PM

Offline FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 2712
  • LET IT = BE
Re: command line options
« Reply #1 on: March 27, 2020, 06:55:10 PM »
Add this to the beginning of your main module:

Code: QB64: [Select]

Then use COMMAND$() to check whether there were parameters (remember COMMAND$ is an array and goes from 1 to _COMMANDCOUNT). If the parameter to hide the screen is used, call:

Code: QB64: [Select]

before the SUB section starts in the main module and add the console-only code. Don't forget to end it with SYSTEM, so control is given back to the command prompt.