2 Tutorial Example : using the default configuration

functor 
 
import 
   Help(helpClass:HelpClass)
   Application
 
define 
    
   Hlp={New HelpClass init}
 
   {Hlp parseHelpFile("Help.txt")}
   {Hlp openHelpWindow(home)}
 
   {Application.exit 0}
end

Assuming Help.txt contains :

home
<title|Home help page>This is a sample help file. 
Lets try  <b>bold</b>, <i>italic</i>, <bi>bolditalic</bi>, <b>bold <i> italic </i> <u>und</b>erlined</u>. 
This is a link : <link>link</link|link>. This is normal text. 
<bitmap|warning><link>Font test page</link|fonts> 
<blink>Blinking text</blink> 
Normal text. 
<p> 
<p> 
<right>Right centered</right> 
<center><blink><u><f>Center centered</f|times 30></blink></u></center> 
<left>Left centered</left> 
<link>Link to this page</link|home> 
<link>Mozart link</link|http://www.mozart-oz.org> 
 
 
link
<title|Link help page>This is a link ! 
<foreground|yellow><background|red>This page should display in red ! 
<blink>BLURPS</blink>

Compiling and running the above program :

2.1 Oz code

The Oz code is straightforward to understand :

In the simplest case were you don't want to redifine help text parsing, the action of the tags, or have advanced control over the help window, you just have to do this. If you have further need, check the reference documentqtion.

2.2 Help.txt file

The Help.txt file is structured in two pages : home and link. Each pages starts by the page name on the first line, the page definition on the following lines. A page terminates by two blank lines, the next page starting right after these two blank lines.

The page definition is composed of text and tags. The text is inserted as is, the way it is displayed can be modified by tags. Tags come in two flovours :

Tags may have parameters. In such a case, all parameters follow the tag name using "|" as separator : <tag|param1|param2|...> The different tags in this example are :


Donatien Grolaux
Version 1.1.1 (20000613)