



FreeDoor
Version 1.0

BBS Door Authoring Programming Library
For Virtual Pascal

Developed and programmed by Mike Hodgson
Documentation by Mike Hodgson and Sean Dennis

(c) 2000 by Mike Hodgson
All rights reserved.

Please see LGPL.TXT for licensing information.



What is FreeDoor?

FreeDoor is an opensource door authoring programming library for Virtual Pascal, to enable the door author to create doors in the operating systems that Virtual Pascal supports, namely Win32 and OS/2 at this time.  At the time of this writing, FreeDoor was not tested with the Linux support that is in beta in Virtual Pascal.  FreeDoor also contains EleCom, an excellent opensource programming library that allows use of Internet functions (namely sockets and telnet functions) for programs.

How do I set up FreeDoor for use in my system?

Here's the recommended setup (note that in these examples we'll use C:\VP21 as our root directory):

1) Create a directory called FREEDOOR in your VP directory, such as C:\VP21\FREEDOOR.
2) Unzip FreeDoor (using the -D switch if you're using PKUNZIP) into the above-mentioned directory.
3) In Virtual Pascal, click on Options->Directories.
4) Under "Include Directories", put in:
C:\VP21\FREEDOOR\SOURCE;C:\VP21\FREEDOOR\ELECOM;
5) Under "Unit Directories", put in:
C:\VP21\FREEDOOR\SOURCE;C:\VP21\FREEDOOR\ELECOM;
6) Under "Library Directories", put in:
      C:\VP21\FREEDOOR\SOURCE;C:\VP21\FREEDOOR\ELECOM;
7) Under "Resource Directories", put in:
C:\VP21\FREEDOOR\ELECOM\RES\W32;C:\VP21\FREEDOOR\ELECOM\OS2;
8) Open C:\VP21\FREEDOOR\SOURCE\FREEDOOR.PAS, click on Compile, make  sure that the target platform is Win32 and click on Make (or press F9).   Switch the target platform to OS2 and make that library.

You are now set to write door programs in FreeDoor!  Simple, huh?

How do I call FreeDoor from within my program?

That's easy too.  Just include FreeDoor in your Uses clause, like:

Uses CRT, FreeDoor;

... and at the beginning of your main program, make sure you tell FreeDoor what the 
program's name is and call FreeDoor to initialize itself:

Program TestDoor;

Uses CRT, FreeDoor;

Begin
     ProgName := 'My First Door!';
     InitDoorDriver;

(...)
End.

NOTE: You DO NOT have to deinitialize the door driver; FreeDoor will do that itself internally.  There is a command to do so included in FreeDoor, but you should never have to use it.

What dropfiles does FreeDoor support?

At this time, FreeDoor will support  DORINFO1.DAT, DOOR.SYS and DOOR32.SYS formats.  There are no plans at this time for supporting other dropfile formats, but if there is demand for it, support will be considered.

How do I call my door from the command line?

The following command lines are supported in FreeDoor:

For local mode and non-BBS operation:
doorname.exe /L

For normal FOSSIL mode (# is port #):
doorname.exe /Dc:\path\to\door.sys /P#

For Telnet mode (# is port handle)
doorname.exe /Dc:\path\to\door.sys /T /P#

NOTE: If your system is using DOOR32.SYS, /T and /P# are not required.


What constants that FreeDoor uses can I change in my program?





InitDoorDriver : Boolean;

Initializes the door driver (duh!). This should be the first procedure used. Any FreeDoor constants should be changed before calling this.

DeInitDoorDriver;

	Should not need to be called. De-initializing is handled by the kit.

CClrScr;

	Clears the display. Cursor is located at 1,1.

CCLREol;

	Clears to the end of the line. Cursor is located at the beginning of the current row.

CursorSave;

	Saves cursor position. Used in conjunction with CursorRestore.

CursorRestore;

	Restores cursor position saved by CursorSave.

CursorUp (Distance : Integer);

	Move cursor up Distance number of lines.

CursorDown (Distance : Integer);
	
	Move cursor down Distance number of lines.

CursorBack (Distance : Integer);

	Move cursor left Distance number of spaces.

CursorForward (Distance : Integer);

	Move cursor right Distance number of spaces.

CgotoXY (X,Y : Integer);

	Locate cursor to position X,Y.


ErrorWriteLn (S : String);
Shouldn't really be used by door author, but may need to be in some cases. Doesn't update statusbar and time like CWriteLn does...

CWriteLn (S : String);
	
	Display string S at the current location.

CWrite (S : String);

	Same as CWriteLn but does not append trailing carriage return / line feed.

CGetChar (var Ch : Char);

	Gets a character from local and/or remote keyboard and saves it in Ch.

CReadLn (var S : String);

	Gets a string from local and/or remote keyboard and saves it in S.

CWriteLnLong (I : LongInt);

	Writes a numeric variable (Byte, Integer, LongInt) to the display.

CWriteLong (I : LongInt);

	Same as above but without trailing carriage return / line feed.

CGetByte (var B : Byte);

	Get a single byte from the local or remote keyboard.

CReadLnLong (var L : LongInt);

	Get a numeric value from the local or remote keyboard.

CPause;

	Display the pause prompt and wait for a key press.

CWriteFile (FN : String);

	Write a file to the local and remote screens.



CmaskInput (Mask : String; StrLength : Byte) : String;

Creates a mask input line. See Freedoor.inc for different mask strings. Returns the user's input.

CWindow (X1,Y1,X2,Y2 : Byte);

	Create a window using the current color attributes from top left corner X1,Y1 to bottom right corner X2,Y2.

CEXYZ_Send (FN : String) : Boolean;

	Sends a file to the user using the CEXYZ external protocol driver.
	WARNING: This feature has not been tested and more than likely will not
          work.  Please use this with caution.

FreeDoor Documentation		6

