Conditional Hypertext

In this section:

The ClearWin+ BROWSER program uses conditional hypertext to display different information depending on the programming language selected.

For example:

Call the <if Fortran> WINIO@ <else> winio </if> function to display a window.

This uses an named integer parameter with the name 'Fortran', set up using the SET_CLEARWIN_INFO@ function. The <if> clause is selected if the parameter is non-zero. The <else> clause is optional. Conditional constructs can be nested, and may contain arbitrary amounts of other mark-up codes and text.

If a call-back function changes the value of a parameter referenced in a conditional construction, it should either return 1 (to cause all controls in the window to be updated) or use WINDOW_UPDATE@ to ensure that the hypertext is updated.

To get a working example of the use of this format code, open the browse.htm file and the associated program browse.cpp.

For example:

     WINAPP 0,0,'resource.rc'
     ...
c--- Only call the next line once.---
     CALL add_hypertext_resource@('hyperhelp')
     i=winio@('%ca[Hypertext help system]&')
     i=winio@('%ww%bg[grey]%pv&')
     i=winio@('%^60.22ht[Introduction]',callback)

Where resource.rc contains:

hyperhelp HYPERTEXT 'helpfile.htm'

A summary of ClearWin+ hypertext functions is given in Hypertext functions.

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited