Compiling from the IDE Command Line

The IDE command line can be used to compile multiple objects without opening the IDE. It is especially useful for automating compilation by means of batch scripts.

Compilation Switches

The following switches can be used to compile specific types of objects:

  • /all {MainDevObject} (components, application shells, libraries)
  • /aps or /app {Shell} (application shells)
  • /ceo {Entity} (entity operations)
  • /cpt {Component} (components)
  • /dev {Library}(device translation tables)
  • /dsp {Component} (dynamic server pages)
  • /dtd {DTD} (DTDs)
  • /esv {Component} (entity services)
  • /frm {Component} (form components)
  • /gly {Library} (glyphs)
  • /lib {Library} (global ProcScripts)
  • /men {Library} (menus)
  • /mes {Library} (messages and help texts)
  • /obj {Library} (global objects)
  • /pan {Library} (panels)
  • /rpt {Component} (report components)
  • /sig {Component} (component signatures)
  • /ssv {Component} (session services)
  • /svc {Component} (service components)
  • /tra {Library}(keyboard translation tables)
  • /usp {Component} (static server pages)

You can use sub-switches and profiles to select the objects to compile, configure the information generated during compilation, or compile objects so they cannot be debugged. For more information, see Configuring Compilation.

Exit Codes

Most applications and utilities set an exit code when they complete or terminate. For example, exit codes are returned in the Windows command variable %errorlevel%, which can be referenced in scripts.

When compiling objects from the command line, Uniface returns an exit code of 0 (EXIT_SUCCESS) or 1 (EXIT_FAILURE) for most objects. However, the following switches always exit with EXIT_SUCCESS, even after the compiler has detected errors:

  • /mes
  • /dtd
  • /gly
  • /pan

An EXIT_FAILURE exit code is returned in these cases:

  • The compilation process itself fails.
  • The compilation process itself ran successfully, but the compiler detected errors. In this case, the transcript window or log file can provide more information about the number of errors.

Automating Compilation

When automating compilation, you will want to suppress the Transcript Window, to which compilation messages are directed. You can do so using the $TRANSCRIPT_LOG_FILE assignment setting to direct the contents to a file. For example:

;ide_compile.asn
#file D:\uniface10\common\adm\dbms.asn
#file D:\uniface10\uniface\adm\ide.asn

[SETTINGS]
$TRANSCRIPT_LOG_FILE D:\uniface10\log\compile_%p.log

The Windows CMD interface provides commands that can be used to write conditional processing scripts. For example, the following simple script stops executing compilation commands if a value other than 0 is returned.

"D:\uniface10\common\bin\ide.exe" "/adm=D:\uniface10\uniface\adm" /asn=ide_compile.asn /cpt
echo %errorlevel% 
if not errorlevel 0 exit

"D:uniface10\common\bin\ide.exe" "/adm=D:\uniface10\uniface\adm" /asn=ide_compile.asn /lib /men
echo %errorlevel% 
if not errorlevel 0 exit