Difference between revisions of "LINK"
Helengeorge (Talk | contribs) (→Class) |
Helengeorge (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Link multiple source program files into a single file | Link multiple source program files into a single file | ||
Line 73: | Line 71: | ||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Applications Commands]] | [[Category:Applications Commands]] |
Revision as of 17:00, 11 November 2009
Purpose
Link multiple source program files into a single file
Syntax
LINK FROM <.dbl file> | <skeleton> TO <.src file>
[MESSAGE <.map file>]
[COMMAND <expC>]
[COMMENTS]
See Also
COMPILE, DO, FUNCTION, PROCEDURE, Recital Linker, SET MAXDBO, SET PROCEDURE, SET PSHARE
Description
The LINK command is used to invoke the Recital linker to link multiple source program files into a single file that can then be compiled. This limits the number of files that need to be open at one time, thus using less Operating System file handles and making more efficient use of shared memory when running applications with SET PSHARE ON.
With SET PSHARE ON, compiled programs are loaded into shared memory when called. All users accessing a particular program can access the same area of shared memory rather than loading the program into private memory. The program is removed from shared memory when it no longer has any attached users. A single compiled program therefore, need only be loaded once and accessed by all users. Multiple smaller compiled programs cause an increased amount of loading and unloading activity in shared memory.
Keyword | Description |
---|---|
<.dbl file> | A text file containing a list of program files to link. These should be listed one to a line and must be unique. If no file extension is given, a .dbl extension is assumed. |
<skeleton> | A skeleton pattern for the program files to link. This must include the "*" as a wildcard, e.g. "app1*.prg" or "*.prg" |
<.src file> | The name of the output file to be created. If no file extension is specified, the file will be given a .src extension. By convention the .src extension is used to differentiate linked source files from individual .prg files. The output file will be created if it does not exist and overwritten if it does. |
MESSAGE <.map file> | The optional MESSAGE clause allows linker message output to be sent to the specified <.map file>. If no file extension is specified, the file will be given a .map extension. This text file will be created if it does not exist and overwritten if it does. |
COMMAND <expC> | If the optional COMMAND clause is specified, a 'do <expC>' line will be included in the output file as the first executable line. The <expC> should evaluate to the name of the first procedure to be run. The output file can then be called as a self-contained module rather than being used as a procedure library. |
COMMENTS | The optional COMMENTS keyword will leave comments and indentations in the output file. By default these are not included by the linker. |
The Recital Linker can also be called from the Operating System command line using the Recital Terminal Developer 'dbl' utility.
Example
// Creating linked file app1.src to include all files matching the "app1*.prg" skeleton. // Message output will be written to output.map. // First executable line will be 'do app1start' // Comments and indentations will be retained link from "app1*.prg" to app1 message output command "app1start" comments
Another example:
//app1.dbl app1start.prg app1main.prg app1end.prg //end of app1.dbl
// Creating linked file app1.src to include all files specified in app1.dbl. // Message output will be written to info.map. // First executable line will be 'do app1start' // Comments and indentations will be stripped link from app1 to app1 message info command "app1start"
Products
Recital Server, Recital