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
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.