VARKON Version 1.15 1997-10-24


global_ref - Function

Makes a reference global


Description

Converts a local reference to a global reference by adding the global identity of the calling module. An optional parameter can be used to exclude one or more levels from the call chain.

Syntax

global_ref(ref, level)

REF ref;
INT levels;


Principal parameters

ref - A local reference


Optional parameters

levels - Number of levels to skip, default = 0. 0 <= levels <= 9


Return value

A global REF.

Examples

Suppose that a certain module has a global identity of ##1#2#3. This would mean that the active module (topmost) has called a module #1 who has called a module #2 who finally has called a module #3. A call chain in 4 levels. The global_ref() function would then return the following if used in #3 when #3 is executing...

global_ref(#4) = ##1#2#3#4
global_ref(#4, 0) = ##1#2#3#4
global_ref(#4, 1) = ##1#2#4
global_ref(#4, 2) = ##1#4
global_ref(#4, 3) = ##4
global_ref(#4, 9) = ##4

VARKON Homepage Index