Source language: Translate to:

NeoBook Ascii HyperText

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

NeoBook Ascii HyperText

Postby Jim Brammer » Thu Feb 07, 2002 3:02 pm

Although NeoBook 4's new RTF HyperText is far easier to use, thanks in large part to NeoBook's new built-in Rich Text Editor, the older Ascii based HyperText is still supported (for the mostpart) for backward compatibility. This is good news to anyone who wants to use FileWrite to easily write external files at runtime creating your own Ascii HyperText documents, menus, etc. If you're new to NeoBook and have never seen the NeoBook 3.2 HyperText format it is provided below...


Hypertext codes may be inserted into text files to allow your readers to jump to other sections, etc. Hypertext may be inserted into your text files while you edit them in any ASCII/ANSI text editor.

Action Events

Action events are set up just as for buttons and hot spots. The commands you may use are explained in the Action Event section. Simply precede the command with ^L and follow this with the word you wish to make a highlighted clickable link. Follow this word with an equal sign ( = ) then type the command into the text just as it would appear for a button. End the link with ^l (be certain to use a capital L before the link and a lower case L at the end of the link).

Example:
"the large blue heron ate many ^Lfish=Gotopage "Fishes"^l while ..."

would appear as:
"the large blue heron ate many fish while ..."


and clicking on the underlined word "fish" would take readers to the "Fishes" page of the publication.

Normally, NeoBook will automatically display hyperlinks with a dotted underline, but you can disable the underlining by placing a ^H code at the top of your text file. This is useful when you want to use another method to indicate a link such as color. See Formatting Text for more information about inserting formatting codes into your documents.

Hint: if you cannot remember the syntax for a command, bring up NeoBook along with your text editor. Create a button and use NeoBook's Insert Action dialog to write the command for the action(s) you wish to use in the text. Then use the copy command to copy the command from the dialog and use your text editor's Paste command to insert it into your text file.

Jump within Document

NeoBook also makes it possible to jump directly to another section of the same document. To do this you must  insert two codes: one to give the reader highlighted text to click, and the second to place an invisible mark at the target to which the reader will jump when the highlighted link is clicked.

The link is created by preceding the jump command with ^L followed by the word you wish to make a highlighted clickable link. Follow this word with an equal sign plus a colon ( = : ), then type the name you will use to mark the target. End the link with ^l (be certain to use a capital L before the link and a lower case L at the end of the link).

Example:
To go directly to the story, ^LPUSHME=:TARGET^l

would display as:
To go directly to the story, PUSHME


and clicking on the word "PUSHME" will cause NeoBook to attempt to take the reader the part of the text containing the "TARGET" mark.

To mark the place in the text to which to jump, type ^M and follow this with the word you are using to mark the target., then end the mark with ^m (be certain to use a capital M before the mark and a lower case m at the end of the mark).

^MTARGET^m

Note that you cannot jump between documents, nor can you combine a jump with other action events.
Jim Brammer
 

Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 0 guests