Page 1 of 1

PERIODIC-GROUP-VARIABLE(#J.#K) variable ?

PostPosted: Fri Oct 01, 2010 11:08 am
by diptisaini
Hi,

Can anyone tell me what is the meaning of below statement ?

VIEW.PERIODIC-GROUP-VARIABLE(#J.#K)?
Where #j and #k are two (n2) variables.

Re: PERIODIC-GROUP-VARIABLE(#J.#K) variable ?

PostPosted: Fri Oct 01, 2010 3:38 pm
by ats
This nothing but an array and it's index. Well, are the two varibales really separated by a DOT "." or a COLON ":"
like VIEW.PERIODIC-GROUP-VARIABLE(#J:#K)

Re: PERIODIC-GROUP-VARIABLE(#J.#K) variable ?

PostPosted: Sat Oct 02, 2010 6:13 pm
by RGZbrog
This is a rather obscure and, in my experience, seldom-used syntax. I haven't seen it used since the arrival of Natural 2 some 20 years ago. I would have to guess that its usage in Diptisaini's program is unnecessary.

The syntax is documented in
Programming Guide
. User-Defined Variables
. . Referencing a Database Array
. . . Referencing Arrays Defined with Variables

In the program's data definitions you will see two or more definitions of the same MU or PE field, each specifying a different range of occurrences, as in

02 PERIODIC-GROUP-VARIABLE (#I:#I+10)
02 PERIODIC-GROUP-VARIABLE (#J:#J+5)

To refer to these fields, Natural needs to know which range, and which occurrence within the range. The following line refers to the #Kth occurrence of the second range (the range beginning with #J).

VIEW.PERIODIC-GROUP-VARIABLE (#J.#K)

It is much clearer and simpler to define the field as a single range, and avoid the "#J." syntax.