home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
GENUTIL
/
FKFOS102.ZIP
/
FUNCTION.REF
< prev
next >
Wrap
Text File
|
1994-12-27
|
25KB
|
542 lines
________________________
PROCEDURES AND FUNCTIONS
________________________
The following guide is a quick reference chart to all procedures
and functions that FKFOSSIL provides. There are several modifier
variables that affect the operation of these subroutines, and are
listed in the section "VARIABLES AND CONSTANTS" in the main
FKFOSSIL.DOC file.
FK_ANSIMUSIC
---------------------------------------------------------------------
Procedure fk_AnsiMusic( s : string );
fk_AnsiMusic will play the music string locally and then send it
to the remote side. NOTE; Ansi Music is not an ANSI standard -- it
only uses the term ansi because the string starts with the escape
sequence #27[. Not all terminal programs will support Ansi Music
if they support Ansi - check with user before sending anything
with fk_AnsiMusic.
The format of the music string "s" is like any BASIC PLAY statement,
with a few minor exceptions. The commands are noted below;
A..G Play musical note
If followed by a number, that will be the note length
(ignoring the preset length) -- ie, A4 will play "A"
as a quarter note
If followed by a # or + the note will be played sharp.
If followed by a - the note will be played flat.
If followed by any number of . (periods), the note
length will be multiplied by 3/2 for each period
(making the note last a little longer).
L n Set the length of the note to n (1..64)
MN Music Normal -- each note plays 7/8 length
ML Music legato -- each note plays full length
MS Music Staccato -- each note plays 3/4 length
O n Set the octave number to n (0..6)
P Pause (rest)
If followed by a number, the pause will ignore the
preset length and use the number as the length.
T n Set the tempo of the music to n (32..255)
> Increase octave one step
< Decrease octave one step
FK_BS
---------------------------------------------------------------------
Procedure fk_BS( n : integer );
fk_BS will send backspace characters "n" times to effectively back the
cursor up over already typed information. The cursor however will
not backup past column 1 on any given line.
FK_CLOCK
---------------------------------------------------------------------
Procedure fk_Clock( b : boolean );
fk_Clock will turn off/on the timer clock. If B is set to false,
the timer will be turned off. If B is set to true, the timer will
be turned back on again.
FK_CLREOL
---------------------------------------------------------------------
Procedure fk_ClrEol;
fk_ClrEol will clear to the end of the line in ANSI or Avatar mode.
If the user is in TTY mode, fk_ClrEol will do nothing.
FK_CLRSCR
---------------------------------------------------------------------
Procedure fk_ClrScr;
fk_ClrScr will clear the screen (local and remote) in any emulation
mode. For ASCII/Avatar, CHR(12) is sent, and in ANSI mode #27[2J is
sent.
FK_DEINITFOSSIL
---------------------------------------------------------------------
Procedure fk_DeInitFossil;
fk_DeInitFossil will release the fossil driver (if running remotely)
and remove the status line if active, and then exit the program.
NOTE; this should be the LAST line in your source code. All files,
and any clean up routines should be called before this procedure is
run (or see the section "DEFINABLE FUNCTIONS").
FK_DETECTANSI
---------------------------------------------------------------------
Function fk_DetectAnsi : Boolean;
fk_DetectAnsi sends out the cursor placement query to the user, and
checks for any response. If a response comes, then ANSI is present
and fk_DetectAnsi returns TRUE, otherwise if no response if
forthcoming and the timer reaches 0, fk_DetectAnsi returns FALSE.
This function does not set the users screen type. If you want it to,
you will need to do it yourself -- the procedure is only provided to
allow you to check for Ansi.
FK_DETECTAVATAR
---------------------------------------------------------------------
Function fk_DetectAvatar : boolean;
fk_DetectAvatar sends out the ANSI cursor placement query, and
stores the X screen co-ordinates. If no response comes and the
timer reaches 0, fk_DetectAvatar returns FALSE. If the response
does come, an avatar repetition sequence is sent to the modem, and
the cursor placement query is sent again. If the X co-ordinates
move by more then 5 characters, fk_DetectAvatar returns TRUE,
otherwise it returns FALSE (because the other terminal did not
process the avatar sequence correctly).
This function does not set the users screen type. If you want it to,
you will need to do it yourself -- the procedure is only provided to
allow you to check for Avatar.
FK_DISPLAY
---------------------------------------------------------------------
Procedure fk_Display( s : string );
fk_Display will send a file "s" to the local and remote screens. The
"s" variable should be a full path, filename and extension to a valid
file. If the user is in ANSI mode, ansi codes will be accepted. If
the user is in Avatar mode, Avatar codes will be accepted. If the
user is in TTY mode, straight text is expected.
The better alternative to this procedure is FK_DISPLAYFILE; the
alternate procedure requires no extension and automatically selects
the most appropriate file (and if it doesn't exist, a fallback is
chosen). If you need to access files with odd extensions, then this
procedure will prove useful.
FK_DISPLAYFILE
---------------------------------------------------------------------
Procedure fk_Displayfile( s : string );
fk_Displayfile will send a file "s" to the local and remote screens.
Any extension passed in "s" will automatically be stripped, and an
appropriate extension (based on the users screen setting) will be
selected.
TTY -> .ASC
Ansi -> .ANS
Avatar -> .AVT
If in Avatar/Ansi mode the file isn't found with .ANS or .AVT
extensions, the fallback will be to .ASC extensions. So if any file
needs to exist, it should always be the .ASC file as it will always
be the fallback file if none of the others are found.
FK_FLUSHINPUTBUFFER
---------------------------------------------------------------------
Procedure fk_FlushInputBuffer;
fk_FlushInputBuffer will clear the inbound keyboard buffers and
fossil buffers so that no keystrokes are left pending. It's a good
idea to call this before any important queries.
FK_FLUSHOUTPUTBUFFER
---------------------------------------------------------------------
Procedure fk_FlushOutputBuffer;
fk_FlushOutputBuffer will clear the outbound modem buffer if there is
anything still in the buffer. It is a good idea to call this before
hanging up or dropping the DTR, etc...
FK_GOTOXY
---------------------------------------------------------------------
Procedure fk_GotoXY( X,Y : Byte );
fk_GotoXY will position the cursor at the (X,Y) coordinates on the
screen. This function will only work with ANSI or Avatar modes
selected.
FK_INITFOSSIL
---------------------------------------------------------------------
Procedure fk_InitFossil( Port,
BPSrate,
Lockedrate : Longint;
Name,
Handle : String;
Timeleft : Longint;
Screentype,
StatuslinePos : Byte );
fk_InitFossil should be called BEFORE any other FKFOSSIL modem
related routines are called. This will initialize the fossil driver
and setup the minimal variables that FKFOSSIL requires to run (such
as user timeleft, screen mode, etc...).
Setting the BPSrate to 0 will cause FKFOSSIL to assume a local
orientation.
Setting the StatuslinePos to 0 will cause the statusline to not be
shown until it is set to something other then 0.
FK_INITFOSSIL_DF
---------------------------------------------------------------------
fk_InitFossil_DF( StatuslinePos : Byte);
fk_InitFossil_DF is an alternative to fk_InitFossil when you are
using the DOOR DROP FILES. Since the DOOR DROP FILE routines
automatically read the information into the necessary variables, it
is not required to set them again via fk_InitFossil.
FK_IDLETICK
---------------------------------------------------------------------
Procedure fk_Idletick;
fk_Idletick gives up timeslices to various multitasking programs --
OS/2, DESQview, DOS and Windows are all supported. This procedure is
automatically called when an FKFOSSIL routine is polling the
keyboard, but just in case you need it for something, here it is.
FK_KEYPRESSED
---------------------------------------------------------------------
Function fk_Keypressed : Boolean;
fk_Keypressed returns TRUE if there are keys in the keyboard buffer
or fossil buffer that are waiting to be read.
FK_LOCALBUFFER
---------------------------------------------------------------------
Procedure fk_LocalBuffer( s : string );
fk_LocalBuffer will add the string of characters "s" to the inbound
local keyboard buffer. This can be used to add characters as if
the local keyboard actually typed in those keys. (For remote
buffer, see FK_REMOTEBUFFER)
FK_LOCALBUFFERCLEAR
---------------------------------------------------------------------
Procedure fk_LocalBufferClear;
fk_LocalBufferClear will empty the buffer of stored characters.
This function does not empty the systems keyboard buffer.
fk_FlushInputBuffer will also empty the stored buffer.
FK_MOVECURSOR
---------------------------------------------------------------------
Procedure fk_MoveCursor( n : byte;
dir : char );
fk_MoveCursor will move the cursor n times in the direction of "dir".
Dir should be any of the following;
U Up L Left
D Down R Right
This function will only work in ANSI or Avatar modes.
FK_NOWAITREAD
---------------------------------------------------------------------
function fk_NoWaitRead : Char;
fk_NoWaitRead will poll the keyboard if there are any characters
waiting. If characters are found in the local or remote buffers,
then the character will be returned by fk_NoWaitRead.
FK_READ
---------------------------------------------------------------------
Function fk_Read : Char;
fk_Read will poll the keyboard for any waiting characters. If none
are found, fk_Read will wait until there are some (or the last
keypress timer runs out). When a character is found, it will be
returned by fk_Read.
FK_READLN
---------------------------------------------------------------------
Function fk_Readln( n : byte;
up : boolean ):String;
fk_Readln will read in a string of n characters long (max). If UP
then the string will be returned in uppercase. fk_Readln will end
when the user presses CR or runs out of time. To control the input
of strings, see the VARIABLES AND CONSTANTS section.
FK_REMOTEBUFFER
---------------------------------------------------------------------
Procedure fk_RemoteBuffer( s : string );
fk_RemoteBuffer will add the string of characters "s" to the
inbound user keyboard buffer. This can be used to add characters
as if the user actually typed in those keys. (For local buffer, see
FK_LOCALBUFFER)
FK_REMOTEBUFFERCLEAR
---------------------------------------------------------------------
Procedure fk_RemoteBufferClear;
fk_RemoteBufferClear will empty the buffer of stored characters.
This function does not empty to fossil buffer. fk_FlushInputBuffer
will also empty the stored buffer.
FK_REMOTEKEYPRESSED
---------------------------------------------------------------------
Function fk_RemoteKeypressed : boolean;
fk_RemoteKeypressed will return TRUE if there are characters waiting
in the inbound remote buffer, and FALSE if there are no characters
waiting. This only works for the REMOTE keyboard, like the Turbo
Pascal function KEYPRESSED works for the local keyboard. To combine
the two tests (to see if there are any waiting characters anywhere),
see FK_KEYPRESSED.
FK_REMOTEWRITE
---------------------------------------------------------------------
Procedure fk_RemoteWrite( s : string );
fk_RemoteWrite will send the string "s" to the comport. If it is a
local connection, this routine will do nothing. If the remote screen
has been turned off (see FK_HOST.REMOTESCREEN variable) then the
output won't go to the remote side either.
FK_REMOTEWRITELN
---------------------------------------------------------------------
Procedure fk_RemoteWriteln( s : string;
n : integer );
fk_RemoteWriteln operates exactly like fk_RemoteWrite except will it
follow by outputting "n" occurrences of CR/LF (next line). If "n" is
0, then there will be no CR/LF's appended, and fk_RemoteWriteln will
operate like exactly fk_RemoteWrite. ie fk_RemoteWriteln('Tim',0) is
the same as fk_RemoteWrite('Tim');
FK_TEXTBACKGROUND
---------------------------------------------------------------------
Procedure fk_TextBackground( n : byte );
fk_TextBackground will change the background colour attribute, and
retain the last foreground attribute.
FK_TEXTCOLOR / FK_TEXTCOLOUR
---------------------------------------------------------------------
Procedure fk_TextColour( n : byte );
fk_TextColour will set the remote screen attribute and local screen
attributes. The n byte is a combined foreground/background/blink
number which will be used to set all the colour attributes at once
and operates like the TextAttr:= variable in Turbo Pascal.
To get the combined number, say for yellow (14) on red (4) do
something like fk_TextColour(14+(4*16)); For each background number,
the actual n byte will increase by 16. To add a blink to the yellow
on red, 128 will be added to the value of n
fk_TextColour(14+(4*16)+128);
If you are familiar with the TextAttr variable in Turbo Pascal this
will be an easy to follow function. If however you wish to set the
foreground and background attributes separately there are the
FK_TEXTFOREGROUND and FK_TEXTBACKGROUND functions to use.
ANSI and Avatar codes will be sent when the user has either of the
respective screen emulations. If the user is in TTY mode, the colour
will not change. The local screen colour will be changed if the user
is in ANSI or Avatar mode, and in TTY mode if strict colour is off
(see VARIABLES AND CONSTANTS section).
FK_TEXTFOREGROUND
---------------------------------------------------------------------
Procedure fk_TextForeground( n : byte );
fk_TextForeground will change the foreground attribute only, leaving
the background attribute as is. If you wish the foreground to blink,
add 128 to the n byte.
FK_TIMELEFT
---------------------------------------------------------------------
Function fk_Timeleft : String;
fk_Timeleft will return the users timeleft in the string variable in
the format of [-]HH:MM:SS. The string will be padded with 0's in
empty spaces, so it will always have a length of 8 characters (unless
the user has negative time left when the length will be 9).
FK_TOGGLEDTR
---------------------------------------------------------------------
Procedure fk_ToggleDTR( Up : Boolean );
fk_ToggleDTR will raise or lower the DTR of the modem. If UP is TRUE
then the DTR will be raised, if UP is FALSE the DTR will be lowered.
Lowering the DTR while there is a carrier will cause the modem to
hangup on the user (if the modem has been setup to do so). This is
the fastest method of logging off a user. If you drop the DTR for a
second or two, and then raise it again, the user should be off.
FK_WRITE
---------------------------------------------------------------------
Procedure fk_Write( s : string );
fk_Write will send the string "s" to the comport and the local
screen. There are several modifier variables that can be used to
change the output of this procedure; see FK_HOST.REMOTESCREEN and
FK_HOST.HOSTSCREEN in the variables section for more information.
FK_WRITELN
---------------------------------------------------------------------
Procedure fk_Writeln( s : string;
n : integer );
fk_Writeln operates exactly like fk_Write except will it follow by
outputting "n" occurrences of CR/LF (next line). If "n" is 0, then
there will be no CR/LF's appended, and fk_Writeln will operate like
exactly fk_Write.
FK_WRITELN_ANSI
---------------------------------------------------------------------
Procedure fk_Writeln_Ansi( s : string;
n : integer );
fk_Writeln_Ansi operates exactly like fk_Writeln except that the
string "s" can contain ansi sequences. FKFOSSIL uses it's own built
in ANSI interpreter to handle the sequences -- this disables most of
the redundant and dangerous sequences such as Keyboard remapping,
etc. If the string is going to have ANSI sequences in it, use this
procedure.
FK_WRITELN_AVATAR
---------------------------------------------------------------------
Procedure fk_Writeln_Avatar( s : string;
n : integer );
fk_Writeln_Avatar operates exactly like fk_Writeln except that the
string "s" can contain Avatar/0 sequences. FKFOSSIL uses it's own
built in avatar interpreter to handle the sequences.
___________________
DEFINABLE FUNCTIONS
___________________
See the FKFOSSIL.DOC file before attempting to use any of these
functions -- the .DOC file has explanations and examples and gives
more insight to the idea of definable functions.
To setup your "override" functions, you must set them up to
match exactly the type of function you are replacing. So if the
function are you replacing is Function 8_1(ch:Char):Char then your
function must also be (ch:Char):Char. The function must also be
setup as a FAR call. To do this, you put {$F+} before the function.
Make sure that you put {$F-} after the function so that it saves you
memory/space when compiling (no need to setup your entire code to be
a FAR call).
The replaceable functions are as follows -- the defaults are the
values that you should return the variable to after you are done with
your "override". All of those functions have the same name as the
initial variable, except read fkp_ instead of fk_ (note the one
exception to this rule; the input routines).
VARIABLE FUNCTION/PROCEDURE TYPE INFORMATION / DEFAULT
--------------------------------------------------------------------
fk_LocalInput Function(Ch:Char):Char Processed when local
input is received. Char
is the return character
-- if you are not doing
anything with the actual
character, make sure
that your function
returns CH variable.
(default = fkp_input)
fk_RemoteInput Function(Ch:Char):Char Same as fk_LocalInput
except for remote input.
(default = fkp_input)
fk_CarrierLoss Procedure Run during any input
session if the carrier
is not online. (default
= fkp_Carrierloss)
fk_Timeout Procedure Run when the user times
out in any input session
(doesn't press a key for
the specified period).
(default = fkp_Timeout)
fk_NoTimeLeft Procedure Run when the user's time
run's out in any input
session. (default =
fkp_notimeleft)
fk_Close Procedure Run when the fossil
driver is shut down via
fk_Deinitfossil.
(default = fkp_Close)
fk_Open Procedure Run when the fossil
driver is first started
via fk_InitFossil[_DF].
(default = fkp_Open)
fk_MCI Function(s:string):string Run when the fk_Display
functions are displaying
the files. Every line
is passed through and a
return line is received.
(default = fkp_MCI)