How to use PALCMD.EXE and PALCMD32.EXE

Top  Previous  Next

 

The standalone command-line version PALCMD.EXE (and 32-bits PALCMD32.EXE) is useful when you want to automate the process of creating reports. PALCMD.EXE uses the same engine as the GUI version PAL.EXE and produces the same output.

 

Run PALCMD.EXE from the command prompt using the following syntax:

 

PALCMD projectpath|sourcepath [options]

 

Option

Explanation

/A+        

Parse both source/form files

/A-

Parse source files only

/FA

Parse all files

/F+

Parse all files

/FR

Parse main file and directly used files

/FM

Parse main file only

/F-

Parse main file only

/Q

Quiet mode



/CBP        

Borland Pascal 7 (or earlier)

/CD1

Delphi 1

/CD2

Delphi 2

/CD3

Delphi 3

/CD4

Delphi 4

/CD5

Delphi 5

/CD6

Delphi 6

/CD7

Delphi 7

/CD8

Delphi 8 for .NET

/CD9W

Delphi 2005 for Win32

/CD9N

Delphi 2005 for .NET

/CD10W

Delphi 2006 for Win32 (also Turbo Delphi for Win32)

/CD10N

Delphi 2006 for .NET   (also Turbo Delphi for .NET)

/CD11W

Delphi 2007 for Win32

/CD11N

Delphi 2007 for .NET

/CD12W

Delphi 2009 for Win32

/CD14W

Delphi 2010 for Win32

/CDXEW

Delphi XE for Win32



/CDXE2W32

Delphi XE2 for Win32

/CDXE2W64

Delphi XE2 for Win64

/CDXE2OSX

Delphi XE2 for OSX



/CDXE3W32

Delphi XE3 for Win32

/CDXE3W64

Delphi XE3 for Win64

/CDXE3OSX

Delphi XE3 for OSX



/CDXE4W32

Delphi XE4 for Win32

/CDXE4W64

Delphi XE4 for Win64

/CDXE4OSX

Delphi XE4 for OSX

/CDXE4IOSDEV

Delphi XE4 for iOS Device

/CDXE4IOSSIM

Delphi XE4 for iOS Simulator



/CDXE5W32

Delphi XE5 for Win32

/CDXE5W64

Delphi XE5 for Win64

/CDXE5OSX

Delphi XE5 for OSX

/CDXE5IOSDEV

Delphi XE5 for iOS Device

/CDXE5IOSSIM

Delphi XE5 for iOS Simulator

/CDXE5ANDROID

Delphi XE5 for Android



/CDXE6W32

Delphi XE6 for Win32

/CDXE6W64

Delphi XE6 for Win64

/CDXE6OSX

Delphi XE6 for OSX

/CDXE6IOSDEV

Delphi XE6 for iOS Device

/CDXE6IOSSIM

Delphi XE6 for iOS Simulator

/CDXE6ANDROID

Delphi XE6 for Android



/CDXE7W32

Delphi XE7 for Win32

/CDXE7W64

Delphi XE7 for Win64

/CDXE7OSX

Delphi XE7 for OSX

/CDXE7IOSDEV

Delphi XE7 for iOS Device

/CDXE7IOSSIM

Delphi XE7 for iOS Simulator

/CDXE7ANDROID

Delphi XE7 for Android



/CDXE8W32

Delphi XE8 for Win32

/CDXE8W64

Delphi XE8 for Win64

/CDXE8OSX

Delphi XE8 for OSX

/CDXE8IOSDEV

Delphi XE8 for iOS Device 32-bits

/CDXE8IOSDEV64

Delphi XE8 for iOS Device 64-bits

/CDXE8IOSSIM

Delphi XE8 for iOS Simulator

/CDXE8ANDROID

Delphi XE8 for Android



/CD10W32

Delphi 10 for Win32

/CD10W64

Delphi 10 for Win64

/CD10OSX

Delphi 10 for OSX

/CD10IOSDEV

Delphi 10 for iOS Device 32-bits

/CD10IOSDEV64

Delphi 10 for iOS Device 64-bits

/CD10IOSSIM

Delphi 10 for iOS Simulator

/CD10ANDROID

Delphi 10 for Android



/CD101W32

