Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Clarion's process template is a great tool for any kind of procedure that requires stepping through a filtered or unfiltered set of records. A little while ago I had a request to extract some data from a file, simply by stepping through records in primary key order, and my first thought was to go with a process template. But I also had a requirement to potentially restrict the records to a specific range of primary key values. So that meant popping up some kind of window to collect filter values. 

I realized that since As I was processing records in primary key order I decided I could probably do everything more simply with a window procedure. And it turned out to be even easier than I expected, thanks to some useful progress bar property statements. I'll get to those a little later

In this article I'll show how to add a similar procedure to the venerable People.app. 

I start by adding a button to the browse from which I want to call the export process. (I won't actually do any exporting in this example; instead I'll just display data from the records I process.) I set the Action of that button to call a new procedure, which I create using the Window template. Feel free to use the Window wizard if you're more comfortable with it - the only difference is that the wizard lets you set styles and will create the window for you; with the template you'll create the window the first time you go to the window editor. 

Image Added

I need the following elements on the form:

  • a starting primary key value
  • an ending primary key value
  • a progress bar
  • a start button
  • a cancel button

and just for fun:

  • a pause button

Here's the form with the UI elements complete:

Image Added

Since this process won't do anything other than loop through the records (the XML export that inspired the original procedure is outside the scope of this article) all I'm doing is displaying the current record on screen. 

Tip

If you have entry fields you'd rather show as strings on a window, populate them as you normally would. The use the ellipsis button to edit the window definition directly.

Image Added

Simply change the ENTRY to a STRING - everything else on the line can stay the same.

Image Added

Once you get comfortable with Clarion Window structures you can make all kinds of changes. One I make regularly is change entry fields to spin boxes. It's less work than populating a new control and changing the use variable.