Topic: APLX Help : Help on APL language : System Commands : )LOAD Load workspace
[ Previous | Next | Contents | Index | APL Home ]

www.microapl.co.uk

)LOAD (lib) name (:pass)


Loads a named workspace. The workspace is loaded into memory and overwrites any workspace already associated with the current APL task. If the workspace has a password, it must be given. Otherwise the message WS LOCKED appears and the workspace is not loaded.

             )LOAD MYWS
       SAVED   2002-09-11 10.32.16

Library specification and path names

There are two different ways in which you can specify where APLX should look for the saved workspace:

  • You can specify the workspace name as just the base name of the workspace, for example MYWS or Budget03, optionally preceded by a library number. In this case, APLX appends any default file-extension to the name (.aws for Windows, AIX or Linux), and searches in the directory corresponding to the specified library number. Library numbers 0 to 9 are set up either using the Preferences dialog, or by using the ⎕MOUNT system function. Library 10 contains the utility and demonstration workspaces supplied with APLX. If you omit the library number, library 0 is assumed.
  • You can specify a full operating-system path name, including directory separation characters, such as /usr/workspaces/Budget03.aws (Linux), C:\workspaces\Budget03.aws (Windows), or MacHD::workspaces:Budget03 (MacOS). APLX uses the path name exactly as supplied, so under Linux, Windows and AIX you usually need to provide the .aws file extension.

How APLX interprets the name and library specification

The rules which APLX applies when interpreting a name and/or library specification in a system command are as follows:

  1. If the name begins with a number followed by one or more spaces, the number is taken to be a library number and the text after the space(s) is the file name. The directory in which the file is located is taken from the appropriate row of the ⎕MOUNT table, or the installed workspace directory for library 10. If the directory is blank, the user's home directory is assumed. Under AIX, Linux or Windows, the file extension (.aws) is automatically appended to the supplied name.
  2. If the name does not begin with a number followed by spaces, APLX looks at the name to see if it contains at least one directory separator character (/ under Linux, \ under Windows, / or : under MacOS). If it does not, then it is treated as a simple filename in Library 0, and (under AIX, Linux or Windows) the file extension is automatically appended to the supplied name.
  3. If the name does contain a directory-separator character, it is assumed to be a full pathname, including the file extension if any. APLX uses the name exactly as supplied.

In each case, the name is normally assumed to end at the first blank character. If you want to include blanks in the name, you can enclose the whole file name in single quotes.

If you use full pathnames under AIX, Windows or Linux, you should normally supply the .aws file extension when saving workspaces, otherwise the workspace will not show up in the )LIB listing. This is not true under MacOS, which keeps a file type separate from any file extension.

Some system commands (including )LOAD) can take an optional colon and password. Under MacOS, this might be confused with a full pathname, so you must include a space before the colon to terminate the name.

Examples (Windows):

Suppose the first three rows of your ⎕MOUNT table are set up as follows:

      3 40↑⎕MOUNT ''
c:\temp

G:\apl\historic\aplx

Note that the second row, library 1, is blank, so will correspond to the user's home directory. This might be something like: C:\Documents and Settings\Jim\My Documents.

Library of directory 0:

      )LIB 0
IF          JIM         PICTUREDEMO PLUSFNS     SC          TESTDISPLAY 

Library of directory 0, implicit library number:

      )LIB
IF          JIM         PICTUREDEMO PLUSFNS     SC          TESTDISPLAY 

Library of the same directory, specifying a full library path:

      )LIB c:\temp
IF          JIM         PICTUREDEMO PLUSFNS     SC          TESTDISPLAY 

Library of directory 1. Because ⎕MOUNT table entry is blank, this is the user's home directory:

      )LIB 1
ANOTHER     BERT        FRED

Load a workspace from library 0 (the 0 could be omitted). Full path is c:\temp\PICTUREDEMO.aws

      )LOAD 0 PICTUREDEMO          
SAVED  2002-07-05 15.51.31

Load a workspace from library 1. Full path is ANOTHER.aws in user's home directory:

      )LOAD 1 ANOTHER
SAVED  2003-11-18 10.49.51

Load a workspace using full explicit path, including file extension (Note that Windows file names are not case-sensitive):

      )LOAD C:\TEMP\PICTUREDEMO.AWS         
SAVED  2002-07-05 15.51.31
      )WSID
C:\TEMP\PICTUREDEMO.AWS

Save under a name containing spaces - we need to enclose the name in quotes:

      )SAVE 'A nice name with spaces'
2003-12-10 13.44.16
      )LIB
A nice name with spaces IF          JIM         PICTUREDEMO PLUSFNS     
SC          TESTDISPLAY 

Re-load using a full pathname - again we need to enclose the name in quotes, and supply the file extension because we are using a full path:

      )LOAD 'c:\temp\A nice name with spaces.aws'
SAVED  2003-12-10 13.44.16

Paths in MacOS X

Under MacOS X, you can enter file paths either using in traditional Macintosh style, using colon as a directory separator (MacHD::workspaces:Budget03), or in a Unix style, with slash as the separator (/Volumes/MacHD/workspaces/Budget03).

Special considerations for Client-Server implementations of APLX

In Client-Server implementations of APLX, the front-end which implements the user-interface (the "Client") runs on one machine, and the APLX interpreter itself (the "Server") can run on a different machine. The two parts of the application communicate via a TCP/IP network. Typically, the Client will be the APLX front-end built as a 32-bit Windows application running on a desktop PC, and the Server will be a 64-bit APLX64 interpreter running on a 64-bit Linux or Windows server.

In such systems, you can specify whether the file should be accessed on the Client or the Server machine. You do this by preceding the file name with either an Up Arrow to indicate that the file should be accessed on the Client, or a Down Arrow to indicate that it should be accessed on the Server. If you do not specify, the default is that the access takes place on the Client. This is true either if you specify the full path name in the system command, or via the ⎕MOUNT table.

In this example, we load a workspace from the Client machine (under Windows), and save it on the Server machine (in this case, a Linux system):

      )LOAD ↑C:\workspaces\mailfilter.aws
SAVED  2006-08-15 8.50.04
      )SAVE ↓/usr/local/wsrelease/mailfilter.aws
2006-08-24 15.50.10

Topic: APLX Help : Help on APL language : System Commands : )LOAD Load workspace
[ Previous | Next | Contents | Index | APL Home ]