Example 10, Take advantage of prepared messages, Cross-References


1) Prepared Message

This description will add messages to Document_Ex9.ADsrc, found on the CD in the folder Sample/Try This/FolderEx9/. The modified document will be saved with the name Document_Ex10.ADsrc. It can be found on the CD in the folder Sample/Try This/FolderEx10/

Let's look first at this question and at the the evaluation table of the Choose Box for the town. Illustration. The following steps will link a prepared message to the choice Paris.
- Open that evaluation tables (Eval. button) and click in Click Column Message and line Paris (first line). You get this menu.
- Choose Message Editor + Message Manager in that menu as highlighted  in the preceding illustration.
- We arrive in the Message Editor main tab, studied during the Guided Visit. Observe on the Message Manager tab that 8 messages (ID 6001 to 6008) are unprotected (no “P”) and unused (0+0:0). The program ADWorks prepared the messages ID 6001 to 6009 when the document was created and we not yet linked any of them. Observe as well the check box at the bottom of the main tab and let it checked.
- Make now the message 6008 current as shown on the Message Manager tab.
- Click on Properties tab to get a detailed look on the message 6008. It’s this. (Paris is the perfect answer for the question). Observe the strange terms ^Num, ^Pts, ^Max of the illustration. ^Num, ^Pts, ^Max will be commented below at Cross-references. We do not change anything on the Properties tab (it was only for looking).
- Leave now the Message Editor with OK. The Evaluation Table is now like this because the mentioned check box was checked.
(- B.T.W. Some Click on Perfect … gives now this menu. Use this menu only if you want to copy, paste, delete a link)
- Leave the modified Evaluation Table with OK.
As these step where so easy we do them again for the second part of the question (spoken Language?).
- Open that evaluation tables (Eval. button) and click in Click Column Message and line French (first line) and choose Message Editor + Message Manager.
- Make again the message 6008 current as shown on the Message Manager tab and click OK. (No need to go to Properties tab)
- The Evaluation Table is now like this because the mentioned check box was checked.
- Leave the modified Evaluation Table with OK.
We are ready for a temporary jump to ADPlayer to test the new group. It looks like this. Note that ^Num, ^Pts, ^Max have been replaced.
^Num became the number of the concerned element.
^Pts became the achieved points with the element.
^Max became the maximum available points with the element.
More about ^Num, ^Pts, ^Max at Cross-References
Note: The three messages mentioned at that validation are caused in the following way.
1 from evaluation table Choose Box towns,
1 from evaluation table Choose Box languages and
1 from the Default Messages of the Validater.
If we want the "Bingo" message not to appear then we delete his link as seen at Guided Visit: Open the Evaluation of the Validater, choose the Setting tab, and use this menu.

Observe: The Info column of the Message Editor gives the count of usages. More can be seen on the Info tab. See illustration.

List of the prepared Message:

- 6008 : "Perfect answer for independent elements"
- 6007 : "Perfect answer for dependent elements"
              (see example below at Cross-References)
 -6006  "Better answer expected for independent elements"
             (see example below at Cross-References)
- 6005  "Better answer expected  for dependent elements"
- 6004  "Bad answer for independent elements"
- 6003  "Bad answer for dependent elements"
- 6002  Template for messages that give the solution.
- 6001  Template for messages that give a hint.
- 6000  Template for any message


2) Cross-References

There are 5 types of cross-references when writing messages: '^Num, ^Pts, ^Max, ^Val and ^Par. In the above example we have seen that the cross-references take values from the concerned element or Validation when using ADPlayer. The next step is an example where all the 5 cross-references appear. We shall use the prepared message 6007 (illustration) which is for Dependent elements (dependent, see and refer Ex 2).

- Open the Evaluation Dialog of the "River"-Choose box of this question. (The choice of the river depends on the choice of the town).
- Click in first line to add the message 6007. Illustration.
- Click again in first line und use Copy Message. Illustration.
- Click in line 2 und use Paste Message by Reference.
- Click in line 3 und use Paste Message by Reference.
- Click in line 4 und use Paste Message by Reference.
- Click in line 5 und use Paste Message by Reference.
- Click in line 6 und use Paste Message by Reference. Illustration.
Note:
--> Paste by Reference doesn’t create a new message. Only the reference is pasted.
--> Paste by Copy creates a new message that has initially the same form.

Check it out with a temporary jump to ADPlayer. See the result of a validation and observe the values taken by ^Num, ^Pts, ^Max, ^Val, and ^Par. The meaning of ^Num, ^Pts, ^Max is as before and
^Val became the number of the concerned Validate.,
^Par became the number of the concerned independent element.

Note: The meaning of  ^Num, ^Pts, ^Max, ^Val does never change. The meaning of ^Par ("Par" is for "Parameter") is like the one of a joker. The meaning of ^Par depends on the circumstances.
To understand more about that joker and to give some examples of the usage of the prepared messages 6006 and 6004 we continue the the following steps.

- Open the Evaluation table of the Text Write Box of this question. (Illustration)
- Add message 6006 to the answer Washington. (Illustration)
  (Note: A better solution than only, “There is a better response” will be given in the exercise 11
- Add New York and San Francisco with 0 points and the message 6004. (Illustration)
Some comments to that last illustration:
1) Geographically speaking the question is silly, the question is instructive about "How the program works".
2) You observe that the length of the table can be as long as you want.
3) An instructive part you will easily observe when you try the answer New York under ADPlayer. See result with New York in the table and see result without New York in the table.
4) The first three items of the table do not really need the message 6008 ("Perfect .." ). The Default Message of the Validater will do the job.
5) We shall add some other message to the first three items in the exercise 11.
- Change to the Setting tab of the Evaluation Dialog. We want to modify the Default Messages of the Text Write Box
- Open the Properties of the first Default Messages (See how open and see result, the opened Default Message 5005). The opened message 5005 contains the cross-reference ^Par. Compare the opened message 5005 with this illustration taken from the validation of Washinngton. The cross-reference ^Par, the joker, means the recognized characters in the circumstances of the Default Messages in Text Write Boxes.
- Click now on the black é(editor) of the Properties tab with the opened Default Messages 5005.
- Modify the text like this.
- OK for RTF Editor, OK for Properties in the Message Editor. We are back to that.
- Open the Properties of the second Default Messages. His ID is 5006. The second line is ?"^Par" with 5006. It was "^Par"? with 5005.
- Modify the text of the message 5006 like this.
- Open the Properties of the third Default Messages. His ID is 5007. The second line is now ?"^Par"?
- Modify the text of  the message 5007 like this.
(We do not change the forth Default Messages.)
- Open the Properties of the fifth Default Messages. His ID is 5009 and modify the text of the message like this.
Note: Use the command Import, explained on Guided Visit if you want to use these versions for those Default Messages in other documents.

We are ready for a temporary jump to ADPlayer to test the messages. See some results of validations: Illustration 1, Illustration 2, Illustration 3, Illustration 4, Illustration 5 .

Use this if you want to now more about cross-references.
Use this if you want to now more about Messages.
Look at these helps if you intend to use frequently Text Write Boxes. The Turbo button and the Interpretation of Parenthesis will be a powerful in the preparation of the Evaluation Table. Evaluation Tables of Text Write are often tedious.
On the CD you find this example in the folder Sample/Try This/FolderEx10/
The files there are
- Document_Ex10.ADsrc  (the source file; a "W" in the icon)
- Document_Ex10.ADcomp  (the compiled file; a "P" in the icon)
Back to try this