Difference between revisions of "LINK"

From Recital Documentation Wiki
Jump to: navigation, search
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Applications
 
 
 
 
==Purpose==
 
==Purpose==
 
Link multiple source program files into a single file
 
Link multiple source program files into a single file
Line 18: Line 14:
  
 
==See Also==
 
==See Also==
[[COMPILE]], [[DO]], [[FUNCTION]], [[PROCEDURE]], [[Recital Linker]], [[SET MAXDBO]], [[SET PROCEDURE]], [[SET PSHARE]]
+
[[COMPILE]], [[DO]], [[FUNCTION]], [[PROCEDURE]], [[Recital Linker]], [[SET PROCEDURE]], [[SET PSHARE]]
  
  
Line 43: Line 39:
 
|-
 
|-
 
|}
 
|}
The Recital Linker can also be called from the Operating System command line using the Recital Terminal Developer 'dbl' utility.
+
 
 +
 
 +
The Recital Linker can also be called from the Operating System command line:
 +
 
 +
 
 +
<pre>
 +
$ recitaladmin -l -i <input file> -o <output file> -x <first procedure> -m <message file>
 +
</pre>
 +
 
 +
or
 +
 
 +
<pre>
 +
$ recitaladmin linker -i <input file> -o <output file> -x <first procedure> -m <message file>
 +
</pre>
 +
 
 +
 
 +
Note: The earlier ''dbl'' syntax has been deprecated in Recital 10, to be replaced with ''recitaladmin -l | linker''.
  
  
Line 53: Line 65:
 
// Comments and indentations will be retained
 
// Comments and indentations will be retained
 
link from "app1*.prg" to app1 message output command "app1start" comments
 
link from "app1*.prg" to app1 message output command "app1start" comments
 +
</code>
  
// Another example
+
Another example:
 +
 
 +
<pre>
 
//app1.dbl
 
//app1.dbl
 
app1start.prg
 
app1start.prg
Line 60: Line 75:
 
app1end.prg
 
app1end.prg
 
//end of app1.dbl
 
//end of app1.dbl
 
+
</pre>
 +
<code lang="recital">
 
// Creating linked file app1.src to include all files specified in app1.dbl.
 
// Creating linked file app1.src to include all files specified in app1.dbl.
 
// Message output will be written to info.map.
 
// Message output will be written to info.map.
Line 70: Line 86:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 +
[[Category:Applications]]
 +
[[Category:Applications Commands]]

Latest revision as of 13:53, 1 December 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 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:


$ recitaladmin -l -i <input file> -o <output file> -x <first procedure> -m <message file>

or

$ recitaladmin linker -i <input file> -o <output file> -x <first procedure> -m <message file>


Note: The earlier dbl syntax has been deprecated in Recital 10, to be replaced with recitaladmin -l | linker.


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