+----------------------------------------------------------------------+
|                      I * C * E * T * I * P * S                       |
|                                                                      |
|                        Nr 6,  March 15th 1995                        |
|                                                                      |
|                         Presented to you by                          |
|                      Arnor Baldvinsson, ICELAND                      |
+----------------------------------------------------------------------+

In the PROGRAM.TPW you have a section at the end of the file to create
a ship list for your application.  I thought this was neat at first,
but soon found out that it wasn't much use if I wanted to create a .BAT
file to do the work for me as then I had to edit it a lot, so I though:
Why not change the template to do the work for me automatically each
time the program is generated?  So I did.  Following is the change you
must make to the PROGRAM.TPW file.  You can copy the text and paste it at 
the end of the original PROGRAM.TPW (! ! ! MAKE A BACKUP N*O*W ! ! !)
The template will create a file called APPLICATION.BA_  I decided not
to use the full .BAT ending as it might overwrite some bat files used
for other things.  

One thing to look out for:  If you include a file definition
using other drivers than the ones you use for your dictionary files 
and you only work with the file in code you must add the file driver
manually, as the generator does not see any files that are not used in
generated code.  It makes no difference if you define the file in
code or in the dictionary - if you never call a file from the dictionary
in your generated code the generator doesn't see it.

Remember to go to Setup - Template registry and re-register your
templates after you have done the changes.  You don't see
any difference in anything, except you will see the message "Create
COPY file" on the "Generating" message box when the generator finishes
generating your code and you will find a .BA_ file in your directory
after you have generated the code.  You can mess around with this
as you like.  Everything between #CREATE(%Application % '.BA_' and #CLOSE
goes into the .BA_ file, so you can add other things if you like.

Here goes:

#!--------------------------------------------------------------------
#MESSAGE('Creating COPY file',3)
#CREATE(%Application & '.BA_')

ECHO OFF
CLS
ECHO
+-----------------------------------------------------------------------------+
ECHO |                         Copying files to drive A:
|
ECHO
+-----------------------------------------------------------------------------+
ECHO.
ECHO.
REM Clarion for Windows
REM -------------------
REM You can use the following as basis for a .BAT file copying the application
REM and related files to the A: drive:

REM ------------------  Application files
ECHO COPY %Application.EXE A:
COPY %Application.EXE A:
ECHO COPY %Application.ENV A:
COPY %Application.ENV A:
ECHO COPY %Application.DCT A:
COPY %Application.DCT A:
ECHO COPY %HelpFile A:
COPY %HelpFile A:
IF Exist A:CWRUN10.DLL GOTO Continue1
ECHO COPY ..\BIN\CWRUN10.DLL A:
COPY ..\bin\CWRUN10.DLL A:
:Continue1
IF Exist A:CWDOS.DLL GOTO Continue2
ECHO COPY ..\BIN\CWDOS.DLL A:
COPY ..\bin\CWDOS.DLL A:
:Continue2

#FOR(%Module),WHERE(%ModuleExternal)
REM ------------------  DLL files
ECHO COPY ..\BIN\%Module A:
COPY ..\bin\%Module A:
#ENDFOR

#FOR(%UsedDriverDLLs)
REM ------------------  Driver files
  #FIX(%Driver,%UsedDriverDLLs)
ECHO COPY ..\BIN\%UsedDriverDLLs A:
COPY ..\bin\%UsedDriverDLLs A:
#ENDFOR

#IF(ITEMS(%VBXUsed))
REM ------------------  Only if VBX files are used:
ECHO COPY ..\BIN\CWVBX.DLL A:
COPY ..\bin\CWVBX.DLL A:

#FOR(%VBXUsed)
REM ------------------  VBX files
ECHO COPY ..\BIN\%VBXUsed A:
COPY ..\bin\%VBXUsed A:
#ENDFOR
#ENDIF

REM ------------------  end %Application.BA_ file
REM ------------------  Use REN %Application.BA_ %Application.BAT
REM ------------------  to make the .BAT file for copying files to A:
#CLOSE
#!--------------------------------------------------------------------


***** COMING UP NEXT on ICETIPS:  *****

Not sure, but stay tuned...

