Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> script file and command line parameters</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Script file and command line parameters
------------------------------------------------------------------------------
 It is quite possible that at some point you may want to override settings in
 the link script without altering the file itself, or even pass parameters to
 the linker from a batch file. This can easily be done, by placing Blinker
 commands both on the command line and within link script file(s), as the
 following examples show.

 Example 1

 Assume a developer is testing numerous programs, all of which are compiled
 and linked in a similar manner. This could be done by setting up a unique
 link script file for each program, but can be done more conveniently by
 creating one link script file which contains all the common commands used in
 linking each separate program. Then the one unique command (FILE) for each
 link script file can be placed on the command line within a batch file
 (BATFILE.BAT), and the unique program name can be specified with a DOS
 replaceable parameter.

 BATFILE.BAT:
 COMPILE %1
 BLINKER FILE %1 @Myapp

 This can then be called again and again specifying a unique program name, by
 typing at the DOS prompt:

 BATFILE testapp

 where 'testapp' is the name of the program to be compiled and linked, while
 'BATFILE' is the batch file invocation.

 Example 2

 Assume a developer was producing multiple copies of a program to distribute
 to customers, and wanted a unique serial number assigned to each copy that
 was being sent out. He or she would then make use of the Blinker command
 BLINKER EXECUTABLE SERIAL to burn into the .EXE file a 50-character string
 giving details of serial number, distributor, and so forth.

 This can be done by placing the BLINKER EXECUTABLE SERIAL command into the
 link script file, but the script would have to be edited each time the link
 was executed. It would be far easier to place this command in a batch file
 BATFILE.BAT using a DOS replaceable parameter for the serial number string,
 as in:

 BATFILE.BAT:
 BLINKER @Myapp BLINKER EXECUTABLE SERIAL %1

 This can then be called again and again specifying a unique serial number
 each time, by typing at the DOS prompt:

 BATFILE 00005414

 where '00005414' is the serial number to burn in and 'BATFILE' is the batch
 file invocation.
 This now opens up a whole range of possibilities for passing parameters to
 Blinker commands through batch files.

 Example 3

 The instructions to Blinker contained in the link file can be added to or
 complemented with instructions on the command line. For example, if the user
 needed to experiment with the size of the program stack in order to get the
 best result for his or her program, the line

 STACK <nnnn>

 could be added to the script file, where <nnnn> is the required value. This
 would, however, mean editing the script file every time the value had to be
 altered. It is simpler to insert into a batch file

 BATFILE.BAT:
 BLINKER @Myapp STACK %1

 and this could be called from the DOS prompt, by typing:

 BATFILE 5120

 where 5120 is the value to be set for the size of the program stack. As you
 can see it is a simple matter to alter the value from the DOS prompt. Once
 the most suitable value has been found it can then be added to the link
 file.
 Most Blinker commands can be incorporated in this way, allowing the user to
 continually alter values for environmental variables, settings which affect
 memory usage and to enable / disable various options.

 Example 4

 One link script file may also be separated into numerous parts, each of
 which can be specified on the command line:

 BATFILE.BAT:
 BLINKER @Myapp1 STACK %1 @Myapp2

 where Myapp1 and Myapp2 are both link script files, created by splitting
 MYAPP.LNK in half. This allows for the placement of the STACK command in the
 middle of all the Blinker commands for this link.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson