home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
drdobbs
/
1990
/
06
/
gessner.lst
< prev
next >
Wrap
File List
|
1990-05-02
|
30KB
|
635 lines
_BUILDING A HYPERTEXT SYSTEM_
by Rick Gessner
[LISTING ONE]
{$V-} {$F+} {$O+} { Written By: Rick Gessner, 1989. }
Unit HyprText;
{-------} Interface {-----------------------------------------------}
PROCEDURE Help_Editor(FileName: String);
PROCEDURE Do_help(FileName: String; GoPage,HomePage: Word);
{-------} Implementation {------------------------------------------}
Uses Crt;
CONST HelpColor : Array[False..true] of Byte =
( Black*16+White, {Used for normal text}
Magenta*16+Yellow); {Used for hot-link text.}
NormalColor : Byte = Black*16+White; {Used to draw screen info.}
BoldColor : Byte = White*16+Black-Blink; {Used for select bar.}
Header : String[50] = ' HyperText System [1.0] ';
MaxLinesPerPage = 15;
MaxLineWidth = 57;
PGUP = 'I'; PGDN = 'Q'; UpArrow = 'H'; {Edit keys}
DnArrow = 'P'; LArrow = 'K'; RArrow = 'M';
ESC = #27; HomeKey = 'G'; EndKey = 'O';
RETURN = ^M; BkSpc = #8; NULL = #0;
Tab = #9; F2 = '<'; DelKey = 'S';
Type HelpRecord = Record {The main structure for our hypertext files}
HelpLines : Array[1..MaxLinesPerPage] of String[100];
end; {String length MUST be > than MaxLineWidth to store hot-links!}
Var HelpRec : HelpRecord;
HelpFile : File of HelpRecord;
Alt,Ctrl,CommandKey : Boolean;
{--------------------------------------------------------------------}
FUNCTION Make_String(Ch : Char; Size : Integer) : String;
Var S: string;
Begin
S[0] := Chr(Size); { Set length byte = SIZE. }
FillChar(S[1],Size,Ch); { Fill the string with chr(CH). }
Make_String:= S; { and return the string as function}
end; {Make String } { value. }
{--------------------------------------------------------------------}
PROCEDURE Draw_Box(topx,topy,botx,boty: Byte; Color,Width: byte);
Type BoxPos = (TopL,TopR,BotL,BotR,Top,Bot,LSide,RSide);
Var Y : Integer;
Const Boxchar : Array[1..2,TopL..RSide] of char =
(( 'Z','?','@','Y','D','D','3','3'), { ASCII chars for single line box }
( 'I',';','H','<','M','M',':',':')); { ASCII chars for double line box }
Begin
TextAttr:=Color;
If Not (Width in [1,2]) then Width:=1; { Make sure width value is OK }
Gotoxy(TopX,TopY); { First, draw the top line of the box...}
Write( BoxChar[Width,TopL]+Make_String(BoxChar[width,top],BotX-TopX-1)+
BoxChar[Width,TopR]);
For Y:=TopY+1 to BotY-1 do
Begin { Second, draw the middle lines of the box...}
Gotoxy(TopX,Y);
Write( BoxChar[Width,LSide],BoxChar[Width,RSide]:BotX-TopX);
end;
GotoXY(TopX,BotY); { Third, draw the bottom line of the box. }
Write( BoxChar[Width,BotL]+Make_String(BoxChar[width,top],BotX-TopX-1)+
BoxChar[Width,BotR])
end; {Draw Box}
{--------------------------------------------------------------------}
FUNCTION Read_KeyBoard: Char; {Routine to get keystrokes from user}
Const CtrlMask = $04;
AltMask = $08;
Var KBDFlag : Byte Absolute $0040:$0017;
Begin
Read_KeyBoard:=ReadKey;
CommandKey := ((KBDFlag AND AltMask) <> 0) or ((KBDFlag AND CtrlMask) <> 0);
ALT := (KBDFlag AND AltMask) <> 0; CTRL := (KBDFlag AND CtrlMask) <> 0;
If KeyPressed Then
Begin
Read_Keyboard := ReadKey; {Just in case user pressed modified key}
CommandKey := True;
end;
end; {Read_Keyboard}
{--------------------------------------------------------------------}
PROCEDURE Show_HelpLine(X,Y,StartBold,EndBold: Integer; Var Line: String);
Var I,J: Integer;
PROCEDURE Write_Char(Ch: Char);
Begin
If Ord(Ch)>127 then Ch:=Chr(Ord(Ch)-128); {Clear high bit}
If Ord(Ch)>27 then Write(Ch) else Inc(i);
end;
Begin
TextAttr:=HelpColor[False];
Window(X,Y,59,Y); ClrEOL; Window(1,1,80,25); {Prepare for output}
Gotoxy(X,Y); I:=1;
While I<=Length(Line) do {Do each char in line}
Begin
TextAttr:=HelpColor[Ord(Line[i])>128]; {Set proper color}
If I in [StartBold..EndBold] then TextAttr:=BoldColor;
Write_Char(Line[i]);
Inc(i);
end;
end; {Show helpline}
{-------------------------------------------------------------------}
PROCEDURE Show_Help_Page(X,Y: Integer; Var HelpRec: HelpRecord);
Var I: Integer;
Begin
Window(X+1,Y+1,X+56,Y+MaxLinesPerPage+1); ClrScr; Window(1,1,80,25);
For I:=1 to MaxLinesPerPage do
Show_HelpLine(X,Y+I,0,0,HelpRec.HelpLines[I]);
end; {Show help page}
{-------------------------------------------------------------------}
FUNCTION Determine_Actual_Line_Pos(Var Line: String; LinePos: Integer):
Integer;
Var I,J: Integer; {Convert visual edit column to actual char. position,}
Begin {by skipping over embedded hot links.}
I:=0; J:=1;
While (J<=Length(Line)) and (I<>LinePos) do
Begin
If Line[j]<>Null then {Null is used as delimiter}
Inc(i) else Inc(j,2);
Inc(j);
end;
Determine_Actual_Line_Pos:=J;
end; {Determine actual line pos}
{-------------------------------------------------------------------}
FUNCTION Link_Count(Var Line: String): Integer;
Var I,Count: Integer; { Returns 2*#nulls in line, used to convert }
Begin { from actual byte pos. to visual byte pos., }
Count:=0; { during data input. }
For I:=1 to Length(Line) do
If Line[i]=Null then Inc(Count,2);
Link_Count:=Count;
end; {Link count}
{-------------------------------------------------------------------}
FUNCTION Input_HelpPage(X,Y: Byte; Var AHelpRec: HelpRecord): Char;
Var Ch : Char; { The main editing routine in this system. }
PageNum : Byte; { It is really just a page-oriented line }
I,J, { editor that knows how to jump over 2-byte }
LinePos, { hot-links. }
RealLinePos, { If you add editing options, don't forget }
LineNum : Integer;{ take the embedded hot-links into account! }
PROCEDURE Delete_Linked_Char(Var Line: String; LinePos: Integer);
Var I,J: Integer;
Begin
LinePos:=Pred(Determine_Actual_Line_Pos(Line,LinePos));
If Ord(Line[LinePos])>127 then {Were on a linked item}
Begin
I:=LinePos;
While ((Ord(Line[I-1])>127) and (I>1)) do Dec(i);
J:=LinePos; {Next find end of link}
While ((Ord(Line[J+1])>127) and (I<Length(Line))) do Inc(J);
Delete(Line,LinePos, {Delete all of item + link if necc.}
1+(2*Ord(J=I)));
end;
end; {Delete linked char}
Begin
Show_Help_Page(X,Y,AHelpRec); {Display this page }
LinePos:=1; RealLinePos:=1; {Now do a little init stuff.}
LineNum:=1;
With AHelpRec do {Now enter main edit loop...}
Repeat
Show_HelpLine(X,Y+LineNum,0,0,HelpLines[LineNum]);
Gotoxy(X+LinePos-1,Y+LineNum);
Repeat Ch:=Read_KeyBoard Until Ch <> Null;
If CommandKey then
Case Ch of
^Y : If RealLinePos<=Length(HelpLines[LineNum]) then
Begin { ^Y = Delete to end of line. }
If (RealLinePos=1) then HelpLines[LineNum]:=''
else
Begin
While HelpLines[LineNum,RealLinePos]<>Null do
Delete(HelpLines[LineNum],RealLinePos,1);
If HelpLines[LineNum,RealLinePos]=Null then
Delete(HelpLines[LineNum],RealLinePos+2,255)
end
end;
F2 : Begin { F2 = Add/Remove hot-link.}
J:=RealLinePos;
While (j>0) and (HelpLines[LineNum,j]<>' ')
do Dec(j);
Inc(j);
If Ord(HelpLines[Linenum,j]) in [28..127] then
Repeat {Now get a valid page # to jump to...}
Gotoxy(3,24); Write('Link Page: ');
Readln(PageNum);
Gotoxy(3,24); ClrEOL;
Until (PageNum>0) and (PageNum<256);
While (HelpLines[LineNum,j]<>' ') and
(j<=Length(HelpLines[LineNum])) and
(HelpLines[LineNum,j]<>Null) do
Begin
HelpLines[LineNum,j]:=Chr(Ord(HelpLines
[LineNum,j])+128);
Inc(j);
end;
If Ord(HelpLines[LineNum,J-1]) in [28..127] then
Delete(HelpLines[LineNum],J,2) else
Insert(Null+Chr(PageNum),HelpLines[LineNum],j);
end;
LArrow : If RealLinePos>1 then {Move cursor left 1 char.}
Begin
Dec(linePos);
RealLinePos:=Pred(Determine_Actual_Line_Pos
(HelpLines[LineNum],LinePos));
end;
RArrow : If RealLinePos<=Length(HelpLines[LineNum]) then
Begin {Move cursor right 1 char.}
Inc(LinePos);
If RealLinePos<Length(HelpLines[LineNum]) then
Inc (RealLinePos,
1+Ord(HelpLines[LineNum,RealLinePos+1]=Null)*2)
else Inc(realLinePos)
end;
DnArrow: If LineNum<MaxLinesPerPage then
Begin {Move down 1 line.}
Inc(LineNum);
If LinePos<=Length(HelpLines[LineNum]) then
RealLinePos:=Pred(Determine_Actual_Line_Pos
(HelpLines[LineNum],LinePos))
else
Begin
RealLinePos:=Succ(Length(HelpLines[LineNum]));
LinePos:=RealLinePos-Link_Count(HelpLines[LineNum]);
end;
end;
UpArrow: If LineNum>1 then {Move up 1 line.}
Begin
Dec(LineNum);
If LinePos<=Length(HelpLines[LineNum]) then
RealLinePos:=Pred(Determine_Actual_Line_Pos
(HelpLines[LineNum],LinePos))
else
Begin
RealLinePos:=Succ(Length(HelpLines[LineNum]));
LinePos:=RealLinePos-Link_Count(HelpLines[LineNum]);
end;
end;
HomeKey: Begin {Move to 1 char. in line.}
LinePos:=1;
RealLinePos:=LinePos;
end;
EndKey : Begin {Move to end of line.}
RealLinePos:=Succ(Length(HelpLines[LineNum]));
LinePos:=RealLinePos-Link_Count(HelpLines[LineNum]);
end;
DelKey : If (RealLinePos<=Length(HelpLines[LineNum])) then
Begin {Delete a character.}
If (HelpLines[LineNum,RealLinePos]) in [' '..'}']
then Delete(HelpLines[LineNum],RealLinePos,1) else
Delete_Linked_Char(HelpLines[LineNum],LinePos);
RealLinePos:=Pred(Determine_Actual_Line_Pos
(HelpLines[LineNum],LinePos));
end;
end else
Case Ch of
Return: If LineNum<MaxLinesPerPage then {Move down 1 line.}
Begin
Inc(LineNum); LinePos:=1; RealLinePos:=1;
end;
Tab : Begin {Tab right 10 chars.}
If RealLinePos+10<=Length(HelpLines[LineNum])+1 then
Inc(RealLinePos,10) else
RealLinePos:=Length(HelpLines[LineNum])+1;
LinePos:=RealLinePos-Link_Count(HelpLines[LineNum]);
end;
BkSpc : If RealLinePos>1 then {Backspace over prev. char.}
Begin
If HelpLines[LineNum,RealLinePos-1] in [' '..'}'] then
Begin
Delete(HelpLines[LineNum],RealLinePos-1,1);
Dec(RealLinePos);
Dec(LinePos)
end else
Begin
Delete_Linked_Char(HelpLines[LineNum],LinePos-1);
Dec(LinePos);
RealLinePos:=Pred(Determine_Actual_Line_
Pos(HelpLines[LineNum],LinePos));
end;
end;
' '..'}' : If Length(HelpLines[LineNum])<MaxLineWidth then
Begin {Insert a valid Ascii char.}
If (Ord(HelpLines[LIneNum,RealLinePos])>127) and
(RealLinePos<=Length(HelpLines[Linenum])) then
Ch:=Chr(Ord(Ch)+128);
Insert(Ch,HelpLines[LineNum],RealLinePos);
Inc(RealLinePos);
Inc(LinePos); Ch:=#255;
end;
end;
Until CH in [ESC,PGUp,PgDn]; {ESC=Quit;PGUp=Prev page;PgDn=Next Page.}
Input_HelpPage:=Ch;
end; {Input helppage}
{--------------------------------------------------------------------}
FUNCTION Read_Helprec(Var AHelpRec: HelpRecord; RecNum: Integer ): Integer;
Var I : Integer;
Begin
FillChar(AHelprec,SizeOf(AHelprec),0); {$I-} {Hyperdata file read rec}
If FileSize(HelpFile)<RecNum then exit; {routine. Includes just }
Seek(helpfile,RecNum-1); {enough error checking }
Read(helpfile,AHelpRec); {to be considered safe. }
Read_HelpRec:=IOResult; {$I+}
end; {Read helprec}
{--------------------------------------------------------------------}
FUNCTION Write_HelpRec(Var AHelpRec: HelpRecord; RecNum: Integer): Integer;
Begin {$I-}
Seek(helpfile,RecNum-1); {Hyperdata file write rec routine.}
Write(helpfile,AHelpRec); {$I+} {This routine also contains just }
Write_HelpRec:=IOresult; {enough error checking to be }
end; {Write helprec} {considered safe. }
{--------------------------------------------------------------------}
FUNCTION Open_HelpFile(FileName: String): Integer;
Var result: Integer;
Begin
Assign(HelpFile,FileName); {$I-} {Opens hyperdata file specified}
Reset(HelpFile); {as "FileName". If the file }
result:=IOResult; {doesnt exist, then it will be }
If Result=2 then {created. }
Begin {Error checking is limited, but}
ReWrite(HelpFile); {enough to be safe. }
Result:=IOResult;
end;
Open_HelpFile:=Result;
end; {open helpfile}
{--------------------------------------------------------------------}
PROCEDURE Help_Editor(FileName: String);
Const HelpMsgs = 13;
HelpData : Array[1..HelpMsgs] of String[17] =
( 'Editing Keys: ', '-------------',
'F2 : Link (+/-)', '^Y : Del EOLine',
'Bkspc: Del left', 'Del : Del char',
Chr(10)+'Movement keys: ', '--------------',
Chr(24)+Chr(25)+Chr(27)+Chr(26)+', '+Chr(17)+Chr(217)+',',
'Tab, Home, End', 'PgUp : Prev page',
'PgDn : Next page', Chr(10)+'ESC to quit.');
Var I,HelpRecNum: Integer;
AHelpRec : HelpRecord;
Ch : Char;
Result : Integer;
Begin
Result:=Open_HelpFile(FileName); {Open the specified file.}
If Result=0 then {Continue only if no error.}
Begin
TextAttr := NormalColor;
Draw_Box(1,3,80,23,NormalColor,1);
Draw_Box(2,4,60,22,NormalColor,2);
Gotoxy(61,4);
For I:=1 to HelpMsgs do
Begin
Gotoxy(62,WhereY+1); Write(HelpData[i]);
end;
HelpRecNum:=1;
Gotoxy(40-(Length(Header) div 2),3); Writeln(Header);
Gotoxy(4,2); Writeln('File: ',FileName);
Repeat
Gotoxy(4,4); Writeln(' Reading ');
Result:=Read_HelpRec(AHelpRec,HelpRecNum);
Gotoxy(4,4); Writeln('Page: ',HelpRecNum:3);
Ch:=Input_HelpPage(3,4,AHelpRec);
Result:=Write_HelpRec(AHelpRec,HelpRecNum);
Gotoxy(4,4); Writeln(' Writing ');
Case Ch of
PgUp : If helpRecNum>1 then Dec(HelpRecNum);
PgDn : If HelpRecNum < 255 then Inc(HelpRecNum);
end;
Until Ch=ESC;
end else {Report the opening error...}
Writeln('ERROR: ',Result,' opening ',FileName,'. Unable to continue.');
{$I-} Close(HelpFile); Result:=IOresult; {$I+}
end; {Help editor}
{--------------------------------------------------------------------}
FUNCTION Find_Next_Link( Var X,Y: Integer; EndX,EndY: Integer;
Var AHelpRec: HelpRecord): Boolean;
Var OrigX,OrigY,Col, {Recursive routine used to find a }
Row,StartCol,StopCol: Integer; {hot-link on the page after the }
Begin {current page position (X,Y). }
Find_Next_Link:=False;
{First, search from current pos to end of page...}
For Row:=Y to EndY do
Begin
If Row<>Y then StartCol:=1 else StartCol:=X;
If Row<>EndY then StopCol:=Length(AhelpRec.HelpLines[Row])
else StopCol:=EndX;
If AhelpRec.HelpLines[Row]<>'' then
For Col:=StartCol to StopCol do
If (AHelpRec.HelpLines[Row,Col]=Null) then
Begin
Find_Next_Link:=True;
X:=Col; Y:=Row;
Exit; {make a quick getaway!}
end;
end;
{ok, search from top of page to the startpos}
If X+Y>2 then
Begin
Col:=1; Row:=1;
If Find_Next_link(Col,Row,Pred(X),Y,AHelpRec) then
Begin
X:=Col; Y:=Row; Find_Next_Link:=true;
end
end;
end; {find next link}
{--------------------------------------------------------------------}
FUNCTION Find_Prev_Link( Var X,Y: Integer; EndX,EndY: Integer;
Var AHelpRec: HelpRecord): Boolean;
Var OrigX,OrigY,Col, {Recursive routine used to find a }
Row,StartCol,StopCol: Integer; {hot-link on the page prev. to the}
Begin {current page pos. (X,Y). }
Find_Prev_Link:=False;
{First, search from current pos to top of page...}
For Row:=Y downto 1 do
Begin
StopCol:=1;
If Row<>Y then StartCol:=Length(AhelpRec.HelpLines[Row])
else StartCol:=X;
If AhelpRec.HelpLines[Row]<>'' then
For Col:=StartCol downto StopCol do
If (AHelpRec.HelpLines[Row,Col]=Null) then
Begin
Find_Prev_Link:=True;
X:=Col; Y:=Row;
Exit; {make a quick getaway!}
end;
end;
{ok, search from bottom of page to the startpos}
If X+Y>2 then
Begin
Row:=MaxLinesPerPage;
Col:=Length(AHelpRec.HelpLines[Row]);
If Find_Prev_link(Col,Row,Succ(X),Y,AHelpRec) then
Begin
X:=Col; Y:=Row; Find_Prev_Link:=true;
end
end;
end; {find prev link}
{--------------------------------------------------------------------}
PROCEDURE Do_Help(FileName: String; GoPage,HomePage: Word);
Const XPos = 10;
YPos = 5;
Color : Byte = Black*16+White; {This is the hypertext engine.}
MaxStackSize = 25; {This routine is used to read }
{and navigate through a data }
Type StackRec = Record {file, specfied as "FILENAME".}
Page : Byte; {GoPage specifies the starting}
Row, {page to display, and HomePage}
Col : Integer; {is used to specify an main }
end; {index (or home) page. }
Var Result : Integer;
Stack : Array[0..MaxStackSize] of StackRec;
AHelpRec: HelpRecord;
Ch : CHar;
StackLvl: Byte;
StartCol: Integer;
Linked,
Load : Boolean;
FUNCTION Pop_Stack: Byte; {Pop the top page info (Stack) record}
Begin
If StackLvl>1 then
Begin
Dec(StackLvl);
Load:=True;
end;
Pop_Stack:=StackLvl;
end; {pop stack}
FUNCTION Push_Stack(PageNum: Byte): Byte;
Begin {Push a page info (stack) record.}
Inc(StackLvl);
Stack[StackLvl].Page:=PageNum;
Stack[StackLvl].Col:=1;
Stack[StackLvl].Row:=1;
Push_Stack:=StackLvl;
end; {push stack}
Begin
If GoPage=0 then GoPage:=1; {Make sure GoPage is valid.}
Result:=Open_HelpFile(FileName);
If Result=0 then
Begin
Load:=true;
TextAttr :=Color;
Draw_Box(Xpos,YPos,XPos+59,YPos+MaxLinesPerPage+2,NormalColor,2);
FillChar(Stack,SizeOf(Stack),0);
StackLvl := 0;
If HomePage in [1..255] then StackLvl:=Push_Stack(HomePage);
If (GoPage in [1..255]) and (GoPage<>HomePage) then
StackLvl:=Push_Stack(GoPage);
GotoXY(XPos+29-(Length(Header) div 2),YPos);
Writeln(Header);
Repeat
With Stack[StackLvl] do
Begin
If Load then {System needs new hyperdata file page.}
Begin
Result:=Read_HelpRec(AHelpRec,Page);
Show_Help_Page(XPos+1,YPos,AHelpRec);
Gotoxy(XPos+51,YPos+MaxLinesPerPage+2);
If StackLvl>1 then Write('Esc,PgUp') else
Write('Esc=Quit');
Linked:=Find_Next_Link(Col,Row,80,MaxLinesPerPage,
AHelpRec);
Load:=False;
end;
If Linked then {We have a hot-link to show, so do it.}
Begin
StartCol := Col;
While Ord(AHelprec.HelpLines[Row,StartCol-1])>127
do Dec(StartCol);
Show_HelpLine(XPos+1,YPos+Row,StartCol,Pred(Col),
AHelpRec.HelpLines[Row]);
end;
Repeat Ch:=Read_KeyBoard until Ch<>Null;
Show_HelpLine(XPos+1,YPos+Row,0,0,AHelpRec.HelpLines[Row]);
Case Ch of {Now handle navigation...}
RArrow,
Tab : Begin
Inc(Col);
Linked:=Find_Next_Link(Col,Row,80,
MaxLinesPerPage,AHelpRec);
end;
Return : If Linked then
Begin
Load:=true;
If (StackLvl>1) and
(Stack[StackLvl-1].Page=
Ord(AHelpRec.HelpLines[Row,Col+1])) then
StackLvl:=Pop_Stack else
StackLvl:=Push_Stack(Ord(AHelpRec.HelpLines
[Row,Col+1]));
end;
LArrow : Begin
Dec(Col);
Linked:=Find_Prev_Link(Col,Row,1,1,AHelpRec);
end;
DnArrow: Begin
Col:=1;
If Row<MaxLinesPerPage then Inc(Row) else Row:=1;
Linked:=Find_Next_Link(Col,Row,80,
MaxLinesPerPage,AHelprec);
end;
UpArrow: Begin
If Row>1 then Dec(Row) else Row:=MaxLinesPerPage;
If Col<Length(AHelpRec.HelpLines[Row])
then Inc(Col);
Linked:=Find_Prev_Link(Col,Row,1,1,Ahelprec);
end;
PgUp : StackLvl:=Pop_Stack;
PgDn : Begin {Let programmer set this!} end;
end;
end;
Until Ch=ESC;
end else
Writeln('ERROR: ',Result,' opening ',FileName,'. Unable to continue.');
{$I-} Close(HelpFile); result:=IOResult; {$I+}
end; {do help}
{--------------------------------------------------------------------}
Begin {No init code required}
end.
[EXAMPLE 1]
Const ScreenWidth = 60;
LinesPerScreen = 15;
MaxHotLinks = 25; {Or any other number you want}
Type {heres a place to store the screen text}
ScreenTextBuffer = Array[ 1..ScreenWidth,
1..LinesPerScreen] of Char;
HotLinkRecord = Record
Startpos, {col pos where link occurs}
LineNum : Integer; {row/line number where link occurs}
LinkPage : Integer; {page number to activate for link}
end;
{now put it all together}
OnePage = Record
TheText : ScreenTextBuffer;
TheLinks : Array[1..MaxHotLinks] of HotLinkRecord;
end;
[EXAMPLE 2]
Const MaxLinesPerPage = 15;
MaxLineWidth = 60;
Type Help_Record = Record
HelpLines : Array[1..MaxLinesPerPage] of String[100]; {Leave room for links}
end;
[EXAMPLE 3]
Helplines[8] = [` OS Shell Main Index '] {As a string}
= [ $20,$20,$20,$20, {As Hex}
$4F, $53, $20, $53, $68, $6C, $6C]
[EXAMPLE 4]
= [ $20,$20,$20,$20,
$CF, $D3, $A0, $D3,
$E8, $EC, $EC, $00,$05]
[EXAMPLE 5]
Helplines[8] = [` OS Shell Main Index ']
^
(Character 17)
[EXAMPLE 6]
HelpLines[8] = [` OS Shell<xx> Main Index '];
^ ^
(Hot link) (Character 19)
[EXAMPLE 7]
1 Program HelpTest;
2 Uses Crt,HyprHelp;
3 Var FileName : String[80];
4 Begin
5 ClrScr;
6 {If you want to save the current text screen, do it here.}
7 Write(TEnter the file name: U);
8 Readln(FileName);
9 Help_Editor( FileName );
10 Do_Help ( FileName,1,1);
11 { Restore the text screen here, if you saved it before }
12 end.