Please enable JavaScript to view this site.

ESL Documentation

Navigation: ESL Documentation > ESL Programmers Guide

Appendix C Batch Building

Scroll Prev Top Next More

When your installation has a large number of ESL applications to compile, it is worth considering a batch or command file, programmed to do the repetitive task of launching the EParse compiler. The following series of commands will compile all the sample applications provided with the ESL Development Tools edition. Note that the "for loop" re-curses though all the sub-directories specified by the Input "Esl_eal" parameter:

@echo off
rem ESL install location
set Esl_Path=%ProgramFiles(x86)%\ESL Syndetic\ESL\
rem Input file structure
set Esl_eal="%ProgramFiles(x86)%\ESL Syndetic\ESL\Samples"
rem output folder root for /Webs and /Logs
set Esl_out=%~dp0
rem Esl compile run and edit
set Esl_ere="%Esl_Path%EslRun.exe"
set Esl_eew="%Esl_Path%EslEdit.web"
set Esl_exe="%Esl_Path%Eparse.exe"
set Esl_cfg="%Esl_Path%EslConfig.ini"
rem for break on loop
setlocal enabledelayedexpansion
if NOT EXIST "%Esl_out%Logs" md "%Esl_out%Logs"
if NOT EXIST "%Esl_out%Webs" md "%Esl_out%Webs"
for /R %Esl_eal% %%i in (*eal) do (
   cd /d "%%~dpi"
   call %Esl_exe% "%%i" -silentcomp -b "%Esl_out%Webs\%%~ni" -e "%Esl_out%Logs\%%~ni.err" -f %Esl_cfg%
   if not !errorlevel!==0 (
      call %Esl_ere% %Esl_eew% -d FileName "%Esl_out%Logs\%%~ni.err"
      call %Esl_ere% %Esl_eew% -d FileName "%%i"
      goto Break
   )
   set loopEcho=compiled "%%i"
   echo !loopEcho!
)
:Break
pause
exit