Delphi 10.1 for Win32

/CD101W64

Delphi 10.1 for Win64

/CD101OSX

Delphi 10.1 for OSX

/CD101IOSDEV

Delphi 10.1 for iOS Device 32-bits

/CD101IOSDEV64

Delphi 10.1 for iOS Device 64-bits

/CD101IOSSIM

Delphi 10.1 for iOS Simulator

/CD101ANDROID

Delphi 10.1 for Android



/CD102W32

Delphi 10.2 for Win32

/CD102W64

Delphi 10.2 for Win64

/CD102OSX

Delphi 10.2 for OSX

/CD102IOSDEV

Delphi 10.2 for iOS Device 32-bits

/CD102IOSDEV64

Delphi 10.2 for iOS Device 64-bits

/CD102IOSSIM

Delphi 10.2 for iOS Simulator

/CD102ANDROID

Delphi 10.2 for Android

/CD102LINUX64

Delphi 10.2 for Linux 64-bits



/CD103W32

Delphi 10.3 for Win32

/CD103W64

Delphi 10.3 for Win64

/CD103OSX

Delphi 10.3 for OSX 32-bits

/CD103OSX64

Delphi 10.3 for OSX 64-bits

/CD103IOSDEV

Delphi 10.3 for iOS Device 32-bits

/CD103IOSDEV64

Delphi 10.3 for iOS Device 64-bits

/CD103IOSSIM

Delphi 10.3 for iOS Simulator

/CD103ANDROID

Delphi 10.3 for Android 32-bits

/CD103ANDROID64

Delphi 10.3 for Android 64-bits

/CD103LINUX64

Delphi 10.3 for Linux 64-bits



/CD104W32

Delphi 10.4 for Win32

/CD104W64

Delphi 10.4 for Win64

/CD104OSX

Delphi 10.4 for OSX 32-bits

/CD104OSX64

Delphi 10.4 for OSX 64-bits

/CD104IOSDEV

Delphi 10.4 for iOS Device 32-bits

/CD104IOSDEV64

Delphi 10.4 for iOS Device 64-bits

/CD104IOSSIM

Delphi 10.4 for iOS Simulator

/CD104ANDROID

Delphi 10.4 for Android 32-bits

/CD104ANDROID64

Delphi 10.4 for Android 64-bits

/CD104LINUX64

Delphi 10.4 for Linux 64-bits



/CD11W32

Delphi 11 for Win32

/CD11W64

Delphi 11 for Win64

/CD11OSX

Delphi 11 for OSX 32-bits

/CD11OSX64

Delphi 11 for OSX 64-bits

/CD11IOSDEV

Delphi 11 for iOS Device 32-bits

/CD11IOSDEV64

Delphi 11 for iOS Device 64-bits

/CD11IOSSIM

Delphi 11 for iOS Simulator

/CD11ANDROID

Delphi 11 for Android 32-bits

/CD11ANDROID64

Delphi 11 for Android 64-bits

/CD11LINUX64

Delphi 11 for Linux 64-bits

/CD11OSXARM64

Delphi 11 for OSX ARM 64-bits



/CD12W32

Delphi 12 for Win32

/CD12W64

Delphi 12 for Win64

/CD12OSX

Delphi 12 for OSX 32-bits

/CD12IOSDEV

Delphi 12 for iOS Device 32-bits

/CD12IOSDEV64

Delphi 12 for iOS Device 64-bits

/CD12IOSSIM

Delphi 12 for iOS Simulator

/CD12ANDROID

Delphi 12 for Android 32-bits

/CD12ANDROID64

Delphi 12 for Android 64-bits

/CD12LINUX64

Delphi 12 for Linux 64-bits

/CD12OSXARM64

Delphi 12 for OSX ARM 64-bits









/D=x

Conditional defines (/D=MyDef1;MyDef2)

/F=format

/F=T -> text, /F=H -> HTML, /F=X -> XML

/I=path

Path to PAL.INI (/I=C:\PAL\PAL.INI)

/L=path

Path to text file with limit info (/L=C:\PAL\Limits.txt)

/P

Create/use PAP-file in source folder

/R=path

Report root folder (/R=C:\Out or /R="C:\My Out")

/S=folders

