Step by Step, Example 2, Chain of Definition, Independent, Dependent


As example two, let’s say that we would like to have this - (Look at Illustration) - on the screen when using ADPlayer.

To obtain the result we do the following steps with ADWorks.
- Open the document you created when looking at Example 1 or open Document_Ex1.ADsrc on the CD in the folder Sample/Try This/FolderEx1

Remember: the Document_Ex1.ADsrc is the source file and the icon is represented by a "W". The Document_Ex1.ADcomp is the compiled file and the icon is represented by a "P".
Remark: you can’t do this example in a New Document, unless you will replace later the operation Duplicate by another operation that will be indicated.
- Choose Static Text from the menu Create Element of ADWorks (See Result)
- Call the definition dialog of that new Static Text (Look and refer to Example 1) (See Result)
- Use Delete All from the Edition of the RTF Editor and type in the text "Below, to left you have to choose 4 towns out of 6 towns. To the right you have to choose 4 rivers out of 6 rivers. The chosen river on the right side must fit with the town chosen on the left side. Validate your Choices with the Validater menu or with a click on his Red spot." Select the text you want to color and use the palette to color the selected text. (See Result)
- Quit the RTF- Editor with OK
- As we do not want accidentally destroy the Document_Ex1.ADsrc we do save our file with the name Document_Ex2.ADsrc

A crucial point now:
- Select the above element Choose Box with the towns and choose the menu Duplicate with permanent Link (Add to Chain) (See Illustration) The operation Duplicate with permanent Link (Add to Chain) will create a choose box with the same definitions (the same list of towns, the same colors and so on). They form a chain of definition. Any change at any element of a chain is automatically applied to all elements of the chain. (Chains can be broken with the command Edit / Separate Chain. The menu Duplicate without permanent Link directly creates a new chain).

If you used New Document then you can’t duplicate. You will have to create the Choose Box and define the list of towns with the Definition Dialog. Precise indications for this are given at Exercise 1.
- Call the Evaluation Dialog of that duplicated Choose Box fill the list of possibilities like this and, before OK, go to the Tab Settings, to choose the number of repetitions, which must be 4. You may also fill the Initial Display. (Illustration). Leaving the dialog with OK will give this result.
Notice: if we ask:  “ … choose 4 towns out of 6 towns on the Continent… “, then we would not put London in the Evaluation Table at the above step. With the restriction Continent the question becomes more difficult as the learner has himself to eliminate London from the choices.
- Choose another Choose Box from menu Create Element of ADWorks, it's for the choice of the rivers.
- Call the definition dialog of that new Choose Box to fill its drop down list with the rivers.(See Illustration). Use as well the definition dialog for the choice of the color of the element.

Another crucial point now:
- The choice of the river will depend on the choice of the town. Therefore the element with the towns is the independent element, the element with the rivers is the dependent element. We make the rivers dependent by linking them to the towns. Select the two elements and click on the Link, the button that appears on the independent unit. (See illustration 1). (See illustration 2)

Know this: An element can only be declared dependent using the above Link operation as long as the element is newly created, that is, as long as the Evaluation Table is still empty. Independent and dependent elements have Evaluation Table that are slightly distinguished. Observe the diffrence when doing the immediately following step.
- Call the Evaluation Dialog of the dependent Choose Box (click on Eval. of the selected Choose Box with the rivers) and fill his list of possibilities. Click in the two colons of possibilities and use the appearing menu to fill colons so that towns and rivers fit together.  (See illustration). Before leaving the Evaluation Dialog with OK you will fill the Initial field on the Stettings Tab with "Choose the river here".

- Choose Validater from the menu Create Element of ADWorks and link the independent element (Choose Box with the towns) to the new Validater. Do only select the Independent and the new Validater. Do not select the dependent element. (See illustration).

The explained steps make a second group of AD elements. A document may contain several groups of AD elements.

We want to test that new group of the document (Look and refer to Exercise 1).
This test will make a temporary jump to ADPlayer (temporary  =  you need not to compile).
The source document looks like this under ADPlayer.
See some most frequent error that may happen.
Choose, under ADPlayer, the good and/or bad answers to check that second group out.
Check what happens, when you try to fool the computer by mentioning the same town twice.

- Go back to ADWorks (Look and refer to Exercice 1)
- Call the Evaluation Dialog (click on Eval. of selected unit) of the independent element, choose the Setting Tab and choose the type Text only (See illustration).
- Do the same (choose type Text only)  with the dependent element.

The test with ADPlayer will look now like this. Click on the numbers to get precious information (See illustration).
Illustration of a typical test.

Save the document with the command File/ Save or File/Save as. This will save a source file.
Don’t forget what you should know about compiled files (look at the end of Example 1)

On the CD you find this second example in the folder Sample/Try This/FolderEx2/
The files there are

- Document_Ex2.ADsrc  (the source file; a "W" in the icon)
- Document_Ex2.ADcomp  (the compiled file; a "P" in the icon)


Back to try this