Search | Synergex.com | Contact Us | Resource Center Login | Home|
News

Given the following Repository schema:

Structure POINT    USER DEFINED
     Description  "Defines an X, Y coordinate pair"
Field X   Type INTEGER   Size 4
   Description "Horizontal coordinate"

Field Y   Type INTEGER   Size 4
   Description "Vertical coordinate"

Structure LINE   USER DEFINED
   Description "Describes a line by two endpoints"
Group POINT1   Reference POINT   Type ALPHA
   Description "First coordinate"
Group POINT2   Reference POINT   Type ALPHA
   Description "Second coordinate"

And the following UI Toolkit window script:

.script
.input i_point, 2, 20
repository line
.field x
.field y
.end

At what position in the data structure does the field "x" referenced in the window begin?


a. 1
b. 9
c. This does not compile because X doesn't exist in LINE.
d. This does not compile because X is not unique in LINE.

Explanation

The structure LINE contains two group fields, both of which are defined by the structure POINT.  UI Toolkit allows you to reference the members of a group field by name, so X in each POINT is visible.

However, since there are two POINT fields, X is not unique.  Therefore,
(d) is the correct answer.

To make the field names X and Y unique so that they can be used by the UI Toolkit, you can set a prefix for each containing structure.  For example, we could modify the LINE structure like so:
 

Structure LINE    USER DEFINED
   Description "Describes a line by two endpoints"

Group POINT1   Reference POINT   Prefix PT1_   Type ALPHA
   Description "First coordinate"

Group POINT2   Reference POINT   Prefix PT2_   Type ALPHA
   Description "Second coordinate"
Note the "Prefix" on each POINT field.  Now the UI Toolkit can reference "PT1_X", "PT1_Y", "PT2_X", or "PT2_Y" to obtain the desired field.

More information about News and Events

Contact Synergex to learn more about  News and Events