Search folders (/S="C:\CODE1;C:\My Code")')

/T=n

Number of report threads 1-64

/X=x

Excluded search folders (/X=C:\DIR1<+>;C:\DIR2)

 

Options are read from the project file. Some of the settings may be overridden by options on the command-line (see above).

 

The command-line version can, in contrast to the GUI version, also analyze source code without first creating a project. Just supply a source code path on the command-line instead of a project path. PALCMD will then use the settings according to the template which is used for new projects. These settings are in PAL.INI which is located in C:\Documents and Settings\<acc>\Application Data\Peganza\Pascal Analyzer.

 

The PAL.INI file is specially handled by PALCMD. If "/I" parameter is used the PAL.INI file as pointed to by the path, will be read. Else, if a PAL.INI file exists in the same folder as the program file itself, it will read the PAL.INI file from that location, otherwise it will read it from the same folder as the GUI program does. The GUI program will read the PAL.INI file from the special folder under "C:\Documents and Settings". In this way, if you keep the PALCMD.EXE in a special folder, you can make sure that it always uses the correct default options, by copying the PAL.INI file to that folder. This PAL.INI file will then not be affected of any changes that you happen to make while running the GUI program.

 

If an error occurs when PALCMD is run, the application terminates with exit code 99.

 

Example:

 

PALCMD

Shows help info and stops

 

PALCMD C:\projects\MyProj.pap

Runs PALCMD and analyses c:\projects\MyProj.pap

 

PALCMD "C:\My Units\MyUnits.pas" /FM /CBP

Runs PALCMD and analyses C:\My Units\MyUnits.pas with defaults as set in PAL.INI, but specifies that only the main file should be parsed, and that the compiler target is Borland Pascal 7.

 

PALCMD "C:\My Units\MyUnits.pas" /L=C:\PALCMD\Limits.txt

Runs PALCMD and analyses C:\My Units\MyUnits.pas with defaults as set in PAL.INI. Uses limits set in Limits.txt (see below under /L)

 

 

You can also, starting from PAL 8, use just a file name as parameter, like:

 

PALCMD MyProj.pap

 

.. or

 

PALCMD MyUnits.pas

 

PALCMD will then check the current working directory for this file. If the current working directory is not specified, it will use the same directory as where the PALCMD program is located.

 

 

/D specifies conditional defines

 

This setting overrides the setting in the PAL.INI file or the project options. Conditional defines from source code and/or found in the Delphi project file will also be used.

 

 

/F specifies the report format (text, HTML, XML)

 

This setting overrides the setting for report format in the PAL.INI file or the project file.

 

 

/I specifies the path to PAL.INI

 

This forces PALCMD to use the PAL.INI pointed to by the supplied path.

 

 

/L specifies the path to a text file with limit info, in this case C:\PALCMD\Limits.txt.

 

For example, if the file contains this line:

 

WARN1=5

 

.. "WARN1" is the abbreviation for the section "'Interfaced identifiers that are used, but not outside of unit" in the Warnings Report.

If then the number of warnings in a particular run of PALCMD.EXE exceeds 5, PALCMD.EXE will list it in the output.

 

When the number of warnings is less than the expected, it will also be listed.

 

The listings are also written to the Status Report.

 

You can add how many lines as you wish to the limit file. Each line will be checked against the specified section and report.

 

This feature is not available in PAL.EXE (the GUI program).

 

 

/P creates/uses a PAP file

 

When specifying only a source file and not a project file on the command-line, there will be no PAP file where to store information about new and old hits counts for reports. To easily allow for this, without having to create a PAP file, include the switch /P. A PAP-file will be created in the source folder. If it already exists, it will be used.

 

 

/R specifies the report root folder

 

This setting overrides the setting for report folder in the PAL.INI file or the project file.

 

 

/S specifies search folders, separated with a semicolon

 

This setting overrides the setting for search folders in the PAL.INI file or the project file.

 

 

/T specifies the number of report threads to use

 

This setting overrides the setting in the PAL.INI file

 

 

/X specifies excluded search folders, separated with a semicolon.

 

It is also possible to use "<+>" to specify that subdirectories also should be excluded.

 

This setting overrides the setting in the PAL.INI file or the project file.

 

 

See also: