UTILS\HEADLINE\HEADLINE.DOC ·
DOC ·
9 KB ·
1989-03-30 ·
from PCPlus_Issue-38_Nov-1989_FluxEngine-360Kb
HEADLINE
--------
What it does
------------
HEADLINE is a message display program which accepts command line
parameters to print text on your screen in large characters. You
can choose the foreground and background colours and character
construction, change the text mode, position the text on the
screen, scroll it and add delays and sound effects by including
escape sequences within the text message. In addition, a key
press or the monochrome text mode can be detected by the
ERRORLEVEL returned from the program.
To see what it can do, run the DEMO batch program
What it is for
--------------
As you can see by running the DEMO program, HEADLINE is designed
to allow you to easily produce eye catching displays with the
minimum of programming skill. These displays can be used for
advertising, demonstrations etc. or simply to enhance your batch
files.
How to use it
-------------
In its simplest form, typing HEADLINE HELLO will place the word
HELLO on the screen eight times the normal character size at the
current cursor position. Typing HEADLINE HELLO FRED will put
HELLO on one line and FRED on the next, however, typing HEADLINE
"HELLO FRED" will put the lot on one line. You can put as many
strings as you like on the command line up to DOS's 128 byte
limit, each string will normally be placed on a new line,
scrolling up the screen if necessary. Attempting to print a
string greater than the width of the screen will cause the line
to scroll to the left.
Alternatively, you can create a macro file with a text editor
containing all the strings that would normally be used on the
command line. This circumvents DOS's 128 byte command line limit
and reduces the amount of disk access. Each string should start
on a new line and should not be enclosed within quotes. The macro
file name must have an extension of .HDL and is executed by
typing HEADLINE @filename.
To enhance the display there are escape sequences which can be
included in the strings. An escape sequence is identified by the
character \ followed by a special character then one or two
decimal numbers and lastly a terminator character ;
e.g. "\&15,0;"
1
Colour
-----
Format: \&fgd,bdg;
fgd=foreground colour bdg=Background colour
Colour numbers:
0 ... Black 1 ... Blue 2 ... Green 3 ... Cyan
4 ... Red 5 ... Magenta 6 ... Yellow 7 ... White
Foreground colours can be enhanced by adding 8 to brighten the
colour and/or adding 128 for flashing.
e.g. HEADLINE "\&15,4;ABC" will print ABC in bright white on red.
Default: white on black.
Construction
------------
Format: \$fgd,bdg;
fgd=foreground character bdg=Background character
Each large character is made up from sixty four normal
characters, one character for the foreground and one for the
background. These can be selected using this escape sequence.
e.g. HEADLINE "\$2,58;ABC" will print ABC made up from smiley
faces on colon background.
Default: Block on space.
Goto Line
---------
Format: \@lin;
lin=line number 1,2 or 3
This allows you some control over the position of the text on the
screen. There are only three large text lines on the screen.
e.g. HEADLINE "\@2;ABC" will print ABC on large line 2.
Default: Next line.
Text Mode and Detection
-----------------------
Format: \!mod;
2
mod=Text mode number 0 to 3
Select modes 0 or 1 for 40 column (5 extra large characters) or
modes 2 or 3 for 80 column (10 large characters). When a new or
existing text mode is selected the screen will be cleared and the
next character position is set to the top left. If the computer
is operating in the monochrome text mode (7) and this sequence is
used then the screen will simply be cleared and the program will
return an ERRORLEVEL of 1.
e.g. HEADLINE "\!0;ABC" will clear the screen, set the text mode
to 40 column (5 extra large characters) and return an ERRORLEVEL
of 0 if the computer is operating in colour mode. Otherwise the
screen will be cleared and an ERRORLEVEL of 1 will be returned.
See the DEMO program for an example of how to use this
ERRORLEVEL.
Delays and Keys
---------------
Format: \#dly;
dly=Delay in 100ths of a second
To achieve the best effect, your demonstration program should
contain delays to allow the viewer time to read the screen. This
sequence will pause the program for a period of time, the maximum
being 65535 which is about 11 minutes. If a key is pressed during
the delay, then the delay is aborted and the program will return
an ERRORLEVEL of 1. Otherwise the program will complete its delay
time and return an ERRORLEVEL of 0.
e.g. HEADLINE "\#300;" will pause for 3 seconds and return an
ERRORLEVEL of 0 or terminates if a key is pressed and returns an
ERRORLEVEL of 1. See the DEMO program for an example of how to
use this ERRORLEVEL.
Sound Effects
-------------
Format: \*frq,dur;
frq=frequency in Hertz dur=duration in 100ths of a second
Sound effects can be added to further enhance your demonstration
program. The duration is not interruptable so be careful not to
use a time which is too long, the maximum duration is 65535 which
is about 11 minutes. The audio frequency range is about 20 to
18000 hertz.
Here is a list of recommended frequencies to use for notes.
Double or half the frequency to move up or down an octave.
3
262 ... MIDDLE C
277 ... C#
294 ... D
311 ... D#
330 ... E
349 ... F
370 ... F#
392 ... G
415 ... G#
440 ... INTERNATIONAL A
466 ... A#
494 ... B
e.g. HEADLINE "\*262,100;" will play middle C for one second.
Cursor On/OFF
-------------
Format: \_flg;
flg=0 for cursor off or 1 for cursor on
With this command you can disable the flashing cursor and
re-enable it when necessary.
e.g. HEADLINE "\_0;" will disable the cursor.
Scrolling
---------
Format: \^dir,cnt;
dir=direction 0-up, 1-down, 2-left, 3-right. cnt=count.
This command will scroll the current large line sideways or the
whole screen up or down. The amount of movement is in normal
character size increments. Scrolling the sceen up or down will
cause a new line to be moved in from the top or bottom. This line
will be blank, however scrolling a line left or right will cause
the new area to be in the current background character and
colour.
e.g. HEADLINE "\^3,8;" will scroll the current large line 8
characters to the right.
Remarks
-------
Format: \'rem;
rem=any text you want ignored by program
4
This command is useful only in macro files. It allows you to add
comments to the text file which will be ignored by the program.
It can also be used to indicate the end of a line of spaces.
e.g. HEADLINE "\' Hello World ;" is completely ignored.
The DEMO batch file program plus the three macro files DEMO1,
DEMO2 and DEMO3 use all the above escape sequences to good
effect.
The program is copyright (C) S.Thomas 1989. All rights reserved.
Steve Thomas
March 1989
5