Inline Hyperlinks

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Placing links

    The hyperlink list is a list of indexed texts variable.

    The hyperlinked text is an indexed text variable. The hyperlinked text is "".
    The hyperlinked command is an indexed text variable. The hyperlinked command is "".

    To say link:
        now the hyperlinked text is "";
        now the hyperlinked command is "";
        start capturing text.
        
    To say as:
        stop capturing text;
        now the hyperlinked text is "[captured text]";
        start capturing text;
        
    To say end link:
        let hyperlink index be a number;
        stop capturing text;
        if the hyperlinked text is "":
            now the hyperlinked text is "[captured text]";
        now the hyperlinked command is "[captured text]";
        if the hyperlinked command is listed in the hyperlink list:
            repeat with count running from 1 to the number of entries in the hyperlink list:
                if entry (count) of the hyperlink list is hyperlinked command:
                    let hyperlink index be count;
        otherwise unless the hyperlinked command is "":
            add hyperlinked command to hyperlink list;
            let hyperlink index be the number of entries of hyperlink list;
        say "[set link (hyperlink index)][hyperlinked text][terminate link]";
        
    To say set link (N - a number):
        (- if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_set_hyperlink({N}); -)

    To say terminate link:
        (- if (glk_gestalt(gestalt_Hyperlinks, 0)) glk_set_hyperlink(0); -)