![]() |
|
Published 1998-11-01 Printer-friendly version
As we have used Clarion4, we find from time to time we need to add embeds. If we build a browse and press the embed button we usually get a long list of possible embed points. Assume that we have not yet put any code into any embed points. If we press "Contract All" we get the condensed list which follows:

Doing the same thing in C5 produces the following "shorter" list:

Not only is the list shorter, it is also easier to use. We usually know whether what were looking for is local data, a local object, a window event (events effecting the entire window), a control event (events effecting a specific control on a window), procedure routines, or local procedures.
If we select the browse procedure in the procedure map and select "Source" we enter the embeditor. This provides one way (of many) to add embedded code. For this example, I scrolled down to the WindowManager Method Executable Code Section. (Technically in the init section.) I added some commented lines of code, which appear in red below. Of course the code you would add would be much better than this.

After entering the above code via the embeditor, I exited the embeditor, pressed the "Embeds" button, selected "filled Embeds" and got the following:

Notice how this is showing only the code I added. All of these particular embed points are in INIT, yet the relationship of these embeds to the template generated code is not clear. The exact positioning of the embeds is controlled by the priority set for each embed. A mistake in the priority setting could move code and produce some interesting surprises.
Here is the similar code entered through the embeditor of C5:

In a like fashion, we quit the embeditor, press embeds, select filled embeds, and we get the following:

Yes, this is after pressing the icon for showing only the filled embeds. The added embed points appear in the icons with the red mark on them. However, instead of only those embeds appearing, we now have a feel for the context of the underlying template-generated pieces. Selecting a priority now is not the issue. We can use the up and down arrows to move our source code up or down in relation to the template-generated code. Appropriate priorities are automatically set for us.
It provides a more understandable way to communicate with the application, and it means we no longer have to worry about priorities directly. We can simply place our embeds in the appropriate position and the correct priority level will be set for us. The C4 "metaphor" of filled embeds includes only programmer-generated fragments of code with an associated priority. Template-generated code does not appear. The C5 "metaphor" includes programmer-generated fragments plus template-generated fragments. Movement of programmer-generated code within these fragments can be done easily with the up and down arrows rather than setting a priority number. For most of us the C5 metaphor will be much easier to work with.
Copyright © 1999-2008 by CoveComm Inc. All Rights Reserved. Reproduction in any form without the express written consent of CoveComm Inc., except as described in the subscription agreement, is prohibited.
Clarion Magazine ISSN 1718-9942
One year: $184
(includes all back issues since '99)
Renewals from $134
Two years: $274
Renewals from $224