Command Line Switches

Prev Next

Introduction

If B4P is started with typed commands (from console command line, batch scripts, etc.) then command line switches can be provided which influence the starting and execution behavior of the B4P interpreter.

Following rules apply:

  • The actual Command line switches consist of single letters. All switches must start with one minus sign (-).
  • Command line switches may be specified in any order or combination (e.g. -w -x, -x -w, -wx, -xw)
  • Command line swithces may be located anywhere before, between and after command line arguments.
  • Invalid command line switches will provide descriptive error messages and stop the B4P interpreter.
  • Chosen command line switches are not visible to the running B4P programs


Available command line switches

Swtich Description
-c Suppress all console specific features (use standard input instead of console input, no console control like cursor movement and colors). Use this switch for batch processing.
-d Normally, at start-up, B4P changes the working directory to the directory where the B4P program file to execute is located.
This command line switch suppresses this and leaves the working directory unchanged.
-i (lower-case i) Start B4P and enter interactive mode immediately. Even if a B4P program has been specified, the program will not be loaded and started.
-I (upper-case i) MacOS / Linux only: Starty B4P in installation mode where the welcoming text and loading library files are skipped. Not recommended for regular B4P program use. The switch '-c' will also come effective here to suppress console features.
-w Suppress B4P welcome text.
Attention 1: Also the license info text (e.g. demo mode only if no valid license exists) will be hidden.
Attention 2: The B4P initialization program "B4P Init.b4p" will not be started. This file would otherwise load the default B4P library files (e.g. "Support Library").
The system variable runtime settings[verbose] is set to quiet. This feature is useful for batch scripts which shall run fast and not outputting unnecessary text.
-q Starts the B4P program with runtime settings[verbose]= quiet to suppress any unnecessary output.
To suppress the welcome text, too, use teh command lie swtich -w, too.
-x Skip the "Press [Enter] to end the program" before B4P is exiting. Useful for running B4P programs from batch scripts without user interaction

5 ways to start B4P with the same command line switches
  b4p -wx myprogram.b4p   // All 5 variations are equivalent.
  b4p myprogram.b4p -wx
  b4p myprogram.b4p -xw
  b4p -w -x myprogram.b4p
  b4p myprogram.b4p -w -x

See also

Starting Behavior