home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
bbs_ra
/
radu_110.arj
/
RADU.DOC
< prev
next >
Wrap
Text File
|
1991-11-21
|
147KB
|
3,507 lines
▄▄▄▄ ▄▄▄▄▄▄▄
▄▄ ▄▄
▄▄ ▄▄▄▄▄▄ ▄▄ ▄▄▄▄▄ ▄▄▄▄▄ ▄▄▄▄▄
▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ▄▄▄▄▄▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄
P R O D U C T I O N S
Presents:
▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄▄▄▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄▄
▄▄ ▄▄ ▄▄ ▄▄ ▄▄▄▄▄ ▄▄▄▄▄
Remote Access Door Unit v1.10
(c) 1990,91 by In Fase Productions, The Netherlands
Written and compiled using
Turbo pascal v5.5 and v6.0 by
Richard Faasen,
Sysop of In Fase BBS +31-1840-10261 [2:285/311]
Release date: 21-Nov-1991
Page 1 RADU v1.10 Programmer's reference manual
╔══════
║ Table of contents
╙───────────────────────────────────────────────────────────────
1 Introduction . . . . . . . . . . . . . . . . . . . . . . 2
What is RADU? . . . . . . . . . . . . . . . . . . . . . . 2
Overview of features . . . . . . . . . . . . . . . . . . 3
About this manual . . . . . . . . . . . . . . . . . . . . 4
Distribution / installation . . . . . . . . . . . . . . . 4
Licensing . . . . . . . . . . . . . . . . . . . . . . . . 6
Support, bug reports, suggestions, etc etc . . . . . . . 7
Legal stuff / standard disclaimer . . . . . . . . . . . . 7
2 Quick start using RADU . . . . . . . . . . . . . . . . . 8
3 Complete description of RADU . . . . . . . . . . . . . . 10
Basic "CRT" alike routine . . . . . . . . . . . . . . . . 10
Declared variables and constants . . . . . . . . . . . . 21
Some specific door routines . . . . . . . . . . . . . . . 32
Functions specific to Remote Access . . . . . . . . . . . 37
Implementing hotkeys in your doors . . . . . . . . . . . 44
Non-door related functions . . . . . . . . . . . . . . . 47
4 Advanced features of RADU . . . . . . . . . . . . . . . . 57
Direct access to the FOSSIL . . . . . . . . . . . . . . . 57
Defining sysop command keys and statuslines . . . . . . . 61
The pre-defined sysop keys. . . . . . . . . . . . . . . 64
DESQview support functions . . . . . . . . . . . . . . . 67
Writing multi-line doors . . . . . . . . . . . . . . . . 69
Special Write(ln) extensions . . . . . . . . . . . . . . 74
Internal ANSI and AVATAR emulation . . . . . . . . . . 74
Remote Access textfile codes . . . . . . . . . . . . . 74
RADU codes . . . . . . . . . . . . . . . . . . . . . . 75
"A" change text attribute . . . . . . . . . . . . . . 75
"B" change background color . . . . . . . . . . . . . 76
"C" center a line of text . . . . . . . . . . . . . . 76
"D" duplicate a character x times . . . . . . . . . . 77
"F" change the foreground color . . . . . . . . . . . 77
"G" change current cursor position . . . . . . . . . 78
"H" select high intensity characters . . . . . . . . 78
"L" select low intensity characters . . . . . . . . . 78
"X" change current cursor X position . . . . . . . . 79
"Y" change current cursor Y position . . . . . . . . 79
Appendix A: Complete ASCII table . . . . . . . . . . . . . 81
Appendix B: Extended keyboard codes . . . . . . . . . . . . 83
Appendix C: List of Turbo Pascal Runtime errors . . . . . . 84
Appendix D: Remote Access textfile codes . . . . . . . . . 86
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
RADU v1.10 Programmer's reference manual Page 2
╔══════
║ 1 Introduction
╙───────────────────────────────────────────────────────────────
Welcome to RADU! RADU will be a great help for you writing
Remote Access doors (external programs). RADU supplies you with
a large number of very easy to use, and very powerful routines,
which will surely save you a lot of time! Well, let's not talk
too much, I hope you enjoy this unit as much as I enjoyed
writing it!
╔══════
║ What is RADU?
╙───────────────────────────────────────────────────────────────
RADU is a TPU (Turbo Pascal Unit) with all the tools you need to
make a nice door. With a nice door I mean a door which is
friendly to users, sysops and (very important) for the
programmer. There are lots of routines, in a large range of
usage, which are very easy to use. For example RADU offers you
routines for Statuslines, HotKeys, Paging, FOSSIL, UserOn,
File-sharing, DESQview support, Keyboard-idle detection, etc etc
etc. The basic capabilities of RADU are the same as the standard
Turbo Pascal Unit "CRT", which makes a quick start to
door-programming very easy! After reading a few pages of this
document you can already write some nice doors! Of course, if
you want to use the more advanced routines you have to read some
more.
Page 3 RADU v1.10 Programmer's reference manual
╔══════
║ Overview of features
╙───────────────────────────────────────────────────────────────
A summary of RADU's most important features:
■ RADU is "CRT" "compatible" which makes it possible to learn
the basic capabilities in a few moments! You knew the basic
concepts already before you ever heard about RADU! Can you
imagine?
■ ASCII, ANSI and AVATAR support. RADU has an internal ANSI and
AVATAR emulator. RADU will always try to send the shortest
ANSI or AVATAR code as possible, for highest performance.
■ DESQview support. There are routines available to make your
program work perfectly with DESQview.
■ Multi-line aware. There are routines available for file
sharing, internode messages, and for UserOn support (c) 1991
by Gerhard Hoogterp.
■ RA alike statuslines are available for information to the
sysop. You have one statusline available for your own
statistics. (Only when registered).
■ The sysop has RA alike sysop keys. You can change the default
keys, and add keys yourself in an easy way!
■ Automatic carrier, time limit and keyboard inactivity watchdog
for absolute safety. You can create custom messages when the
time limit almost exceeds, or when the user has not touched
his keyboard for some time.
■ Easy access to special keys pressed by the user. Keys like
cursor keys pressed by a user can be interpreted in a "CRT"
alike way. After you've received a key, you can see who
actually pressed that key (sysop or user).
■ Hotkeys. Your doors will be very easy to use with hotkeys.
RADU gives you the routines to implement them.
■ A FOSSIL is used by RADU for async communications. RADU was
tested with the BNU and X00 FOSSIL.
■ RADU accepts RA alike textfile codes in all strings you write.
■ Doors written with RADU are easy to install, even on
multi-line systems.
■ Everything possible has been done to make RADU-doors work on
any RA version.
■ And much, much more.
RADU v1.10 Programmer's reference manual Page 4
╔══════
║ About this manual
╙───────────────────────────────────────────────────────────────
This document is meant for programmers who are already quite
familiar with Turbo Pascal. It is also very useful if you know
something about RA BBS systems, but it's not necessary. Almost
any routine is explained using a simple example. I suggest that
you print this manual, and its accompanying file RADU.INT
(interface part of the unit) as reference material. The manual
is divided into three parts. The first part will help you in
only one page to start very quickly. The second part describes
all basic routines which you will use very often. In the last
part some special advanced features are described.
╔══════
║ Distribution / installation
╙───────────────────────────────────────────────────────────────
The latest version of RADU will always be
requestable/downloadable on my system, and will always be sent
through the PDN (Programmers Distribution Network). You may
distribute RADU as much as you like as long as it is in its
original unmodified state, and no fee is charged for it. The
following files should be found in an archive called
RADU-110.ZIP (or any other compression type):
────────────────────────────────────────────────────────────────
CONFIG.RA Use this for testing your doors from within
TURBO.EXE.
EXAMPLES.ZIP Example sources, use a lot of RADU routines.
EXITINFO.BBS Use this for testing your doors from within
TURBO.EXE.
IFP.LST List of other In Fase Productions.
RADU.DOC The document you're reading right now.
RADU.INT Interface part of the unit.
RADU.NG Norton Guide on RADU.
RADU.REG Registration form for RADU.
RADU.T55 RADU.TPU for Turbo Pascal v5.5.
RADU.T60 RADU.TPU for Turbo Pascal v6.0.
RADUDOOR.LST All doors currently written with RADU.
RAL.PAS Constants for RalGet.
RASTRUCT.PAS Type definition of all RA structures.
WHATSNEW.110 List of changes/new features in this version of
RADU.
────────────────────────────────────────────────────────────────
Before using RADU you should copy the correct RADU.T?? file to
RADU.TPU in your unit directory. For executing doors written
with RADU from within the Turbo Pascal IDE, you should have the
files CONFIG.RA and EXITINFO.BBS in the current directory, or
(if set) in the directory pointed to by the RA environment
variable.
Page 5 RADU v1.10 Programmer's reference manual
NOTE: RADU has been tested with a lot of software/hardware
combinations, and it seems that RADU is not compatible
with the SYS60.TPU unit by Eagle Performance Software!
RADU v1.10 Programmer's reference manual Page 6
╔══════
║ Licensing
╙───────────────────────────────────────────────────────────────
RADU is NOT free. RADU is distributed via the ShareWare concept.
After trying RADU for 30 days, you MUST register it. During this
period you may not distribute doors written with RADU. The only
difference with the registered version is that you will not get
the "UNREGISTERED VERSION" message, and you can change the
contents of the statuslines 8 and 9. Registration is for the
current, and any (if any) future versions. To register RADU you
must fill out the form RADU.REG and send it together with the
registration fee to the address stated in the registration form.
In 7 to 14 days your version will be registered.
Please be sure that you understand the following statements:
1. You must completely fill out the registration form, and mail
it to In Fase Productions, via Netmail or by Post.
2. Your registered version may not be copied for other than
backup purposes.
3. The program is provided "as is" without warranty of any
kind.
4. In Fase Productions is not liable for any damage directly or
indirectly caused by RADU.
Only when you completely agree with above statements it is
possible to register RADU.
Page 7 RADU v1.10 Programmer's reference manual
╔══════
║ Support, bug reports, suggestions, etc etc
╙───────────────────────────────────────────────────────────────
If you need support, have bugs to report, or have suggestions
for future versions of RADU, please don't hesitate and feel free
to contact me. Use one of the following addresses:
By mail: Richard Faasen
Koningsweer 72
3363 XJ Sliedrecht
The Netherlands
By netmail: Fidonet: 2:285/311
RiftNET: 62:1000/0
Parabelnet: 9:77/200
On my BBS: In Fase BBS
+31-1840-10261, 24h/day (HST/DS V32B)
If you've written nice doors I'd be pleased to see them. Just
upload them, if there are enough doors I'll make a RADU-Door
file area on my BBS!
Thanks in advance for your comments!
╔══════
║ Legal stuff / standard disclaimer
╙───────────────────────────────────────────────────────────────
■ In no event shall In Fase Productions nor Richard Faasen be
liable to you or anyone else for any damage directly or
indirectly caused by RADU.
■ All units, executables, documents and example files are
copyrighted 1991 by Richard Faasen and In Fase Productions.
You may however share UNMODIFIED copies of this product, as
long as no money is charged or accepted.
■ RADU is distributed under the user supported software (or
shareware) concept. That means you must register RADU after a
trial period of 30 days. Otherwise you are violating federal
copyright laws. I can (and will) only continue developing RADU
when enough people will register RADU. For more information
about registering, please read the chapter about "Licensing".
■ All brands and productnames named in this documentation are
trademarks or registered trademarks of there respective
holders.
■ RADU may not be used in a terroristic environment.
RADU v1.10 Programmer's reference manual Page 8
╔══════
║ 2 Quick start using RADU
╙───────────────────────────────────────────────────────────────
Of course you'd like to start immediately, well, just read this
chapter, and within a few minutes you can already start
programming!
In fact you should only know one thing for a quick start. The
only thing you must know is how to initialize the door unit. You
already know the basic features of RADU, they are the same as in
the "CRT" unit! I suggest that you first play around with these
basic steps, and after a few small programs look at the more
advanced routines further on in this document for more power and
flexibility of your doors.
Well, let's start right now. I'll show you how easy it REALLY is
programming with RADU. Look at the following example:
Program MyFirstDoor;
Uses
RADU;
Var
Ch : Char;
Begin
DorInit; { Initialize RADU }
ClrScr;
WriteLn ('Well, isn''t this amazing?');
WriteLn ('With RADU anyone can write doors!');
Write ('Well, was this easy or what?!?');
Repeat
Ch:=UpCase(ReadKey);
Until Ch in ['Y','N'];
If Ch='Y' then
WriteLn ('Yeahhh!')
Else
WriteLn ('No, just kidding!');
Write ('Well, just press enter for the BBS');
ReadLn;
End.
Well, that was really easy huh?!? Well, go ahead! Go write some
doors!
Page 9 RADU v1.10 Programmer's reference manual
│ DorInit Procedure
└───────────────────────────────────────────────────────────────
Function Initialize the door unit.
Declaration DorInit
Remarks This procedure initializes the whole RADU unit. It
reads some important RA configuration files, and
initializes some global RADU variables. The FOSSIL
will also be prepared to do ASYNC communications.
You should always call this procedure at the
beginning of your main program before any other
call to a RADU routine.
RADU v1.10 Programmer's reference manual Page 10
╔══════
║ 3 Complete description of RADU
╙───────────────────────────────────────────────────────────────
This chapter will describe most of the functions you'll often
use while writing your doors. The first paragraph describes the
"CRT" functions, functions which will mostly do the same as the
corresponding routines in the standard "CRT" unit. The main
difference is that these routines have effect on both the
sysop's and the user's console.
╔══════
║ Basic "CRT" alike routine
╙───────────────────────────────────────────────────────────────
Sometimes there are some small differences between the "CRT"
routines, and the equivalent routines found in RADU. Therefore
all "CRT" alike routines will be discussed in this chapter.
│ ClrEOL Procedure
└───────────────────────────────────────────────────────────────
Function Clears the current line to the end of the line,
starting at the current cursor position.
Declaration ClrEOL
Remarks To clear the line the space is filled with spaces
of the current text color. The cursor position is
not changed by this procedure.
Example GotoXY (5,12); { Position the cursor }
ClrEOL; { Clear to end of current line }
│ ClrScr Procedure
└───────────────────────────────────────────────────────────────
Function Fills the whole screen with cyan spaces (color 3)
and places the cursor at the top of the screen.
Declaration ClrScr
Remarks When running in multi-line mode, this procedure
will also check for a message from another node
just before the screen clears.
See also DorSendMessage
Example ClrScr; { Clear the whole screen }
Page 11 RADU v1.10 Programmer's reference manual
│ Delay Procedure
└───────────────────────────────────────────────────────────────
Function Delays the specified number of milliseconds.
Declaration Dalay (Ms : Word)
Remarks RADU's delay is DESQview aware, it will release
clock ticks to other tasks.
Example Delay (1000); { Delay for one second }
│ DelLine Procedure
└───────────────────────────────────────────────────────────────
Function Deletes the current screen line.
Declaration DelLine
Remarks Most ANSI terminals don't interpret the code used
for this function.
See also InsLine
Example GotoXY (1,10); { Position cursor }
DelLine; { Delete line 10 }
RADU v1.10 Programmer's reference manual Page 12
│ GotoXY Procedure
└───────────────────────────────────────────────────────────────
Function Position the cursor on an absolute screen
position.
Declaration GotoXY (X,Y : Byte)
Remarks This procedure will always send the shortest ANSI
or AVATAR code possible. When the door was started
in ASCII mode, this procedure will attempt to
position the cursor using linefeeds, backspaces
and spaces.
NOTE! Please note that this procedure will only send the
shortest ANSI/AVATAR code. The current cursor
position of the LOCAL screen is used to determine
the shortest code. When the cursor position on the
local screen differs from the cursor position on
the remote screen, the cursor will not always be
put on the correct location on the remote screen.
This can happen when you write text to the local
screen only, when you change the cursor position
on the local screen only (CRT.GotoXY), or when the
remote screen has less display lines than 23.
Example GotoXY (8,4); { Place cursor at X=8 and Y=4 }
Page 13 RADU v1.10 Programmer's reference manual
│ HighVideo Procedure
└───────────────────────────────────────────────────────────────
Function Selects high intensity characters.
Declaration HighVideo
Remarks See "TextColor" for an important note.
See also LowVideo, NormVideo, TextAttr, TextBackGround,
TextColor
Example HighVideo; { Set color to high intensity }
WriteLn ('This tekst is highlighted!');
│ InsLine Procedure
└───────────────────────────────────────────────────────────────
Function Inserts a textline on the screen.
Declaration InsLine
Remarks See "DelLine" for an important note.
See also DelLine
Example GotoXY (1,12); { Go to position where }
InsLine; { a line must be inserted }
RADU v1.10 Programmer's reference manual Page 14
│ KeyPressed Function
└───────────────────────────────────────────────────────────────
Function Returns TRUE if there is a key in the keyboard
buffer.
Declaration KeyPressed
Result type Boolean
Remarks RADU uses two "keyboard" buffers internally, one
buffer is for the keys pressed by the sysop, the
other is for keys pressed by the user.
"KeyPressed" will check either buffer, and when
one of these buffers is not empty, it will return
TRUE. When a user presses a special key like a
cursor key, its corresponding ANSI code will
automatically be converted to a normal extended
key code by RADU!
See also DorSysopKey, ReadKey
Example Repeat
Write ('-',^H,'|',^H);
Until KeyPressed;
Page 15 RADU v1.10 Programmer's reference manual
│ LowVideo Procedure
└───────────────────────────────────────────────────────────────
Function Selects low intensity characters.
Declaration LowVideo
Remarks See "TextColor" for an imporant note.
See also HighVideo, NormVideo, TextAttr, TextBackGround,
TextColor
Example LowVideo; { Change to low intensity }
WriteLn ('This is low intensity!');
│ NormVideo Procedure
└───────────────────────────────────────────────────────────────
Function Selects the original color read at startup from
the current cursor location.
Declaration NormVideo
Remarks See "TextColor" for an important note.
See also HighVideo, LowVideo, TextAttr, TextBackGround,
TextColor
Example NormVideo; { Reset color }
WriteLn ('This is the original color.');
│ NoSound Procedure
└───────────────────────────────────────────────────────────────
Function Turns off the internal speaker.
Declaration NoSound
Remarks Note that this procedure is exactly the same as
the one found in the standard unit "CRT".
See also Sound
RADU v1.10 Programmer's reference manual Page 16
│ ReadKey Function
└───────────────────────────────────────────────────────────────
Function Returns the first character found in the keyboard
buffer, or waits for one when the buffer is empty.
Declaration ReadKey
Result type Char
Remarks When the key returned by this routine was pressed
by the sysop, the variable "DorSysopKey" is
assigned TRUE, otherwise it is assigned FALSE.
When a user presses a cursor key, "ReadKey" will
automatically convert the corresponding ANSI code
to a normal extended key code.
See also DorSysopKey, GetKey, KeyPressed
Example Repeat
Until UpCase(ReadKey) in ['N','Y'];
Page 17 RADU v1.10 Programmer's reference manual
│ Read(ln) Procedure
└───────────────────────────────────────────────────────────────
Function Reads one or more values from the keyboard or from
the FOSSIL.
Declaration Read (V1[,V2,...,Vn])
Remarks This routine is the same as TP's internal Read(ln)
procedure, except that this one will read and echo
characters from both the sysop's and the user's
console.
Example Write ('Enter a string and a word ');
ReadLn (S,W);
See also CrtInput
│ Sound Procedure
└───────────────────────────────────────────────────────────────
Function Lets the the internal speaker beep. This function
will only work when paging is allowed.
Declaration Sound (Hz : Word)
Remarks When paging is allowed this routine simply calls
CRT.Sound to beep the internal speaker.
See also DorPage, NoSound, RaPageStat, RaSetPageStat,
RaYell
Example Sound (1000); { Turn speaker on }
Delay (100); { Delay one second }
NoSound; { Turn speaker back off }
│ TextBackGround Procedure
└───────────────────────────────────────────────────────────────
Function Changes the background color.
Declaration TextBackGround (Color : Byte)
Remarks See "TextColor" for an important note.
See also HighVideo, LowVideo, NormVideo, TextAttr,
TextColor
Example TextBackGround (Blue);{ Change the backgr. color }
WriteLn ('The background of this text is blue');
RADU v1.10 Programmer's reference manual Page 18
│ TextColor Procedure
└───────────────────────────────────────────────────────────────
Function Changes the foreground text color.
Declaration TextColor (Color : Byte)
Remarks RADU will always send the shortest ANSI code
possible. "CRT" compatible color types are also
defined in RADU for use with "TextColor" and
"TextBackGround".
Type
Black = 0;
Blue = 1;
Green = 2;
Cyan = 3;
Red = 4;
Magenta = 5;
Brown = 6;
LightGray = 7;
DarkGray = 8;
LightBlue = 9;
LightGreen = 10;
LightCyan = 11;
LightRed = 12;
LightMagenta = 13;
Yellow = 14;
White = 15;
Blink = 128;
NOTE! This routine uses the "CRT.TextAttr" variable to
determine the shortest ANSI code. This can only be
done if you NEVER change "CRT.TextAttr" directly,
or if you restore its value before you call this
procedure. Otherwise it can happen (Read: will
happen) that the colors of the local and remote
screens do not match!
See also HighVideo, LowVideo, NormVideo, TextAttr,
TextBackGround
Example TextColor (2); { Change the foreground color }
WriteLn ('Blue foreground color.');
Page 19 RADU v1.10 Programmer's reference manual
│ WhereX Function
└───────────────────────────────────────────────────────────────
Function Returns the current X location of the cursor.
Declaration WhereX
Result type Byte
Remarks "WhereX" will return the X position of the cursor
on the LOCAL screen. The position of the cursor on
the local screen can differ from the cursor
position on the remote screen when you've changed
the cursor position on the local screen only, if
you've written text to the local screen only, or
when the screen on the remote side has more or
less screen lines than 23.
See also GotoXY, WhereY
Example GotoXY (WhereX,10);
│ WhereY Function
└───────────────────────────────────────────────────────────────
Function Returns the current Y position of the cursor.
Declaration WhereY
Result type Byte
Remarks See "WhereX"
See also GotoXY, WhereX
Example GotoXY (WhereX-2,WhereY+2);
RADU v1.10 Programmer's reference manual Page 20
│ Window Procedure
└───────────────────────────────────────────────────────────────
Function Does nothing
Declaration Window (X1,Y1,X2,Y2 : Byte)
Remarks This routine does nothing. It was only included to
prevent using the one found in the "CRT" unit.
It's not possible to make windows using TTY, ANSI
or AVT/0.
│ Write(ln) Procedure
└───────────────────────────────────────────────────────────────
Function Writes one or more values to the screen.
Declaration Write (V1[,V2,...,Vn])
Remarks The text that you write using this routine will be
written to both the local screen and the user's
screen. There are some _VERY_ useful extensions to
this routine which will be discussed in a separate
chapter.
See also CrtOutput
Example WriteLn ('1+1=',1+1);
Page 21 RADU v1.10 Programmer's reference manual
╔══════
║ Declared variables and constants
╙───────────────────────────────────────────────────────────────
In the unit RADU some variables and constants are predeclared.
Most of them are discussed in this chapter.
│ CrtInput Variable
└───────────────────────────────────────────────────────────────
Function Text device to read characters from the keyboard.
Declaration CrtInput : Text
Remarks With read(ln) you can read characters from the
local keyboard AND from the keyboard of the user.
With this text device you can read characters only
from the local keyboard. Please look at "GotoXY"
for a warning.
See also Read(ln)
Example ReadLn (CrtInput,S,W);
│ CrtOutput Variable
└───────────────────────────────────────────────────────────────
Function Writes text to the local screen only.
Declaration CrtOutput : Text
Remarks With write(ln) you can write text to the local
screen AND to the screen of the user. If you use
the text variable "CrtOutput", text will only be
displayed on the local screen. Please look at
"GotoXY" for a warning.
See also Write(ln)
Example Write (CrtOutput,'Please enter two strings ');
ReadLn (CrtInput,S1,S2);
RADU v1.10 Programmer's reference manual Page 22
│ DorAnsi Variable
└───────────────────────────────────────────────────────────────
Function Is TRUE when the user wants ANSI codes to be sent.
Declaration DorAnsi : Boolean
Remarks This variable is initialized by "DorInit".
See also DorAvatar
Example If not DorAnsi then
Begin
WriteLn ('Sorry, this door requires ANSI!');
Halt;
End; { If }
│ DorAvatar Variable
└───────────────────────────────────────────────────────────────
Function Is TRUE when the user wants AVATAR codes to be
sent.
Declaration DorAvatar : Boolean
Remarks This variable is initialized by "DorInit".
See also DorAnsi
Example If not (DorAnsi or DorAvatar) then
Begin
WriteLn ('This door requires ANSI or AVATAR!');
Halt;
End; { If }
Page 23 RADU v1.10 Programmer's reference manual
│ DorCheckIdle Variable
└───────────────────────────────────────────────────────────────
Function When this variable is TRUE, RADU will check for
keyboard idle timeouts.
Declaration DorCheckIdle : Boolean
Remarks This variable is assigned TRUE by "DorInit". When
the user has to wait a long time, and you don't
want to check for keyboard inactivity timeouts,
set this variable to FALSE. This is useful when
your door executes an external program (such as a
protocol).
See also DorTimeOut
Example DorCheckIdle:=FALSE;
Dos.Exec ('DSZ.COM','RZ');
DorCheckIdle:=TRUE;
│ DorCommPort Variable
└───────────────────────────────────────────────────────────────
Function This variable contains the FOSSIL comm port.
Declaration DorCommPort : Byte
Remarks This variable is initialized by "DorInit", and
contains the comm port used by RA on the node from
where the door was executed. All FOSSIL routines
use this comm port.
See also RaNodeNr
RADU v1.10 Programmer's reference manual Page 24
│ DorFrozen Variable
└───────────────────────────────────────────────────────────────
Function When this variable is TRUE, the time the user has
left will be frozen.
Declaration DorFrozen : Boolean
Remarks The built-in chatmode automatically sets this
variable to TRUE, and restores its original value
after ending the chatmode.
Example OldFrozen:=DorFrozen;
DorFrozen:=FALSE;
DoChat;
DorFrozen:=OldFrozen;
│ DorIsLocal Variable
└───────────────────────────────────────────────────────────────
Function "DorInit" will set this variable to TRUE when it
detects that the door was executed in local mode.
Declaration DorIsLocal : Boolean
Example If DorIsLocal then
WriteLn ('Cannot transfer files in local mode!')
Else
DoFileTransfer;
Page 25 RADU v1.10 Programmer's reference manual
│ DorMinute Variable
└───────────────────────────────────────────────────────────────
Function Points to a procedure that should be called by
RADU every time the time is decreased by one
minute.
Declaration DorMinute : Procedure (TimeLeft : Word)
Remarks Using the "DorMinute" variable you can create your
own messages that should be displayed when the
user's time limit is almost exceeded.
See also DorTimeOut
NOTE! Note that the function where "DorMinute" is
pointing to must be declared FAR!
Example Procedure DorMinuteProc (TimeLeft : Word); Far;
Begin { DorMinuteProc }
Case TimeLeft of
0 : WriteLn('Time limit exceeded!');
1..2 : WriteLn('Only ',TimeLeft,'mins left!');
End; { Case }
End; { DorMinuteProc }
Begin { Main program }
DorInit;
DorMinute:=DorMinuteProc;
{ .... rest of program .... }
End. { Main program }
RADU v1.10 Programmer's reference manual Page 26
│ DorPath Variable
└───────────────────────────────────────────────────────────────
Function Contains the path where the door is located
(including trailing backslash).
Declaration DorPath : String80;
Remarks This variable is initialized by "DorInit" with the
path to the door EXE file.
NOTE! Please note that if you run the door from within
the Turbo Pascal IDE (Integrated Developers
Environment) while compiling to memory, this
variable will point to the directory where
"TURBO.EXE" is located!
See also RaSystem
Example Assign (ConfigFile,DorPath+'Config.cfg');
│ DorStatLn Typed constant
└───────────────────────────────────────────────────────────────
Function This variable contains the text for statuslines 8
and 9 (F8 and F9).
Declaration DorStatLn : Array[8..9,1..2] of String[80] =
(('',''),
('ALT: [C]hat [H]angup [L]ockOut .... etc',
#24+'-Inc Time '+#25+'-Dec Time .... etc');
Remarks Statusline 8 is empty by default, statusline 9
contains the default sysop keys. The first index
of the array is the statusline number, the second
indicates whether you want to change the upper or
lower part of the statusline.
NOTE! When you use an unregistered version of RADU,
statusline 8 will always contain a message that
your door may not be distributed! Only after
registration these statuslines can be changed, and
your doors may be distributed.
See also DorStatus
Example DorStatLn[8,1]:='Top of statusline 8';
DorStatLn[8,2]:='Bottom of statusline 8';
Page 27 RADU v1.10 Programmer's reference manual
│ DorSysopKey Variable
└───────────────────────────────────────────────────────────────
Function Is TRUE when the last key returned by ReadKey was
pressed by the sysop, otherwise this variable is
FALSE.
Declaration DorSysopKey : Boolean
Remarks Since every keyboard input routine in RADU uses
"ReadKey", this variable will always be set by
these routines. When you for example get a hotkey
returned by "HotReadKey", this variable will also
be TRUE when the sysop pressed that hotkey.
Example Key:=ReadKey;
If DorSysopKey then
WriteLn ('Sysop pressed ',Key)
Else
WriteLn ('User pressed ',Key);
RADU v1.10 Programmer's reference manual Page 28
│ DorTimeOut Variable
└───────────────────────────────────────────────────────────────
Function The procedure pointed to by this variable will be
called every minute when the keyboard is idle.
Declaration DorTimeOut : Function (KeyIdle : Word) : Boolean;
Remarks You can use this option to create custom messages
which will be displayed when no key has been
pressed for some minutes. There is already a
default handler in RADU. When your function
returns TRUE, RADU will disconnect immediately,
and passes control back to the BBS.
See also DorCheckIdle, DorMinute
NOTE! Note that the function where "DorTimeOut" is
pointing to must be declared FAR!
Example Function TimeOut (KeyIdle : Word) : Boolean; Far;
Begin { TimeOut }
Case KeyIdle of
2 :WriteLn('Press any key within one minute');
3 :WriteLn('Keyboard inactivity timeout!');
End; { Case }
TimeOut:=(KeyIdle=3);
End; { TimeOut }
Begin { Main program }
DorInit;
DorTimeOut:=TimeOut;
{ .... Rest of your program .... }
End. { Main program }
│ DvActive Variable
└───────────────────────────────────────────────────────────────
Function This variable is TRUE when DESQview was detected
by "DorInit".
Declaration DvActive : Boolean
See also DvVer
Example See "DvVer" for an example
Page 29 RADU v1.10 Programmer's reference manual
│ DvVer Variable
└───────────────────────────────────────────────────────────────
Function Contains the DESQview version that was detected
when "DorInit" was called.
Declaration DvVer : Word
Remarks High byte -> Major version number,
Low byte -> Minor version number.
When DESQview was not detected, this variable
contains 0.
See also DvActive
Example If DvActive then
WriteLn ('Running under DV v',Hi(DvVer),'.',
Lo(DvVer));
│ DvVidSeg Variable
└───────────────────────────────────────────────────────────────
Function Contains the segment of the screen which should be
used when writing directly to the screen.
Declaration DvVidSeg : Word
Remarks When DESQview is active, this variable will point
to the DESQview video buffer.
See also FastWrite
│ ExitInfo Variable
└───────────────────────────────────────────────────────────────
Function Contains the contents of the file "EXITINFO.BBS".
Declaration ExitInfo : ExitInfoRecord;
Remarks The record definition "ExitInfoRecord" is found in
the file "RASTRUCT.PAS". The variable "ExitInfo"
is initialized by "DorInit".
See also DorInit, RaConfig
Example WriteLn ('Hi there ',ExitInfo.UserInfo.Name);
RADU v1.10 Programmer's reference manual Page 30
│ Language Variable
└───────────────────────────────────────────────────────────────
Function Contains a record from LANGUAGE.RA.
Declaration Language : LanguageRecord;
Remarks This variable is initialised by "DorInit". It will
read the record for the requested language from
the LANGUAGE.RA file.
Example WriteLn ('Current language: ',Language.Name);
See also RalGet
│ RaConfig Variable
└───────────────────────────────────────────────────────────────
Function Contains the contents of the file "CONFIG.RA".
Declaration RaConfig : ConfigRecord;
Remarks This variable is initialized by "DorInit".
See also DorInit, ExitInfo
Example WriteLn ('Back to ',RaConfig.SystemName);
Halt;
│ RaNodeNr Variable
└───────────────────────────────────────────────────────────────
Function Contains the node number the user is currently
logged on to.
Declaration RaNodeNr : Byte
Remarks This variable is initialized by "DorInit".
See also DorInit
Page 31 RADU v1.10 Programmer's reference manual
│ RaSystem Variable
└───────────────────────────────────────────────────────────────
Function Contains the path to the Remote Access system
directory.
Declaration RaSystem : String
Remarks This variable is initialized by "DorInit".
"DorInit" uses the dos environment variable RA to
determine the system directory. If this variable
is not set, this variable will be an empty string:
the current directory.
See also DorInit, DorPath
Example Assign (ConfigFil,RaSystem+'Files.Ra');
│ TextAttr Variable
└───────────────────────────────────────────────────────────────
Function Contains the current text attribute.
Declaration TextAttr : Byte
Remarks This variable is used by RADU to send the optimal
(shortest) ANSI code to the user. You should NEVER
change this variable directly, always via
"TextColor", etc. Otherwise RADU gets confused,
resulting in wrong colors at the user side.
See also HighVideo, LowVideo, NormVideo, TextBackGround,
TextColor
RADU v1.10 Programmer's reference manual Page 32
╔══════
║ Some specific door routines
╙───────────────────────────────────────────────────────────────
This chapter discusses routines which are not directly related
to Remote Access, or anything else.
│ CTLRead Function
└───────────────────────────────────────────────────────────────
Function Reads an entry from a CTL file.
Declaration CTRLRead (Var Fil : Text;Var Line : Word;Var
Ident,Value : String)
Result type Boolean
Remarks This routine makes it very easy for you to read a
CTL file. Some checks are done automatically, so
you only have to take care about some other stuff.
Fil: This is a text variable, you should open
the CTL file before you call "CTLRead".
Line: This is the line number just read from the
CTL file. RADU automatically skips blank
lines, and ignores all text after a ;
Ident: This is the identifier found in the line
just read from the CTL file.
Value: This is the value that is assigned to the
identifier.
Result: The function returns TRUE when the end of
the file was reached (like EOF).
Example Please look at the example included in this RADU
package for an example of this routine.
│ DorChangeTime Procedure
└───────────────────────────────────────────────────────────────
Function Changes the time the user has left for today.
Declaration DorChangeTime (Delta : Integer)
Remarks If "Delta" is a positive value, the time will be
increased, otherwise the time will be decreased.
Example DorChangeTime (10); { Add 10 minutes }
Page 33 RADU v1.10 Programmer's reference manual
│ DorChat Procedure
└───────────────────────────────────────────────────────────────
Function Invokes the internal chatmode.
Declaration DorChat
Remarks This chatmode can normally be initiated with
[Alt-C].
See also ChatEndStr, ChatStr, ChatSysopStr, ChatUserStr
Example DorChat;
│ DorDisplay Function
└───────────────────────────────────────────────────────────────
Function Displays a textfile with or without hotkeys, and
with or without "more" prompting.
Declaration DorDisplay (Name,Abort : String;More : Boolean)
Result type Char
Remarks Parameters:
Name: This is the name of the file to display.
You don't have to supply a path or
extension. RADU will try to open the
following files in the given order:
Language.TextFiles+Name+'.AVT' { If AVT }
Language.TextFiles+Name+'.ANS' { If ANS }
Language.TextFiles+Name+'.ANS'
DorPath+Name+'.AVT' { If AVT }
DorPath+Name+'.ANS' { If ANS }
DorPath+Name+'.ASC'
DorPath+Name
Name+'.AVT' { If AVT }
Name+'.ANS' { If ANS }
Name+'.ASC'
RaConfig.TextPath+Name+'.AVT' { If AVT }
RaConfig.TextPath+Name+'.ANS' { If ANS }
RaConfig.TextPath+Name+'.ASC'
RaConfig.TextPath+Name
Name
Abort: This string contains letters which the
user can use to abort displaying of the
textfile.
More: When this variable is TRUE, there will be
a "more [Y/n/=]" prompt every screen page
(depending on user's screen length
setting).
RADU v1.10 Programmer's reference manual Page 34
Result: The result of the function will normally
be the the key pressed by the user to
abort displaying of the textfile. Except
for the following codes:
#0: File displayed entirely without
aborting
#1: Error opening file
#2: File display aborted at "more" prompt.
Example Case Display ('INFO','Ss',TRUE) of
#0 : Begin
Write ('`h:Press enter to continue.`l:');
GetKey (#13);
End; { #0 }
#1 : Missing ('INFO');
End; { Case }
│ DorLineEdit Function
└───────────────────────────────────────────────────────────────
Function Reads a string from the keyboard with editing
facilities.
Declaration DorLineEdit (Var S : String;Len : Byte;Legal,Abort
: CharSet;Pad : Char)
Result type Char
Remarks "CharSet" is a type declared in RADU as a "Set of
Char".
Type
CharSet = Set of Char;
Parameters:
S: Source/destination string. The current
value will be displayed, the user can edit
it if needed.
Len: The maximum stringlength.
Legal: Legal characters, characters that may be
used.
Abort: Keystokes to end editing. (More
information below)
Pad: The character used for padding. Unused
space of the string will be padded with
this character on the screen.
When you call "DorLineEdit", the current value of
"S" will be displayed, and can be edited. If the
first keystoke is not a cursor movement key, the
whole string is cleared. When a key is pressed
which is a member of the "Abort" set, then that
key is returned as function result. The new string
Page 35 RADU v1.10 Programmer's reference manual
itself is returned in "S".
For editing the following keys are legal:
Left Move cursor one position to the left.
Right Move cursor one position to the right.
^Left Move cursor one word to the left.
^Right Move cursor one word to the right.
Delete Delete character under cursor.
BackSpace Delete character on the left side of the
cursor.
Insert Toggle insert mode (default is insert
mode)
^V Same as Insert.
For the "Abort" parameter the following codes are
supported:
#0 Cursor Up key.
#1 Cursor Down key.
These codes allow you to make a full-screen
editable form.
NOTE! Not all terminal emulation software will send the
(correct) codes on these keys. In these cases
strange things can happen.
See also ReadKey, Read(ln)
Example For an example, please look at the examples
included in this package.
│ DorRefresh Procedure
└───────────────────────────────────────────────────────────────
Function Refreshes the screen, to remove line noise.
Declaration DorRefresh
Remarks I recommend that you make an option in your doors
to refresh the display.
Example Case UpCase(ReadKey) of
'R' : DorRefresh;
{ .... }
End;
RADU v1.10 Programmer's reference manual Page 36
│ DupWrite Procedure
└───────────────────────────────────────────────────────────────
Function Writes a single character x times to the screen.
Declaration DupWrite (Ch : Char;Times : Byte);
Remarks This procedure is extremely fast when the user is
using AVATAR emulation.
Example DupWrite ('─',80);
│ Exec Procedure
└───────────────────────────────────────────────────────────────
Function Executes a sub-door.
Declaration Exec (Path,CmdLine : String)
Remarks This routine takes the following actions:
■ Writes an EXITINFO.BBS
■ Calls Dos.Exec (Path,CmdLine)
■ Reads the EXITINFO.BBS
In the "CmdLine" parameter, "Exec" allowes the use
of the following RA-alike parameters:
*B = User's baudrate (0=local)
*F = User's first name
*G = Ansi, 0=nope, 1=yep
*L = User's last name
*N = Node number
*P = Port number (0=local)
*R = User's record number in USERS.BBS
*T = Time limit for current call
Example Exec ('SubDoor1.Exe','-b*b');
Page 37 RADU v1.10 Programmer's reference manual
╔══════
║ Functions specific to Remote Access
╙───────────────────────────────────────────────────────────────
This chapter discusses routines which are directly related to
Remote Access, such as flag manipulation, paging and logging.
│ Byte2Flags Function
└───────────────────────────────────────────────────────────────
Function Converts a byte to an RA alike flag string.
Declaration Byte2Flags (B : Byte)
Result type String
See also RaCheckFlags, RaCmpFlags, RaResetFlags, RaSetFlags
Example WriteLn (Byte2Flags(ExitInfo.UserInfo.Flags[1]));
RADU v1.10 Programmer's reference manual Page 38
│ DorPage Function
└───────────────────────────────────────────────────────────────
Function Plays the melody found in the file Page.Ra in the
RA system directory.
Declaration DorPage (SysAbort,UsrAbort,PageFile : String)
Result type Char
Remarks "SysAbort" must contain all the keys the sysop can
press to stop paging. "UsrAbort" must contain all
the keys the user can press to stop paging. Use
"DorSysopKey" to check who aborted the page. When
one of the abortkeys are pressed, "DorPage" will
return the key which was pressed. When none of
these keys were pressed during the time specified
in RACONFIG (page length), "DorPage" will return
#0. By default DorPage uses PAGE.RA located in the
RA system directory. You can however use an
alternate pagetune by passing the full name in
"PageFile". When "DorPage" cannot open this file,
it uses PAGE.RA.
NOTE! "DorPage" will ALWAYS work, not only during paging
hours. It's your task to check whether paging is
allowed or not. You can use the function "RaYell"
to check this. When "ScrollLock" is active,
"DorPage" does not make any sound.
See also RaPageStat, RaSetPageStat, RaYell
Example Case UpCase (DorPage('AaCc'+#27,' ','SONG.RA')) of
'C' : DoChat;
'A',#27 : DoAbort;
#0 : DoNotAtHome;
' ' : DoUsrAbort;
End; { Case }
Page 39 RADU v1.10 Programmer's reference manual
│ RaCheckFlags Function
└───────────────────────────────────────────────────────────────
Function Checks for the presence of flags.
Declaration RaCheckFlags (Fl : FlagType;Which : String)
Result type Boolean
Remarks This function returns TRUE when all the flags
listed in "Which" were found in "Fl".
See also RaCmpFlags, RaResetFlags, RaSetFlags
Example Flags:=ExitInfo.UserInfo.Flags;
If RaCheckFlags (Flags,'A1B4') then
Start
Else
NoAccess;
│ RaCmpFlags Function
└───────────────────────────────────────────────────────────────
Function Compares two sets of flags.
Declaration RaCmpFlags (FlUser,Fl : FlagType)
Result type Boolean
Remarks Only when all flags in "Fl" were found in
"FlUser", this function returns TRUE.
See also RaCheckFlags, RaResetFlags, RaSetFlags
Example If RaCmpFlags (ExitInfo.UserInfo.Flags,Need) then
Start
Else
NoAccess;
RADU v1.10 Programmer's reference manual Page 40
│ RaFormatDate Function
└───────────────────────────────────────────────────────────────
Function Formats a date string to the given format.
Declaration RaFormatDate (D : Date;Format : Byte)
Result type String
Remarks The parameter "D" must be in the following format:
MM-DD-YY. "RaFormatDate" will return a string in
one of the following formats, depending on the
value of "Format":
0 - Format the user wants (ExitInfo)
1 - DD-MM-YY
2 - MM-DD-YY
3 - DD-MM-YY
4 - DD-Mmm-YY
When the given date is invalid, this function
returns "Invalid".
Example Write(RaFormatDate(ExitInfo.UserInfo.LastDate),0);
│ RalGet Function
└───────────────────────────────────────────────────────────────
Function Gets an entry from the .RAL file for the requested
language.
Declaration RalGet (Nr : Word)
Result type String
Remarks "Nr" is the number of the entry in the .RAL file.
See "RAL.PAS" for a list of constants to use with
this function.
See also Language
Example WriteLn(RalGet(ralEnter));
GetKey(#13);
Page 41 RADU v1.10 Programmer's reference manual
│ RaLog Procedure
└───────────────────────────────────────────────────────────────
Function Writes an entry in the Remote Access system
logfile.
Declaration RaLog (S : String)
Remarks "RaLog" uses the logfile, and logfile format as
specified in "RaConfig".
Example RaLog ('User left timebank.');
│ RaPageStat Function
└───────────────────────────────────────────────────────────────
Function Returns the page status [Alt-O].
Declaration RaPageStat
Result type Byte
Remarks This function returns the page status, that is
whether paging is allowed or not, or only during
paging hours. The sysop can change this status
with [Alt-O] (override paging). There are some
constants declared in RADU to use this function:
Const
PagingHours = 1;
PagingOff = 2;
PagingOn = 3;
See also DorPage, RaSetPageStat, RaYell
RADU v1.10 Programmer's reference manual Page 42
│ RaResetFlags Procedure
└───────────────────────────────────────────────────────────────
Function Sets the specified flags to OFF.
Declaration RaResetFlags (Var Fl : FlagType;Which : String)
Remarks All the flags listed in "Which" are set to OFF in
"Fl".
See also RaCheckFlags, RaCmpFlags, RaSetFlags
Example RaResetFlags (ExitInfo.UserInfo.Flags,'B2C2D1');
│ RaSetFlags Procedure
└───────────────────────────────────────────────────────────────
Function Sets the specified flags to ON.
Declaration RaSetFlags (Var Fl : FlagType;Which : String)
Remarks All the flags listed in "Which" are set to ON in
"Fl".
See also RaCheckFlags, RaCmpFlags, RaResetFlags
Example RaSetFlags (ExitInfo.UserInfo.Flags,'A5D2B7');
│ RaSetPageStat Procedure
└───────────────────────────────────────────────────────────────
Function Sets the page status.
Declaration RaSetPageStat (Status : Byte)
Remarks Please look at "RaPageStat" for more information.
See also DorPage, RaPageStat, RaYell
Example RaSetPageStat (PagingHours)
Page 43 RADU v1.10 Programmer's reference manual
│ RaSetSecurity Procedure
└───────────────────────────────────────────────────────────────
Function Changes the security level of the user currently
using this door.
Declaration RaSetSecurity (NewSec : Word)
Remarks This procedure reads the file LIMITS.CTL to adjust
the restrictions of the user. When the new
security level was not found in this file, RADU
will use the restrictions of the level just below
the requested level.
Example RaSetSecurity (1000)
│ RaYell Function
└───────────────────────────────────────────────────────────────
Function Returns TRUE if paging is allowed right now.
Declaration RaYell
Result type Boolean
Remarks "RaYell" uses the page status (RaPageStat) and the
current time to determine whether paging is
allowed or not. You should never make ANY sound on
the sysop side when this function returns FALSE.
See also DorPage, RaPageStat, RaSetPageStat, Sound
Example If RaYell then
Begin
Case UpCase(DorPage ('AaCc'#27,' ','')) of
#0 : NoResponse;
'C' : DoChatMode;
'A',#27 : DoAborted;
' ' : DoUsrAborted;
End;
End
Else
OutsidePagingHours;
RADU v1.10 Programmer's reference manual Page 44
╔══════
║ Implementing hotkeys in your doors
╙───────────────────────────────────────────────────────────────
What is more important for programmers than user friendlyness?
When your door is easy in use, users will come back and are
pleased to use your door again! I think any door should have
hotkeys, and too many doors don't have them! RADU offers you a
set of routines to implement them very easily in your doors!
│ DorCleanKeys Procedure
└───────────────────────────────────────────────────────────────
Function Clears the keyboard input buffer of both the sysop
and the user. This can be useful when implementing
hotkeys in your doors.
Declaration DorCleanKeys
Example DorCleanKeys
│ DorSetHotKeys Procedure
└───────────────────────────────────────────────────────────────
Function Tells RADU which keys are hotkeys.
Declaration DorSetHotKeys (Hot : String)
Remarks First this procedure will flush all characters in
the FOSSIL output buffer. After you've called
this procedure, RADU will watch your keyboard
while writing to the screen. When a hotkey is
pressed, RADU will ignore ANY write statement,
until you call DorSetHotKeys again. If you want to
disable hotkey checking, call this procedure with
an empty string as parameter (DON'T FORGET!).
See also HotKeyPressed, HotReadKey
Example For an example, please look at the example program
included in this package.
Page 45 RADU v1.10 Programmer's reference manual
│ GetKey Function
└───────────────────────────────────────────────────────────────
Function Wait for one of the specified keystrokes.
Declaration GetKey (Legal : String)
Result type Char
Remarks This function waits until a key is pressed, which
is a character in the string "Legal". The key
which was pressed is returned as function result.
This function can be useful when you implement
hotkeys in your program using "DorDisplay", but it
can also be used without "DorDisplay".
See also DorDisplay, ReadKey
Example Case UpCase(GetKey ('AaBbCcDd')) of
'A' : DoChoiceA;
'B' : DoChoiceB;
'C' : DoChoiceC;
'D' : DoChoiceD;
End; { Case }
│ HotKeyPressed Function
└───────────────────────────────────────────────────────────────
Function Returns TRUE when the user has pressed a hotkey.
Declaration HotKeyPressed
Result type Boolean
Remarks When RADU is checking for hotkeys, it will ignore
any key which is not a hotkey. When a hotkey is
pressed, this function will return TRUE.
See also DorSetHotKeys, HotReadKey
Example For an example, please look at the example program
included in this package.
RADU v1.10 Programmer's reference manual Page 46
│ HotReadKey Function
└───────────────────────────────────────────────────────────────
Function Returns (or waits for) a hotkey.
Declaration HotReadKey
Result type Char
See also DorSetHotKeys, HotKeyPressed
Example For an example, please look at the example program
included in this package.
Page 47 RADU v1.10 Programmer's reference manual
╔══════
║ Non-door related functions
╙───────────────────────────────────────────────────────────────
While writing this door unit I needed a couple of routines, and
after completion of the unit, and writing some doors, I noticed
how often these routines are used. You can also use these
routines.
│ ASCIIZtoStr Function
└───────────────────────────────────────────────────────────────
Function Converts a NULL terminated (C alike) string to a
pascal string.
Declaration ASCIIZtoStr (Var NullStr)
Result type String
Remarks Only the first 255 characters of the NULL
terminated string are converted, the rest will be
ignored.
Example Assign (TextFile,'Name.Fil');
WriteLn (ASCIIZtoStr(TextRec(TextFile).Name));
│ DateStr Function
└───────────────────────────────────────────────────────────────
Function Returns the current date.
Declaration DateStr
Result type String15
Remarks Returns the current date in the format MM-DD-YY.
See also TimeStr
Example WriteLn('Current date: ',RaFormatDate(DateStr,0));
RADU v1.10 Programmer's reference manual Page 48
│ Dup Function
└───────────────────────────────────────────────────────────────
Function Returns a string containing x times the specified
character.
Declaration Dup (C : Char;T : Byte)
Result type String
Example WriteLn (Dup('─',80));
│ FastWrite Procedure
└───────────────────────────────────────────────────────────────
Function Writes a string directly to the screen.
Declaration FastWrite (X,Y : Byte;S : String80)
Remarks X,Y is the absolute position on the screen where
the string must be written. The top-left position
is 0,0. The current text color is used when
writing this string. This routine is DESQview
aware.
Example FastWrite (4,8,'Test');
│ ForceBack Function
└───────────────────────────────────────────────────────────────
Function Adds a backslash to the specified path, if needed.
Declaration ForceBack (Path : String)
Result type String
Remarks All leading and trailing spaces in the input
string will be deleted. Spaces anywere else in the
string will not be deleted.
ForceBack ('C:'); -> 'C:'
ForceBack ('C:\RA'); -> 'C:\RA\'
ForceBack ('C:\RA\MENUS\'); -> 'C:\RA\MENUS\'
ForceBack ('C:\DOS '); -> 'C:\DOS\'
ForceBack ('C:\RA MENUS\'); -> 'C:\RA MENUS\'
Example Assign (ForceBack(Path)+'Name.Ext');
Page 49 RADU v1.10 Programmer's reference manual
│ FStr Function
└───────────────────────────────────────────────────────────────
Function Converts a numeric parameter to a string.
Declaration FStr (N : LongInt)
Result type String
Remarks This function is often easier to use than the
standard "Str" procedure, however "FStr" can only
convert integer types.
See also FVal
Example Var
S : String;
N : Byte; { Shortint/Word/Integer/Longint }
Begin
N:=100;
S:=FStr(N);
WriteLn (N);
WriteLn (S);
End;
RADU v1.10 Programmer's reference manual Page 50
│ FVal Function
└───────────────────────────────────────────────────────────────
Function Converts the specified string to an integer type.
Declaration FVal (S : String)
Result type LongInt
Remarks When the string cannot be converted, this function
returns 0.
See also FStr
Example N:=FVal(Copy(S,10,14));
│ LastChar Function
└───────────────────────────────────────────────────────────────
Function Returns the last character of the specified
string.
Declaration LastChar (S : String)
Result type Char
Remarks When the string is empty, this function returns
#0.
Example If LastChar('ABC')<>'C' then
WriteLn ('Huh?');
Page 51 RADU v1.10 Programmer's reference manual
│ LeftJust Function
└───────────────────────────────────────────────────────────────
Function Returns a string expanded to the specified length
by putting spaces at the right of the string.
Declaration LeftJust (S : String;Len : Byte)
Result type String
Remarks This function calls "LeftJustChar"
See also LeftJustChar, RightJust, RightJustChar
Example WriteLn (LeftJust(Name,30),LeftJust(City,30));
│ LeftJustChar Function
└───────────────────────────────────────────────────────────────
Function Returns a string expanded to the specified length
by putting the specified character at the right of
the string.
Declaration LeftJustChar (S : String;Len : Byte;C : Char)
Result type String
See also LeftJust, RightJust, RightJustChar
Example WriteLn (LeftJustChar(Name,30,'■'));
RADU v1.10 Programmer's reference manual Page 52
│ LowCase Function
└───────────────────────────────────────────────────────────────
Function Returns the character in lowercase.
Declaration LowCase (C : Char)
Result type Char
See also SLowCase, SUpCase
Example WriteLn (LowCase('A'));
│ RightJust Function
└───────────────────────────────────────────────────────────────
Function Returns a string expanded to the specified length
by putting spaces at the left of the string.
Declaration RightJust (S : String;Len : Byte)
Result type String
Remarks This function calls "RightJustChar".
See also LeftJust, LeftJustChar, RightJustChar
Example WriteLn (RightJust(FStr(123),5));
Page 53 RADU v1.10 Programmer's reference manual
│ RightJustChar Function
└───────────────────────────────────────────────────────────────
Function Returns a string expanded to the specified length
by putting the specified character at the left of
the string.
Declaration RightJustChar (S : String;Len : Byte;C : Char)
Result type String
See also LeftJust, LeftJustChar, RightJust
Example WriteLn (RightJustChar(FStr(123),5,'0'));
│ SLowCase Function
└───────────────────────────────────────────────────────────────
Function Returns the whole string in lowercase.
Declaration SLowCase (S : String)
Result type String
See also LowCase, SUpCase
Example WriteLn ('SLowCase('AbCdEfGh'));
│ SUpCase Function
└───────────────────────────────────────────────────────────────
Function Returns the whole string in upper case.
Declaration SUpCase (S : String)
Result type String
See also LowCase, SLowCase
Example If SUpCase(Command)='QUIT' then
Halt;
RADU v1.10 Programmer's reference manual Page 54
│ TimeStr Function
└───────────────────────────────────────────────────────────────
Function Returns the current time in the given format.
Declaration TimeStr (WithSec,WithHS : Boolean)
Result type String15
Remarks This function returns the current time in the
following format: HH:MM:SS.hh. :SS is only
included when "WithSec" is TRUE, and .hh is only
included when "WithHS" is TRUE.
See also DateStr
Example WriteLn ('Current time : ',TimeStr (TRUE,FALSE));
│ ToDec Function
└───────────────────────────────────────────────────────────────
Function Converts a hexadecimal number (max two digits) to
a decimal number.
Declaration ToDec (Hex : String)
Result type Byte
Remarks The hex string is not case sensitive.
See also ToHex
Example WriteLn (ToDec('Fe'));
Page 55 RADU v1.10 Programmer's reference manual
│ ToHex Function
└───────────────────────────────────────────────────────────────
Function Converts a decimal value to a hexadecimal string.
Declaration ToHex (Dec : Byte)
Result type String
See also ToDec
Example WriteLn (ToHex(62));
│ Trim Function
└───────────────────────────────────────────────────────────────
Function Removes leading and trailing spaces in a string.
Declaration Trim (S : String)
Result type String
Remarks Calls "TrimLeft" and "TrimRight".
See also TrimLeft, TrimRight
Example S:=Trim(S);
RADU v1.10 Programmer's reference manual Page 56
│ TrimLeft Function
└───────────────────────────────────────────────────────────────
Function Removes all leading spaces in a string.
Declaration TrimLeft (S : String)
Result type String
See also Trim, TrimRight
Example S:=TrimLeft(S);
│ TrimRight Function
└───────────────────────────────────────────────────────────────
Function Removes all trailing spaces in a string.
Declaration TrimRight (S : String)
Result type String
See also Trim, TrimLeft
Example S:=TrimRight(S);
Page 57 RADU v1.10 Programmer's reference manual
╔══════
║ 4 Advanced features of RADU
╙───────────────────────────────────────────────────────────────
After have used the above routines for a while, it's possible
that you want more! Well, there IS more. With RADU you can
directly access the FOSSIL driver, make your door work perfectly
with DESQview, make your door multi-line compatible, etc etc.
╔══════
║ Direct access to the FOSSIL
╙───────────────────────────────────────────────────────────────
Although you'll probably never need it, I've included the
following routines for "just in case". I recommend that you only
access the FOSSIL directly when there is no other way to do a
certain action.
│ FosCarrier Function
└───────────────────────────────────────────────────────────────
Function Returns TRUE when the modem's DCD signal is
active.
Declaration FosCarrier
Result type Boolean
RADU v1.10 Programmer's reference manual Page 58
│ FosFlushOutput Procedure
└───────────────────────────────────────────────────────────────
Function Waits until the FOSSIL's output buffer has been
flushed.
Declaration FosFlushOutput
Remarks Note that some modems have internal buffers, and
that this procedure only flushes the buffer of the
FOSSIL. When during flushing the carrier drops,
this procedure will return.
│ FosInReady Function
└───────────────────────────────────────────────────────────────
Function Returns TRUE when a character is available to be
read from the FOSSIL's input buffer.
Declaration FosInReady
Result type Boolean
│ FosPurgeInput Procedure
└───────────────────────────────────────────────────────────────
Function Clears the FOSSIL's input buffer.
Declaration FosPurgeInput
See also FosPurgeInput
Page 59 RADU v1.10 Programmer's reference manual
│ FosPurgeOutput Procedure
└───────────────────────────────────────────────────────────────
Function Clears the FOSSIL's output buffer.
Declaration FosPurgeOutput
See also FosPurgeInput
│ FosRead Function
└───────────────────────────────────────────────────────────────
Function Reads a character from the FOSSIL's input buffer.
If no character is available, this function will
wait until there is one.
Declaration FosRead
Result type Char
See also FosInReady, FosSend, FosSendStr
│ FosSend Procedure
└───────────────────────────────────────────────────────────────
Function Puts a character into the FOSSIL's output buffer.
Declaration FosSend (C : Char)
Remarks When there is no space in the FOSSIL's output
buffer, "FosSend" will wait until there is.
See also FosRead, FosSendStr
RADU v1.10 Programmer's reference manual Page 60
│ FosSendStr Procedure
└───────────────────────────────────────────────────────────────
Function Puts a string into the FOSSIL's output buffer.
Declaration FosSendStr (S : String)
Remarks Calls "FosSend" for each character in the string
"S".
See also FosSend
│ FosSetDTR Procedure
└───────────────────────────────────────────────────────────────
Function Changes the state of the DTR line to the modem.
Declaration FosSetDTR (State : Boolean)
Remarks When State is FALSE, the DTR line will be lowered.
This will terminate the call.
Page 61 RADU v1.10 Programmer's reference manual
╔══════
║ Defining sysop command keys and statuslines
╙───────────────────────────────────────────────────────────────
To make the life of the sysop a little more comfortable, RADU
offers the possibility to create special sysop keys, and
statuslines. Statuslines are RA alike, and (when your RADU
version is registered) you can create your own statusline.
│ DorExtCheck Variable
└───────────────────────────────────────────────────────────────
Function Only when "DorExtCheck" is TRUE, RADU will check
the keyboard for extended keys (sysop keys).
Declaration DorExtCheck : Boolean
Remarks This variable is initialized with TRUE by
"DorInit". Change this variable when you
temporarily want to disable sysop key checking.
See also DorExtKeys
Example DorExtCheck:=FALSE;
DoSomeThingStrange;
DorExtCheck:=TRUE;
RADU v1.10 Programmer's reference manual Page 62
│ DorExtKeys Variable
└───────────────────────────────────────────────────────────────
Function Contains pointers to the procedures which should
be called when an extended key is pressed by the
sysop.
Declaration DorExtKeys : Array[0..150] of Procedure;
Remarks When an extended key is pressed, two codes are
returned by "ReadKey". The first code is always
#0, the second code is used by RADU to determine
which sysop function must be invoked. RADU has
some default sysop keys, which can be redefined,
except the keys F1 through F7, F9 and F10. When
you define a function for the key F8, RADU will
first execute that function, and then change the
statusline to statusline 8. This allows you to
change the contents of this line before it will be
displayed.
NOTE! Please remember that you should declare the
procedures FAR!
See also DorExtCheck, DorNullProc
Example Procedure AltM; Far;
Begin
WriteLn ('[Alt-M] Pressed!');
End;
Begin
DorInit;
DorExtKeys[50]:=AltM;
{ .... }
End.
Page 63 RADU v1.10 Programmer's reference manual
│ DorNullProc Variable
└───────────────────────────────────────────────────────────────
Function Points to an empty (null) procedure. Use this
variable to clear sysop keys.
Declaration DorNullProc : Procedure
See also DorExtCheck, DorExtKeys
Example Begin
DorInit;
DorExtKeys[50]:=AltM; { Define the key }
{ .... }
DorExtKeys[50]:=DorNullProc; { Clear the key }
{ .... }
End.
│ DorStatus Procedure
└───────────────────────────────────────────────────────────────
Function Changes the active statusbar.
Declaration DorStatus (Nr : Byte)
Remarks "Nr" is the new statusline to display. When "Nr"
is the current statusline, "DorStatus" will return
immediately. If you want to refresh the contents
of the statusline if it's the current one, you
should add 10 to the statusline number. This
construction is done because refreshing some
statuslines each time can slow down your program.
See also DorStatLn
Example DorStatus (1); { Change to statusline 1 }
DorStatus (11); { Statln 1, refresh if already 1 }
RADU v1.10 Programmer's reference manual Page 64
╔══════
║ The pre-defined sysop keys.
╙───────────────────────────────────────────────────────────────
The following keys will automatically be defined by DorInit.
[UpArrow] : Increase time by one minute.
[DownArrow] : Decrease time by one minute.
[Alt-C] : Activate the built-in chatmode.
[Alt-G] : Display some garbage to thrill the user :-))
[Alt-H] : Hang up; terminates the call.
[Alt-L] : Lock-out user.
[Alt-N] : Sysop next (only works with a registered RA)
[Alt-O] : Override paging.
[Alt-S] : Change security level.
[F1] [F2]
[F3] [F5] : Statistics about the user currently online.
[F4] : System statistics.
[F6] : Registered/unregistered note of RADU.
[F7] : IEMSI session information.
[F8] : Definable by you! (Only when registered)
[F9] : Hotkey summary help (Changeable when
registered).
[F10] : Remove statusline. [F1] to [F9] brings it back.
The built-in chatmode can be either a normal RA-alike chatmode,
or a splitscreen chatmode (ANSI, AVATAR or IEMSI). By default
RADU uses the splitscreen version, but you can always switch
between them with [Ctrl-S]. When you hold [Shift] while the
chatmode is invoked, you will always enter the normal chatmode.
The sysop can configure the default state for each emulation
method using the "RADUCHAT" environment variable. When RADU
finds one or more of the keywords "ANS", "AVT" or "IEMSI" in
this variable, it will only use the splitscreen version for the
listed cases.
When the normal chatmode is active, you can use [Ctrl-A] for
capture.
Page 65 RADU v1.10 Programmer's reference manual
│ ChatEndStr Variable
└───────────────────────────────────────────────────────────────
Function Is the string which will be displayed when the
chatmode was terminated by the sysop.
Declaration ChatEndStr : String
Remarks "DorInit" sets this variable to the value returned
by "RalGet(ralEndCht)"
See also ChatStr, ChatSysopStr, ChatUserStr
Example ChatEndStr:='`a15:Adios, CU next time!'
│ ChatStr Variable
└───────────────────────────────────────────────────────────────
Function Is the string which will be displayed when the
chatmode is invoked.
Declaration ChatStr : String;
Remarks "DorInit" sets this variable to the value returned
by "RalGet(ralStartCht)".
See also ChatEndStr, ChatSysopStr, ChatUserStr
Example ChatStr:=^L+'`a15:Hi there! Here is your sysop!'
│ ChatSysopStr Typed constant
└───────────────────────────────────────────────────────────────
Function Is the string which will be displayed when the
sysop presses a key just after the user pressed
one. This allows you to customize the colors used
in the chatmode.
Declaration ChatSysopStr : String = '`a15:'
See also ChatEndStr, ChatStr, ChatUserStr
Example ChatSysopStr:='`a14:'
RADU v1.10 Programmer's reference manual Page 66
│ ChatUserStr Typed constant
└───────────────────────────────────────────────────────────────
Function Is the string which will be displayed when the
user presses a key just after the sysop pressed
one. This allows you to customize the colors used
in the chatmode.
Declaration ChatUserStr : String = '`a7:'
See also ChatEndStr, ChatStr, ChatSysopStr
Example ChatUserStr:='`a4:'
Page 67 RADU v1.10 Programmer's reference manual
╔══════
║ DESQview support functions
╙───────────────────────────────────────────────────────────────
For multi-tasking purposes the program DESQview is very often
used. Unfortunately too few programs are DESQview aware,
resulting in slow or incompatible programs. RADU automatically
gives time-slices to other tasks whenever possible, and only
writes into the DESQview video buffer. I don't think you'll need
to use the following DESQview routines, but just in case, you
never know.
│ DvPause Procedure
└───────────────────────────────────────────────────────────────
Function Give time to other DESQview tasks.
Declaration DvPause
Remarks RADU uses this procedure internally whenever
possible to get an optimal performance when
running under DESQview.
Example Repeat
DvPause;
Until Finished;
│ DvStartCritical Procedure
└───────────────────────────────────────────────────────────────
Function Disables multi-tasking when running under
DESQview.
Declaration DvStartCritical
Remarks When some code requires that no other task is
running at the same time, use this procedure to
freeze any other task.
See also DvStopCritical
RADU v1.10 Programmer's reference manual Page 68
│ DvStopCritical Procedure
└───────────────────────────────────────────────────────────────
Function Re-enables multi-tasking when running under
DESQview.
Declaration DvStopCritical
Remarks DvStopCritical _MUST_ be called after a call to
DvStartCritical.
See also DvStartCritical
Example DvStartCritical;
DoSomethingStrange;
DvStopCritical;
Page 69 RADU v1.10 Programmer's reference manual
╔══════
║ Writing multi-line doors
╙───────────────────────────────────────────────────────────────
RADU offers limited routines for writing multi-line aware doors.
You can send messages to other nodes and share files, but you
cannot send data directly to an other node. I am working hard on
it, but the results so far are not satisfactory, and I only want
to release good, reliable and efficient programs. So please have
some patience, the internode-interface will be released in a few
months. For filesharing the following constants are declared:
Const
ReadMode = 0;
WriteMode = 1;
ReadWriteMode = 2;
DenyAll = $10;
DenyWrite = $20;
DenyRead = $30;
DenyNone = $40;
Inheritance = $80;
RADU v1.10 Programmer's reference manual Page 70
│ DorSendMessage Procedure
└───────────────────────────────────────────────────────────────
Function Sends a message to another user currently online.
Declaration DorSendMessage (LineNr : Byte)
Remarks "LineNr" is the line number to send the message
to. When "LineNr" equals to 0, a list of all users
currently online will be displayed.
See also ClrScr
Example DorSendMessage(0);
│ LockRecords Procedure
└───────────────────────────────────────────────────────────────
Function Locks a region of a typed or untyped file.
Declaration LockRecords (Var F;StartRec,NumRec : LongInt)
Remarks "F" is the file, typed or untyped (not text).
"StartRec" is the number of the first record, and
"NumRec" is the number of records to lock. Please
don't forget to unlock the region after use, and
don't lock the region for a long time.
See also LockResult, UnLockRecords
Page 71 RADU v1.10 Programmer's reference manual
│ LockResult Function
└───────────────────────────────────────────────────────────────
Function Returns the status of the last lock/unlock.
Declaration LockResult
Result type Byte
Remarks Possible error codes:
0 No error
6 Invalid handle (file not open?)
17 Lock violation (already locked?)
After a call to this function the error code will
be cleared.
See also LockRecords, UnLockRecords
│ ShareInstalled Function
└───────────────────────────────────────────────────────────────
Function Returns TRUE when "SHARE.EXE" is installed.
Declaration ShareInstalled
Result type Boolean
Remarks RADU uses this function internally, and ignores
lock/unlock when "SHARE.EXE" is not installed.
See also LockRecords, UnLockRecords
RADU v1.10 Programmer's reference manual Page 72
│ UnLockRecords Procedure
└───────────────────────────────────────────────────────────────
Function Unlocks a region of a typed or untyped file.
Declaration UnLockRecords (Var F;StartRec,NumRec : LongInt)
Remarks "F" is the typed or untyped file (not text),
"StartRec" is the record number of the first
record to unlock, "NumRec" is the number of
records to unlock. Between locking and unlocking a
region of a file no other process can access that
area. If the time that the area is locked is too
long, the other process can get an error.
NOTE! When you close the file before unlocking the
locked area, strange things will happen! Be sure
to unlock anything you've locked!
See also LockRecords, LockResult
Example LockRecords (DataFile,10,20);
{ Manipulate data }
UnLockRecords (DataFile,10,20);
│ UOnClear Procedure
└───────────────────────────────────────────────────────────────
Function Deletes the "UserDoes" file.
Declaration UOnClear
Remarks This procedure only has effect when running in
multi-line mode. RADU calls "UOnClear"
automatically when it passes control back to the
BBS.
See also UOnGet, UOnSet
Example UOnClear;
Halt;
Page 73 RADU v1.10 Programmer's reference manual
│ UOnGet Function
└───────────────────────────────────────────────────────────────
Function Returns the contents of the "Userdoes" file of a
user currently online at another node.
Declaration UOnGet (Line : Byte)
Result type UOnString
Remarks "UOnString" is a type declared in RADU as
String[70].
Type
UOnString = String[70];
When the "UserDoes" file could not be opened
(missing) or when not running in multi-line mode,
an empty string will be returned.
See also UOnClear, UOnSet
Example WriteLn (UOnGet(3));
│ UOnSet Procedure
└───────────────────────────────────────────────────────────────
Function Creates a "UserDoes" file in the RA system
directory.
Declaration UOnSet (What : UOnString)
Remarks This procedure only has effect when running in
multi-line mode. For more information about UserOn
I refer to the file "USERON20.ZIP" which can be
found on many BBS's (including mine).
See also UOnClear, UOnGet
Example UOnSet ('User is using the timebank.');
RADU v1.10 Programmer's reference manual Page 74
╔══════
║ Special Write(ln) extensions
╙───────────────────────────────────────────────────────────────
RADU has extended the write(ln) command to be very useful,
especially when writing doors. With RADU you can simply send
ANSI, AVATAR and RA codes using Write(ln), RADU will interpret
the codes and do the corresponding actions. Besides that RADU
has added a very powerful feature, the RADU codes! These codes
can save you a lot of time and frustration!
╔══════
║ Internal ANSI and AVATAR emulation
╙───────────────────────────────────────────────────────────────
Thanks to the internal ANSI and AVATAR emulator in RADU you can
simply send ANSI or AVATAR codes with Write(ln). RADU supports
most ANSI codes, and all AVATAR codes as defined in
FSC-0037.TXT. Example:
Write (^[+'[2J'); { ANSI code }
Write (^V^A#7); { AVATAR code }
╔══════
║ Remote Access textfile codes
╙───────────────────────────────────────────────────────────────
You can also display the Remote Access textfile codes with
Write(ln). For a list of all RA codes supported by RADU, please
look at appendix D. Example:
WriteLn ('Your full name is: ',^F,'A');
Page 75 RADU v1.10 Programmer's reference manual
╔══════
║ RADU codes
╙───────────────────────────────────────────────────────────────
While writing some doors I noticed how often I needed the
sequence "GotoXY", "TextColor" followed by a "Write(ln)"
statement. After some time I got a bit irritated, my source got
pretty large and not very surveyable anymore. So I "invented"
the RADU codes! With these codes you can do all these actions
with just one statement: Write(ln)! You just insert some codes
into your text to display, and RADU will do the work for you!
Just try it, I'm sure you'll like it! But be careful, use it in
a structured way, otherwise you can make a real mess out of it!
Don't say I didn't warn you!
All codes are in the following form:
<`><Code><Parameters><:>
<Code> is one of the characters "ABCDFGHLXY"
<Parameters> Are zero or more parameters (always numeric)
serparated by commas.
Example: `g10,10:
The following codes are defined at this moment.
╔══════
║ "A" change text attribute
╙───────────────────────────────────────────────────────────────
Code letter "A"
Function Changes the text attribute
Remarks Changing the text color using this code is the
most efficient way to change the color. This is
because with this code you can change the fore-
and background color at the same time! This will
give a much more efficient ANS/AVT code.
Parameters "A" needs only one parameter, and that's the new
text attribute. This number must be in the range
0..255.
See also HighVideo, LowVideo, NormVideo, TextAttr,
TextBackGround, TextColor, "B", "F", "H", "L"
Example Write ('`a122:Hi! `a7:There!');
RADU v1.10 Programmer's reference manual Page 76
╔══════
║ "B" change background color
╙───────────────────────────────────────────────────────────────
Code letter "B"
Function Changes the background color.
Parameters "B" needs only one parameter, and that's the new
background color. This number must be in the range
0..15.
See also TextBackGround, "A", "F", "H", "L"
Example Write ('`b7:White background.');
╔══════
║ "C" center a line of text
╙───────────────────────────────────────────────────────────────
Code letter "C"
Function Center a line of text on the current line.
Remarks This code MUST be at the beginning of a line. It
will center all the text of the Write(ln)
statement.
See also "X"
Example WriteLn ('`c:This text will be centered.');
Page 77 RADU v1.10 Programmer's reference manual
╔══════
║ "D" duplicate a character x times
╙───────────────────────────────────────────────────────────────
Code letter "D"
Function Writes a single character many times.
Remarks This code is extremely useful, besides that you
can easily duplicate a character, it's also
extremely fast when the user wants AVATAR codes to
be sent.
Parameters This code needs two parameters. The first
parameter is the ASCII code of the character to
duplicate (range 0..255), the second parameter is
the number of times that the character should be
repeated (range 0..255).
See also DupWrite
Example Write ('`d196,80:`d10,3:');
╔══════
║ "F" change the foreground color
╙───────────────────────────────────────────────────────────────
Code letter "F"
Function Changes the foreground color.
Parameters This code needs one parameter, the new foreground
color. This value must be in range 0..15.
See also TextColor, "A", "B", "H", "L"
Example Write ('`f3:Hi `f5:',^F,'A');
RADU v1.10 Programmer's reference manual Page 78
╔══════
║ "G" change current cursor position
╙───────────────────────────────────────────────────────────────
Code letter "G"
Function Changes the cursor to an absolute or relative
position on the screen.
Parameters This code needs two parameters. These parameters
can be in two forms.
1) Without a sign, in this case you mean an
absolute position (relative to the top-left
courner of your screen)
2) With a sign (-/+). In this case you mean a
position relative to the current cursor
position.
See also GotoXY, "C", "X", "Y"
Example Write ('`g10,20:'); { Cursor to X=10,Y=20 }
Write ('`g-3,10:'); { Move 3 pos left, and Y=10 }
Write ('`g+0,+3:'); { Move 3 lines down }
╔══════
║ "H" select high intensity characters
╙───────────────────────────────────────────────────────────────
Code letter "H"
Function Sets the high intensity bit on.
See also HighVideo, LowVideo, NormVideo, "A", "B", "F", "L"
Example WriteLn ('`h:High video.');
╔══════
║ "L" select low intensity characters
╙───────────────────────────────────────────────────────────────
Code letter "L"
Function Sets the high intensity bit off.
See also HighVideo, LowVideo, NormVideo, "A", "B", "F", "H"
Example WriteLn ('`h:High and `l:Low intensity.');
Page 79 RADU v1.10 Programmer's reference manual
╔══════
║ "X" change current cursor X position
╙───────────────────────────────────────────────────────────────
Code letter "X"
Function Moves the X-position of the cursor to an absolute
or relative position on the screen.
Parameters Only one parameter is needed for this code. As
with the "G" code, you can use a sign or not, see
"G" for more details.
See also GotoXY, "C", "G", "Y"
Example Write ('`x10:'); { Place cursor at pos X=10 }
Write ('`x-5:'); { Move cursor 5 pos to left }
Write ('`x+5:'); { Move cursor 5 pos to right }
╔══════
║ "Y" change current cursor Y position
╙───────────────────────────────────────────────────────────────
Code letter "Y"
Function Moves the Y-position of the cursor to an absolute
or relative position on the screen.
Parameters Only one parameter is needed for this code. As
with the "G" code, you can use a sign or not, see
"G" for more details.
See also GotoXY, "G", "X"
Example Write ('`y10:'); { Place cursor at Y=10 }
Write ('`y-5:'); { Move cursor 5 lines up }
Write ('`y+5:'); { Move cursor 5 lines down }
RADU v1.10 Programmer's reference manual Page 80
╔══════
║ 5 THANKS
╙───────────────────────────────────────────────────────────────
I'd like to thank everyone who has helped me developing RADU.
Without these people RADU would never be what it has become now!
Thanks to (in alphabetic order):
Arnoel Bisschop, thanks for your tips and intensive testing of
RADU!
Erick van Emmerick, thanks for your tips and testing of RADU!
Erwin Elvers, thanks for writing a Norton Guide for RADU!
Hans Siemons, thanks for your tips and testing of RADU!
Maurice Don, from the very beginning of RADU you have already
been using it! Without your help RADU would even never exist!
Thanks a lot for all your comments!
My Mother, thanks for the food-supply when I was working hard on
RADU!
Ruud Loeffen, thanks for your tips, ohh yeah, I did not forget
you, hehehe:-))
Willem van Pelt, thanks for checking this document, your english
(eeeh English (miereneuker;-))) is better than mine!
Page 81 RADU v1.10 Programmer's reference manual
╔══════
║ Appendix A: Complete ASCII table
╙───────────────────────────────────────────────────────────────
0 00 ^@ NUL 32 20 64 40 @ 96 60 `
1 01 ^A SOH 33 21 ! 65 41 A 97 61 a
2 02 ^B STX 34 22 " 66 42 B 98 62 b
3 03 ^C ETX 35 23 # 67 43 C 99 63 c
4 04 ^D EOT 36 24 $ 68 44 D 100 64 d
5 05 ^E ENQ 37 25 % 69 45 E 101 65 e
6 06 ^F ACK 38 26 & 70 46 F 102 66 f
7 07 ^G BEL 39 27 ' 71 47 G 103 67 g
8 08 ^H BS 40 28 ( 72 48 H 104 68 h
9 09 ^I TAB 41 29 ) 73 49 I 105 69 i
10 0A ^J LF 42 2A * 74 4A J 106 6A j
11 0B ^K VT 43 2B + 75 4B K 107 6B k
12 0C ^L FF 44 2C , 76 4C L 108 6C l
13 0D ^M CR 45 2D - 77 4D M 109 6D m
14 0E ^N SO 46 2E . 78 4E N 110 6E n
15 0F ^O SI 47 2F / 79 4F O 111 6F o
16 10 ^P DLE 48 30 0 80 50 P 112 70 p
17 11 ^Q DC1 49 31 1 81 51 Q 113 71 q
18 12 ^R DC2 50 32 2 82 52 R 114 72 r
19 13 ^S DC3 51 33 3 83 53 S 115 73 s
20 14 ^T DC4 52 34 4 84 54 T 116 74 t
21 15 ^U NAK 53 35 5 85 55 U 117 75 u
22 16 ^V SYN 54 36 6 86 56 V 118 76 v
23 17 ^W ETB 55 37 7 87 57 W 119 77 w
24 18 ^X CAN 56 38 8 88 58 X 120 78 x
25 19 ^Y EM 57 39 9 89 59 Y 121 79 y
26 1A ^Z SUB 58 3A : 90 5A Z 122 7A z
27 1B ^[ ESC 59 3B ; 91 5B [ 123 7B {
28 1C ^\ FS 60 3C < 92 5C \ 124 7C |
29 1D ^] GS 61 3D = 93 5D ] 125 7D }
30 1E ^^ RS 62 3E > 94 5E ^ 126 7E ~
31 1F ^_ US 63 3F ? 95 5F _ 127 7F
RADU v1.10 Programmer's reference manual Page 82
128 80 Ç 160 A0 á 192 C0 └ 224 E0 α
129 81 ü 161 A1 í 193 C1 ┴ 225 E1 ß
130 82 é 162 A2 ó 194 C2 ┬ 226 E2 Γ
131 83 â 163 A3 ú 195 C3 ├ 227 E3 π
132 84 ä 164 A4 ñ 196 C4 ─ 228 E4 Σ
133 85 à 165 A5 Ñ 197 C5 ┼ 229 E5 σ
134 86 å 166 A6 ª 198 C6 ╞ 230 E6 µ
135 87 ç 167 A7 º 199 C7 ╟ 231 E7 τ
136 88 ê 168 A8 ¿ 200 C8 ╚ 232 E8 Φ
137 89 ë 169 A9 ⌐ 201 C9 ╔ 233 E9 Θ
138 8A è 170 AA ¬ 202 CA ╩ 234 EA Ω
139 8B ï 171 AB ½ 203 CB ╦ 235 EB δ
140 8C î 172 AC ¼ 204 CC ╠ 236 EC ∞
141 8D ì 173 AD ¡ 205 CD ═ 237 ED φ
142 8E Ä 174 AE « 206 CE ╬ 238 EE ε
143 8F Å 175 AF » 207 CF ╧ 239 EF ∩
144 90 É 176 B0 ░ 208 D0 ╨ 240 F0 ≡
145 91 æ 177 B1 ▒ 209 D1 ╤ 241 F1 ±
146 92 Æ 178 B2 ▓ 210 D2 ╥ 242 F2 ≥
147 93 ô 179 B3 │ 211 D3 ╙ 243 F3 ≤
148 94 ö 180 B4 ┤ 212 D4 ╘ 244 F4 ⌠
149 95 ò 181 B5 ╡ 213 D5 ╒ 245 F5 ⌡
150 96 û 182 B6 ╢ 214 D6 ╓ 246 F6 ÷
151 97 ù 183 B7 ╖ 215 D7 ╫ 247 F7 ≈
152 98 ÿ 184 B8 ╕ 216 D8 ╪ 248 F8 °
153 99 Ö 185 B9 ╣ 217 D9 ┘ 249 F9 ∙
154 9A Ü 186 BA ║ 218 DA ┌ 250 FA ·
155 9B ¢ 187 BB ╗ 219 DB █ 251 FB √
156 9C £ 188 BC ╝ 220 DC ▄ 252 FC ⁿ
157 9D ¥ 189 BD ╜ 221 DD ▌ 253 FD ²
158 9E ₧ 190 BE ╛ 222 DE ▐ 254 FE ■
159 9F ƒ 191 BF ┐ 223 DF ▀ 255 FF
Page 83 RADU v1.10 Programmer's reference manual
╔══════
║ Appendix B: Extended keyboard codes
╙───────────────────────────────────────────────────────────────
After pressing an extended key, ReadKey will return two codes,
the first code is always ASCII 0, the second one is listed
below.
Second code Meaning
────────────────────────────────────────────────────────────────
3 NUL
15 Shift Tab
16-25 Alt-Q/W/E/R/T/Y/U/I/O/P
30-38 Alt-A/S/D/F/G/H/J/K/L
44-50 Alt-Z/X/C/V/B/N/M
59-68 F1-F10
71 Home
72 Cursor up
73 PgUp
75 Cursor left
77 Cursor right
79 End
80 Cursor down
81 PgDn
82 Ins
83 Del
84-93 Shift-F1 to Shift-F10
94-103 Ctrl-F1 to Ctrl-F10
104-113 Alt-F1 to Alt-F10
114 Ctrl-PrtScr
115 Ctrl-Cursor-Left
116 Ctrl-Cursor-Right
117 Ctrl-End
118 Ctrl-PgDn
119 Ctrl-Home
120-131 Alt-1/2/3/4/5/6/7/8/9/0/-/=
132 Ctrl-PgUp
133 F11
134 F12
135 Shift-F11
136 Shift-F12
137 Ctrl-F11
138 Ctrl-F12
139 Alt-F11
140 Alt-F12
RADU v1.10 Programmer's reference manual Page 84
╔══════
║ Appendix C: List of Turbo Pascal Runtime errors
╙───────────────────────────────────────────────────────────────
When a door exits due to a runtime error, it will automatically
log the error code and address in the Remote Access system
logfile. The following errorcodes can be returned by a pascal
program:
■ DOS-errors
001 Invalid function number.
002 File not found.
003 Path not found.
004 Too many open files.
005 File access denied.
006 Invalid file handle.
012 Invalid file access code.
015 Invalid drive number.
016 Cannot remove current directory.
017 Cannot rename across drives.
■ I/O errors.
100 Disk read error.
101 Disk write error.
102 File not assigned.
103 File not opened.
104 File not open for input.
105 File not open for output.
106 Invalid numeric format.
■ Critical errors
150 Disk is write-protected.
151 Unknown unit.
152 Drive not ready.
153 Unknown command.
154 CRC error in data.
155 Bad drive request structure length.
156 Disk seek error.
157 Unknown media type.
158 Sector not found.
159 Printer out of paper.
160 Device write fault.
161 Device read fault.
162 Hardware failure.
■ Fatal errors.
200 Division by zero.
201 Range check error.
202 Stack overflow.
203 Heap overflow.
204 Invalid pointer operation.
205 Floating point overflow.
206 Floating point underflow.
207 Invalid floating point operation.
208 Overlay manager not installed.
209 Overlay file read error.
Page 85 RADU v1.10 Programmer's reference manual
210 Object not initialized.
211 Call to abstract method.
212 Stream registration error.
213 Collection out of range.
214 Collection overflow error.
RADU v1.10 Programmer's reference manual Page 86
╔══════
║ Appendix D: Remote Access textfile codes
╙───────────────────────────────────────────────────────────────
RADU supports the following RA alike textfile codes.
^A Wait for [Enter].
^F Insert a user parameter (see table below).
^G Produces a beep on the caller's console.
^H Non-destructive backspace (send ^H+' '+^H for a
destructive backspace).
^I Tab, forward to next tab position.
^J Line feed (no carriage return).
^K Insert a system parameter (see table below)
^L Clear screen.
^M Carriage return (no linefeed).
^V Reserved for AVATAR
^W Pause for one second.
^Y Reserved for AVATAR
^[ Reserved for ANSI
User parameters
────────────────────────────────────────────────────────────────
^FA User's full name
^FB Location
^FC Password
^FD Business/Data phone number
^FE Voice/Home phone number
^FF Data of last call
^FG Time of last call
^FH A Flags setting
^FI B Flags setting
^FJ C Flags setting
^FK D Flags setting
^FL Netmail credit remaining (cents)
^FM Total messages posted
^FN Number of last message read
^FO Security level
^FP Total calls to the BBS
^FQ Number of uploads
^FR Kilobytes of uploads
^FS Number of downloads
^FT Kilobytes of downloads
^FU Minutes used today
^FV Current screen length
^FW User's first name only
^FX Ansi setting (On /Off)
^FY "Continue?" Prompt setting (On /Off)
^FZ Screen clearing (On /Off)
^F0 Full screen editor (On /Off)
^F1 Quiet/do not disturb mode (On /Off)
^F2 Hot-Keys (On /Off)
^F3 Handle/alias of user
^F4 Date of first call
^F5 Date of birth
Page 87 RADU v1.10 Programmer's reference manual
^F6 Subscription expiry date
^F8 AVATAR setting (On /Off)
^F; Full screen message viewer (On /Off)
^F< Current date format
^F= Message forwarding (On /Off)
^F> Forward to (or nobody)
^F? Users current file ratio (number)
^F@ Users current file ratio (KB)
^F[ KB download limit remaining for today
^F\ Name of current selected language
^F] Users comment field
System parameters
────────────────────────────────────────────────────────────────
^KA Total system calls
^KB Last caller (any line)
^KF Number of times user has paged sysop
^KI Time in 24 hour format
^KJ Todays date
^KM Minutes used today
^KN Seconds used today (always returns 00)
^KO Minutes remaining today
^KP Seconds remaining today (always returns 00)
^KR Current baud rate
^KS Day of week (abbreviated form)
^KV 24 hour format time of next event
^KW Line number
^KX Terminates the call. (Forces DTR low, has no effect in
local mode)
^K\ Clear to end of line
^K]xxx Display entry xxx (decimal) from .RAL file
^K[xx Change color attribute to xx (hex)
^K1 Current msg area number
^K2 Current file area number
RADU v1.10 Programmer's reference manual Page 88
╔══════
║ Index
╙───────────────────────────────────────────────────────────────
"A" . . . . . . . . . . . . 75 DorPage . . . . . . . . . . 38
"B" . . . . . . . . . . . . 76 DorPath . . . . . . . . . . 26
"C" . . . . . . . . . . . . 76 DorRefresh . . . . . . . . 35
"D" . . . . . . . . . . . . 77 DorSendMessage . . . . . . 69
"F" . . . . . . . . . . . . 77 DorSetHotKeys . . . . . . . 44
"G" . . . . . . . . . . . . 78 DorStatLn . . . . . . . . . 26
"H" . . . . . . . . . . . . 78 DorStatus . . . . . . . . . 63
"L" . . . . . . . . . . . . 78 DorSysopKey . . . . . . . . 27
"X" . . . . . . . . . . . . 79 DorTimeOut . . . . . . . . 28
"Y" . . . . . . . . . . . . 79 Dup . . . . . . . . . . . . 48
ANSI . . . 11, 12, 18, 22, 74 Duplicate . . . . . . . . . 77
ASCII . . . . . . . . . . . 12 DupWrite . . . . . . . . . 36
ASCII table . . . . . . . . 81 DvActive . . . . . . . . . 28
ASCIIZtoStr . . . . . . . . 47 DvPause . . . . . . . . . . 67
ASYNC . . . . . . . . . . . 9 DvStartCritical . . . . . . 67
AVATAR . . . . 12, 22, 36, 74 DvStopCritical . . . . . . 68
Byte2Flags . . . . . . . . 37 DvVer . . . . . . . . . . . 29
Center . . . . . . . . . . 76 DvVidSeg . . . . . . . . . 29
CharSet . . . . . . . . . . 34 Exec . . . . . . . . . . . 36
ChatEndStr . . . . . . . . 65 ExitInfo . . . . . . . . . 29
Chatmode . . . . . . . 24, 33 EXITINFO.BBS . . . . . 4, 29
ChatStr . . . . . . . . . . 65 ExitInfoRecord . . . . . . 29
ChatSysopStr . . . . . . . 65 FastWrite . . . . . . . . . 48
ChatUserStr . . . . . . . . 66 Filesharing . . . . . . . . 69
ClrEOL . . . . . . . . . . 10 ForceBack . . . . . . . . . 48
ClrScr . . . . . . . . . . 10 FosCarrier . . . . . . . . 57
CONFIG.RA . . . . . . . 4, 30 FosFlushOutput . . . . . . 57
CrtInput . . . . . . . . . 21 FosInReady . . . . . . . . 58
CrtOutput . . . . . . . . . 21 FosPurgeInput . . . . . . . 58
CTL file . . . . . . . . . 32 FosPurgeOutput . . . . . . 58
CTLRead . . . . . . . . . . 32 FosRead . . . . . . . . . . 59
DateStr . . . . . . . . . . 47 FosSend . . . . . . . . . . 59
Delay . . . . . . . . . . . 11 FosSendStr . . . . . . . . 59
DelLine . . . . . . . . . . 11 FosSetDTR . . . . . . . . . 60
DESQview 11, 28, 29, 48, 57, 67 FOSSIL . . . . 9, 23, 44, 57
DorAnsi . . . . . . . . . . 22 FStr . . . . . . . . . . . 49
DorAvatar . . . . . . . . . 22 FVal . . . . . . . . . . . 49
DorChangeTime . . . . . . . 32 GetKey . . . . . . . . . . 45
DorChat . . . . . . . . . . 33 GotoXY . . . . . . 12, 21, 75
DorCheckIdle . . . . . . . 23 HighVideo . . . . . . . . . 12
DorCleanKeys . . . . . . . 44 HotKeyPressed . . . . . . . 45
DorCommPort . . . . . . . . 23 Hotkeys . . . . . . . . 33, 44
DorDisplay . . . . . . 33, 45 HotReadKey . . . . . . 27, 46
DorExtCheck . . . . . . . . 61 IEMSI . . . . . . . . . . . 64
DorExtKeys . . . . . . . . 62 InsLine . . . . . . . . . . 13
DorFrozen . . . . . . . . . 24 Keyboard codes . . . . . . 83
DorInit . . . 8, 9, 22-24, 26, KeyPressed . . . . . . . . 14
29-31, 61 Language . . . . . . . . . 30
DorIsLocal . . . . . . . . 24 LastChar . . . . . . . . . 50
DorLineEdit . . . . . . . . 34 LeftJust . . . . . . . . . 50
DorMinute . . . . . . . . . 25 LeftJustChar . . . . . . . 51
DorNullProc . . . . . . . . 63 Licensing . . . . . . . . . 6
Page 89 RADU v1.10 Programmer's reference manual
LIMITS.CTL . . . . . . . . 43 TrimRight . . . . . . . . . 56
Lock-out . . . . . . . . . 64 UnLockRecords . . . . . . . 72
LockRecords . . . . . . . . 70 UOnClear . . . . . . . . . 72
LockResult . . . . . . . . 70 UOnGet . . . . . . . . . . 73
Logfile . . . . . . . . . . 41 UOnSet . . . . . . . . . . 73
LowCase . . . . . . . . . . 51 UserDoes . . . . . . . . . 72
LowVideo . . . . . . . . . 14 USERON20.ZIP . . . . . . . 73
Multi-line . . 10, 57, 69, 72 WhereX . . . . . . . . . . 19
Multi-tasking . . . . . . . 67 WhereY . . . . . . . . . . 19
NormVideo . . . . . . . . . 15 Window . . . . . . . . . . 19
NoSound . . . . . . . . . . 15 Write(ln) . . . . . 20, 74, 75
Paging . . . . . . 17, 38, 43 Write(ln) extensions . . . 74
PDN . . . . . . . . . . . . 4
RaCheckFlags . . . . . . . 39
RaCmpFlags . . . . . . . . 39
RaConfig . . . . . . . 30, 41
RADU codes . . . . . . . . 75
RADU.REG . . . . . . . . . 6
RaFormatDate . . . . . . . 40
RalGet . . . . . . . . . . 40
RaLog . . . . . . . . . . . 41
RaNodeNr . . . . . . . . . 30
RaPageStat . . . . . . 41, 43
RaResetFlags . . . . . . . 41
RaSetPageStat . . . . . . . 42
RaSetSecurity . . . . . . . 43
RASTRUCT.PAS . . . . . . . 29
RaSystem . . . . . . . . . 31
RaYell . . . . . . . . 38, 43
Read(ln) . . . . . . . . . 16
ReadKey . . . . . . 16, 27, 62
Registration . . . . . . . 26
RightJust . . . . . . . . . 52
RightJustChar . . . . . . . 52
Runtime errors . . . . . . 84
SHARE.EXE . . . . . . . . . 71
ShareInstalled . . . . . . 71
ShareWare . . . . . . . . . 6
SLowCase . . . . . . . . . 53
Sound . . . . . . . . . . . 17
Statusline . . . . . . . . 26
Statuslines . . . . . . 6, 61
SUpCase . . . . . . . . . . 53
SYS60.TPU . . . . . . . . . 5
Sysop keys . . . . . . . . 61
Sysop next . . . . . . . . 64
TextAttr . . . . . . . . . 31
TextBackGround . . . . . . 17
TextColor . . . . . . . 18, 75
Textfile codes . . . . 74, 86
THANKS . . . . . . . . . . 80
TimeStr . . . . . . . . . . 54
ToDec . . . . . . . . . . . 54
ToHex . . . . . . . . . . . 54
Trim . . . . . . . . . . . 55
TrimLeft . . . . . . . . . 55