home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
pan.zip
/
PAN.COM
/
PAN.DOC
< prev
next >
Wrap
Text File
|
1989-11-01
|
4KB
|
72 lines
PAN LEM
BY JOE HUGHES
10/30/89
The lem is a small assembly language program which enables CLARION to move a region
of text either right or left at very high speed. It can therefore be used to horizontally
scroll either the whole screen or just a section of it.
It is set up to emulate the way the CLARION SCROLL command uses parameters. Just as the
format of the SCROLL command is:
SCROLL(first row,first column,rows,columns,count)
The format of PAN is:
PAN(first row,first column,rows,columns,count,fill)
Just as in the SCROLL command the "count" parameter can be negative or positive to
change the direction. If "count" is negative, the block of text will be moved to the
right. Conversely, if "count" is positive the block of text will be moved to the left.
The only difference between PAN and SCROLL is that SCROLL will use the attribute of the
upper left corner of the rectangle specified to determine the attribute of the area that
is blanked. PAN allows you to specify what the "fill" of the blanked area, in case
the attribute of the upper left corner is different than the area to be blanked.
To specify the "fill" parameter set up a hex equate as follows:
The hex of the foreground and background followed by the hex of the ASCII character.
Therfore, a blue blank would be 1720H, 17 for a blue background and 20 for the hex of a space character.
In the sample program, another type of fill is shown, 4F2AH, which produces a
white asterisk on a red background. Initially, the equate BLUE_BLANK is set to 1720H in the sample
program, I encourage you to try the other equate.
You are probably wondering why I decided that a negative count would move the block of text
to the right, instead of to the left since negative numbers are traditionally on the left
side of a number line. I did this because PAN will most likely be used in response to a key
press, for example a left arrow key and a right arrow key. If you think about it for a moment
you will realize that when the user pressed a LEFT arrow key to PAN the screen left, the operation
actually performed on the screen would be to move the text block to the RIGHT, and then fill in
the leftmost column. Therefore, the sign of the "count" parameter corresponds to the key that
is pressed. This methodology is also illustrated in the sample program.
Notice in the sample program how I change STARTY as the program proceeds, I encourage
you to remove these lines and then test the program. You will see how PAN can be used
to PAN the block to an anchored point.
Lastly, notice how fast the program can throw up a new column, and change the attribute of only part
of the column, and also that it leaves the attribute of the block to be moved intact.
ERROR HANDLING:
The 'first row' and 'rows' parameters must be in the range of 1 to 25, and
the 'first column' and 'columns' parameters must be in the range 1 to 80 or else the
PAN statement is ignored. There is no error checking on the last two parameters, 'count'
and 'fill.' PAN also does not check to see if the sum of the 'first column' and
the 'columns' parameter exceeds the screen limit of 80. For example, if the first column is 75
and you ask PAN to PAN a block 10 columns, the block will wrap five columns over onto the left side
the screen. I did this for speed reasons, and there are some instances where it is useful,
I also thought it would be more useful as an error flag than ignoring the statement.
I hope that this LEM proves useful, because the bulletin board has been of great help
to me, especially the mouse.lem and the putkbd.lem.
Finally, in no event will I, Joe Hughes, be liable to you for any lost profits
or damages resulting from the use of this software, including but not limited
to indirect, special or consequential damages.
If there are any problems or questions please feel free to call me at (202) 663-7600.