| Syntax 
   #libpath
 
 Purpose
 
 A built-in stream shelf whose items contain the values of all  "-libpath" command-line arguments (alternate paths for the system identifiers specified in librarydeclarations). #libpathstarts out with one item for each  "-libpath" argument on the command line, in the order in which they appear on the command line.
 The default "current-item" is the last item on the shelf, as in programmer-defined shelves.
 #libpathis used by the default external text entity manager. The manager uses the values of items as prefixes when it tries to find files to provide replacement text for the current external text entity.
 #libpathcan be changed at any time, but these changes will affect the processing of the defaultexternal-text-entityrule. The default external text entity manager assumes that the items on this shelf are closed and attached to either buffers or referents that can return a value.
 This example illustrates how a repeat overloop can be used to iterate over the items on the#libpathshelf. The external text entity rule shown in this example does what OmniMark's built-in entity manager does for entities with system identifiers. In this example, provision is made for there not being a -libpathcommand-line argument, which is used as a prefix to produce the name of an existing file. If theexternal-text-entityrule was missing thehaltaction, then, apart from the message being written to#error, the OmniMark program would simply continue.
   external-text-entity #implied when entity is system
     local stream file-name
     do when file "%eq" exists
        set file-name to "%eq"
     else
        repeat over #libpath
           do when file "%g(#libpath)%eq" exists
              set file-name to "%g(#libpath)%eq"
              exit
           done
        again
     done
     do when file-name is attached
        output file file-name
     else
        put #error
            "no file found for entity %"%q%", system id = %"%eq%"%n"
        halt
     done
 |