TACL Reference Manual

Statements and Programs
HP NonStop TACL Reference Manual429513-018
5-15
Creating Program Files
Creating and Accessing a Segment File: An Example
This example shows one method for setting up a segment file; it demonstrates most of
the commands and functions that relate to segment files, the home directory, the use
list, and #PMSEARCHLIST.
== Create and attach the segment
CREATESEG mysegfil
ATTACHSEG PRIVATE mysegfil :mydir
== Change the name of the home directory for the next few
== commands
HOME :mydir
== Load library files into the segment file
SINK [#LOAD /KEEP 1/ filename]
SINK [#LOAD /KEEP 1/ filename] == As many of these as you
SINK [#LOAD /KEEP 1/ filename] == need to load all libraries
== Change the home directory back to the root directory
HOME
== Delete :mydir and close the segment file. This causes the
== new contents to be written to the segment file.
DETACHSEG :mydir
To modify the segment file, close the segment file (with a DETACHSEG command),
and then follow the previous steps, entering commands to create, delete, or change
variables in place of the #LOAD commands.
These commands show how to provide shared access to the new segment file:
== Attach the segment file to a directory
ATTACHSEG SHARED mysegfil :mydir
#SET #USELIST [#USELIST] :mydir
To view your current use list, use the ENV command.
These lines of code, when included in your TACLCSTM file, attach a segment file
whenever you log on:
?TACL MACRO
#PUSH taclversion
#SETMANY taclversion , [#TACLVERSION]
[#IF NOT %1% |THEN|
[#CASE [taclversion] == To make TACLCSTM work with any TACL
| t9205b20 t9205b30 t9205b40 |
***
Commands to load your libraries (for older TACL versions)
***
| t9205c00 t9205c10 |
ATTACHSEG SHARED mysegfil :mydir
| OTHERWISE |