home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
windows
/
kpwdemo.zip
/
APPHELP.SRC
< prev
next >
Wrap
Text File
|
1990-06-28
|
4KB
|
118 lines
(*============================= APPHELP.SRC =============================
This KB can be used to read help files from within your application. It is used to create
the help file for the application DESIGN. To use this in your application link the
help option on your menu or a help button to a topic like this one:
topic help.
load ('apphelp.src',temp).
temp:file is 'YOURAPP.hlp'.
temp ().
wait ().
remove_topic (temp).
end.
When the help topic is called APPHELP.SRC is loaded into the topic TEMP, the name
of the hypertext text file is passed and TEMP is executed.
APPHELP is a hypertext engine which reads the text in the file passed as the value of
the topic TEMP:FILE. The text file should be created in this format:
//subject1
Here is the text for this subject.
Here is another line.
//another subject
Spaces and line feeds are used
in the file to format the text.
If your help file is so large that access times are slow, you may want to index the file.
Indexing is described in chapter 8 and in the knowledge base file INDEX.KB.
======================================================================= *)
(* all topics are created locally so they will be removed when the topic the KB is loaded
into is deleted *)
displayInfo ().
:list is []. (* keeps track of what you have looked at so far. *)
if ?version is 3 then :width is 83 else :width is 70.
:w1 is window (,5,2,?width,23,,[PopUp,ThickFrame,TitleBar,VertScroll,ShowChildren,Siblings,visible]).
:m1 is menu ([&Top,&Back,&Print,&Quit,&Help],select).
make_modal (?w1).
:message is read (?file,'//','//'). (* find the first screen of the help file *)
close (?file).
:top is string_replace (first (?message),'//').
mark (?top).
topic select (item).
do (?item).
topic &Top.
list is [].
mark (?top).
end.
topic &Back.
list is remove (?list,last (?list)).
if ?list is []
then mark (?top)
else :item is last (?list) and
list is remove (?list,?item) and
mark (?item).
end. (* Back *)
topic &Print.
print (get_text ()).
end.
topic ©.
text_to_clipboard (?format).
end. (* mCopy *)
topic &help.
text (#e,'
Reading Hypertext.
The line below shows the font used for hypertext
on your monitor.
#mThis is the font for hypertext on the current monitor.#m
To select hypertext, point and click with the mouse
or, use TAB and SHIFT TAB to move the cursor among
hypertext items and press ENTER to select the item.
To go back to the previous screen, select BACK.
To return to the first screen, select TOP.
To print the current item, select PRINT.').
list gets help.
topic 'This is the font for hypertext on the current monitor.'.
(* this is a dummy topic to catch the hypertext in the help screen.*)
end.
end.
topic &Quit.
close_window ().
continue ().
end. (* mQuit *)
end. (* select *)
topic mark (item).
list gets (?item).
set_title (,?item).
text (#e,read (?file, concat ('//',?item),'//')).
close (?file).
end. (* mark *)
topic displayInfo.
system is system_info ().
if last (?system) > 2
then hyper_display (blue).
version is string_copy (element (?system,9),1,1).
end.