next up previous contents index
Next: Segment AssociationCopying, Up: Segments Previous: Segment CreationDeletion,

Segment Names

As indicated above, the FORTRAN binding requires segment names to be integers, and these may be restricted by an implementation to a particular range of values (1-32763 for GKSGRAL). However, because segment names are specified by integers does not imply that an implementation has to make available as many segments as there are names, and the maximum number of available segments is also an implementation-dependent feature which may be much smaller than the maximum legal name. (Thus, one can not assume that an implementation stores name N as the N'th element of an array.) GKS does not provide inquiry functions to obtain either of these maximum values, so one must consult the relevant documentation.

The GKS standard provides a function, GQSGUS, to inQuire the set of SeGment names in USe. However, as it is difficult to work with variable length sets in FORTRAN, the FORTRAN binding has modified this function to allow only the inquiry of the name of one element of the set at a time:

CALL GQSGUS(N, ERRIND, NSG, SGNA)
where
N
is the N'th segment in the set (an input parameter)
ERRIND
is an error number
NSG
is the total number of segments in use
SGNA
is the name of the N'th segment
Thus, in FORTRAN, it is necessary to call GQSGUS in a loop from 1 to NSG in order to obtain a list of all the segment names in use.

Note that the function:

CALL GQSGWK(WKID, N, ERRIND, NSG, SGNA)
works in a similar way to GQSGUS but provides the list of segment names associated with workstation WKID.

Janne Saarela
Mon Apr 3 17:00:12 METDST 1995