Simply Clarion - C5 Embed Points: Part 1 - Goodbye to Priorities

by Don Reynolds

Published 1998-11-01    Printer-friendly version

Clarion 4 Embed Points--Contracted

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:

Dr100101.gif

C5 Embed Points--Contracted

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

Dr100102.gif

Not only is the list shorter, it is also easier to use. We usually know whether what we’re 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.

Clarion 4 Embeditor

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.

Dr100103.gif

Clarion 4 Embed Points—Return from Embeditor

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

Dr100104.gif

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.

C5 Embeditor

Here is the similar code entered through the embeditor of C5:

Dr100105.gif

C5 Embed Points—Return from Embeditor

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

Dr100106.gif

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.

What does all this mean?

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.

Printer-friendly version

 
 

Search

 

Advanced Search
Topical Index

Related Articles

Subscribe to
ClarionMag

One year: $184

(includes all back issues since '99)

Renewals from $134

Two years: $274

Renewals from $224

More Info

Subscribe Now!

ClarionMag Blog

RSS Feeds

Updates via Email

Enter your Email


Powered by FeedBlitz

Quick Links