What is DDPlus?
Where is the documentation?
What are the common commands?
What does a small test game look like?
What is DDPlus?
DDPlus is a DoorKit made from a series of Pascal files. It allows programmers to make Door games using Turbo Pascal. Created by Scott Baker and released as Door Driver with Derrick Parkhurst, it was expanded by Steven Lorenz and documented by Bob Dalton. Then, the package was released in 1995 as freeware.
Where is the documentation?
All the documentation for DDPlus is in the ddplus71.zip. Bob Dalton did a great job. The core information is in the DDPLUS.DOC file. We will also be looking at error logging, so you'll want to unzip ELOG.ZIP and take a look at ELOG.DOC.
What are the common commands?
INITDOORDRIVER(filen: string);
This procedure MUST be called before any of DDPlus's features are used. In fact, in most cases it should be the first statement that your program executes. The FILEN variable specifies the filename of the control file that DDPlus will use (i.e. GAME.CTL).
DISPLAYFILE(Filen: String);
This procedure is useful in that it will transfer an ASCII or ANSI file and will put "(C)ontinue, (S)top, (N)onstop" to stop an ASCII file from scrolling off the page.
SCLRSCR;
This procedure clears the remote and the local screens.
SET_COLOR(f,b: byte);
This procedure sets the current foreground and background color, which are specified by the variable bytes f and b. The color is set both on the local side and the remote terminal if the remote user has toggled his ANSI on. The acceptable range for the f is 0-31 and b is 0-7.
SGOTO_XY(x,y: integer);
This procedure lets you position the cursor on the local and remote screen. The valid range for X is 1 to 80, and the valid range for Y is 1 to 24.
SREAD_CHAR(var c: char);
This procedure waits for a character to be pressed and then returns that character in the character variable. No echoing is performed (i.e., the user will not see the key they pressed).
SREAD(var s: string);
This procedure is equivalent to the Turbo Pascal procedure READLN. A string is read from the user and where the CR character is obtained. The procedure exits with the string stored in the string variable, s.
SREAD_NUM(var i: integer);
This procedure is almost identical to the SREAD procedure, except it will read an integer variable instead of a string. Only the characters 0-9 are allowed. The value returned will be in the range of -32768 to +32768.
SREAD_NUM_BYTE(var b: byte);
This procedure is almost identical to the SREAD procedure, except it will read a byte variable instead of a string. Only the characters 0-9 are allowed. The value returned will be in the range of 0 to 255.
SWRITE(s: string);
This procedure is the equivalent of the Turbo Pascal WRITE procedure. SWRITE will simultaneously write to both the local screen and the remote terminal. No CR/LF sequence is added to the end of the string.
SWRITELN(s: string);
This procedure is the equivalent of the Turbo Pascal WRITELN procedure. SWRITELN will simultaneously write to both the local screen and the remote terminal. A CR/LF sequence is appended to the end of the string.
What does a small test game look like?
This is the test program that comes with the documentation for DDPlus. Type it in and save it as NUMDOOR.PAS under the SOURCE folder. Then, compile it to make sure it works.
1. Or download NUMDOOR.PAS: here
A detailed explanation of this process is in the DDPLUS.DOC file that comes with the package.
program numdoor;
uses ddplus;
procedure DoTheTitle;
begin;
sclrscr;
swriteln('Hello, '+user_first_name+
' '+user_last_name+
'. Welcome to NumDoor!');
swriteln('');
end;
procedure playgame;
var
thenum: word;
playerguess: word;
guessnum: byte;
done: boolean;
tempstr: string;
begin;
swriteln('I''m thinking of a number.'+
' Can you guess what it is?');
swriteln('');
guessnum:=0;
randomize;
thenum:=random(100)+1;
done:=false;
while not done do
begin;
inc(guessnum);
swrite('Guess #');
str(guessnum,tempstr);
swrite(tempstr);
swrite(': ');
sread_num_word(playerguess);
if playerguess> thenum then swriteln('Lower!') else
if playerguess< thenum then swriteln('Higher!') else
if playerguess= thenum then
begin;
swriteln('Correct!');
done:=true;
end;
if guessnum=10 then done:=true;
end; { end of while}
if thenum <> playerguess then
begin;
swriteln('You Lost!');
str(thenum,tempstr);
swriteln('The number was '+tempstr+'.');
end;
end;
procedure waitforkey;
var
ch: char;
begin;
swriteln('');
swriteln('Press any key to continue.');
sread_char(ch);
end;
begin;
initdoordriver('GAME.CTL');
dothetitle;
playgame;
waitforkey
end.