Command Line Syntax Display

When no source file is specified this procedure simply displays Turbo Pascal command line syntax with default switch states.
Procedure WriteSyntax;

  Function Switch (Sw: TCompilerSwitches): Char;
  begin
    If Sw in GlobalModuleData^.CompilerSwitches then Switch := '+'
      else Switch := '-';
  end;

begin
  Writeln ('Syntax: TPC [options] filename [options]');
  Writeln ('  -B = Build all units                -L = Link buffer on disk');
  Writeln ('  -D<syms> = Define conditionals      -M = Make modified units');
  Writeln ('  -E<path> = EXE/TPU directories      -O<path> = Object directories');
  Writeln ('  -F<seg>:<ofs> = Find error          -Q = Quiet compile');
  Writeln ('  -GD = Detailed map file             -T<path> = TPL/CFG directory');
  Writeln ('  -GP = Map file with publics         -U<path> = Unit directories');
  Writeln ('  -GS = Map file with segments        -V = Debug information in EXE');
  Writeln ('  -I<path> = Include directories      -$<dir> = Compiler directive');
  Writeln ('Compiler switches: -$<letter><state>  (defaults are shown below)');
  Writeln ('  A', Switch (WordAlignment),' Word alignment       I',
                  Switch (IOErrorChecking),' I/O error checking   R',
                  Switch (RangeChecking),' Range checking');
  Writeln ('  B', Switch (FullBooleanEval),' Full boolean eval    L',
                  Switch (LocalDebugSymbols),' Local debug symbols  S',
                  Switch (StackChecking),' Stack checking');
  Writeln ('  D', Switch (DebugInformation),' Debug information    N',
                  Switch (Instructions80x87),' 80x87 instructions   T',
                  Switch (TypedPointers),' Typed pointers');
  Writeln ('  E', Switch (Emulation80x87),' 80x87 emulation      O',
                  Switch (OverlaysAllowed),' Overlays allowed     V',
                  Switch (StrictVarStrings),' Strict var-strings');
  Writeln ('  F', Switch (ForceFarCalls),' Force FAR calls      P',
                  Switch (OpenStringParams),' Open string params   X',
                  Switch (ExtendedSyntax),' Extended syntax');
  Writeln ('  G', Switch (Instructions80286),' 80286 instructions   Q',
                  Switch (OverflowChecking),' Overflow checking');
  Writeln ('Memory sizes: -$M<stack>,<heapmin>,<heapmax>  (default: ',
            GlobalModuleData^.Stack, ',',
            Longint (GlobalModuleData^.HeapMin) * 16, ',',
            Longint (GlobalModuleData^.HeapMax) * 16, ')');
end;
 
 
 
© 2017 Turbo Pascal | Privacy Policy