1. Home
  2. GETNAME procedure

GETNAME procedure

Forms the name of a structure according to its IPRINT attribute (A.R.G. McLachlan).

No options

Parameters

STRUCTURE = identifiers Structures whose names are to be obtained
NAME = texts Saves the names of the structures
IDENTIFIER = texts Saves the identifiers of the structures
EXTRA = texts Saves the extra texts of the structures
IPRINT = texts Saves (or forms) IPRINT attributes

Description

Procedure GETNAME can be used to obtain the name from any Genstat data structure.

The structure from which the name is to be obtained must be specified using the STRUCTURE parameter, and can be any data structure. The NAME parameter saves the name, which will be a text containing the identifier and/or the extra text associated with a structure depending on the setting of its IPRINT attribute. If the structure is one that does not have an IPRINT attribute (e.g. an LRV), NAME returns the identifier. If the structure is unnamed, NAME returns a missing text.

The IDENTIFIER parameter can save the identifier of the structure, and the EXTRA parameter can save the extra text from the structure (if any). The IPRINT parameter can save the IPRINT attribute if the structure has one. For structures that do not have an IPRINT attribute, IPRINT is set to 'identifier'. For unnamed structures, IPRINT returns a missing text.

Options: none.

Parameters: STRUCTURE, NAME, IDENTIFIER, EXTRA, IPRINT.

Method

GETNAME uses GETATTRIBUTE to get the necessary attributes.

See also

Directives: GETATTRIBUTE, TXCONSTRUCT.

Commands for: Data structures.

Example

CAPTION   'GETNAME example'; STYLE=meta
VARIATE   [IPRINT=identifier] Var1; EXTRA='Variate 1 extra text'
VARIATE   [IPRINT=extra] Var2; EXTRA='Variate 2 extra text'
VARIATE   [IPRINT=identifier,extra] Var3; EXTRA=' Variate 3 extra text'
VARIATE   [IPRINT=*] Var4; EXTRA=' Variate 4 extra text'
FOR Var=Var1,Var2,Var3,Var4,!(1...4)
  GETNAME Var; NAME=Name; IDENTIFIER=Ident; EXTRA=Extra; IPRINT=Iprint
  PRINT   [SQUASH=y; IPRINT=*; STYLE=plain]\
          'Name:',Name; FIELD=14; JUST=right,left
  &       'Identifier:',Ident; FIELD=14; JUST=right,left
  &       'Extra text:',Extra; FIELD=14; JUST=right,left
  &       'Iprint:',Iprint; FIELD=14; JUST=right,left
  SKIP    [FILETYPE=output] 1
ENDFOR
Updated on March 7, 2019

Was this article helpful?