Use equates to fill a Clarion Drop List Control

by marc walgren26. March 2013 05:08

Drop Lists work well with a short list of choices, say 3-10. In the Clarion dictionary offers "Must be in List" on the validation tab. There are two parts to the list "Choices" and "Values". The list elements are entered and must be separated by the Pipe character (|).

The approach I favor is to use equates to build the choices/value lists and reference the equate from the particular control. Updating an equate does not require a full application rebuild (handy when developing a multi-dll app) and adding another value is really quick and easy.

Ok. A trival example. We have a system with a User table and each has a Type. (I these standards for the equates

! Equate Prefix: e_   "Equate"  -- Usually For Displaying
! Equate Prefix: v_   "Value"   -- Usually For "Value" stored In DB, like 1,2,3,ENG,SPA
! Equate Prefix: d_   "Default" -- Usually Default "Value"
! Equate Prefix: l_   "List"    -- Usually for Dropdown List

We define four user types and their associated values: (Notice the values are equated strings)

e_UserType_Standard    Equate('Standard')

v_UserType_Standard    Equate('1')

e_UserType_Manager     Equate('Manager')

v_UserType_Manager     Equate('2')

e_UserType_Admin     Equate('Admin')

v_UserType_Admin     Equate('3')


Let's equate the separator characters too.

e_bar             Equate('|')

e_hash            Equate('#')

e_BarHash         Equate(e_bar & e_hash)

Now build the equate for the drop list

l_UserType_opts     Equate(e_UserType_Standard & e_BarHash & v_UserType_Standard & e_Bar & |

                                        e_UserType_Manager & e_BarHash & v_UserType_Manager & e_Bar & |

                                        e_UserType_Admin & e_BarHash & v_UserType_Admin)


Reference the list equate in the From property of the list control.



Works really well.


Additions to the list are trivial. Add a couple equates and update the list equate and recompile.


Clarion | Development

Document Template Usage in Applications - Free to Use

by jim morgan1. March 2013 13:15

Is Clarion running slow because of the number of template that you have installed?

Is your Clarion TRF excessively large, over 5MB?

Do you know what templates are actually used in your application?

Template Finder goes through your applications and develops a list of template chains actually used in a set of applications. Use the results to reconstruct your template registry to optimize Clarion performance. Build a document that shows the templates used by procedure and application.

Two basic modes.

- Unique Templates (sorted by template chain / name)

- Unique Template chains

Click this Link for more information. 



Missing Clarion Templates

by Jim Morgan26. December 2012 05:04

No Template, no problem.....Well a little problem.

 Template Error

If you open an app file and don't have a template used in creating the app, Clarion will remove the template from the application. This can be disastrous. It's much better to leave the hooks to the template inside the app, determine how the template was used and either get the correct template or implement a work around. 

To get around the problem, create a stub template for that family so you can open the app. You will still lose the template's unique generated code, but at least the rest of the code is visable.

1) Open the app.
2) Save a screen shot of every unique template error. Put a screen shot in the clipboard with Alt-Ctrl-PrintScrren and paste it into a temporary document.
3) Do NOT save the app when done!
4) Create and register a tpl file like the one below. The key bits of information are the template family and template name which come from the error screen. The Family comes from your app..

#!== Stub Template to preserve code hooks ===============

5) Register the template.
6) Reopen the app
7) Repeat until all errors are gone. There may be dependent templates that are not visible until subsequent passes.


Blog | Clarion

Contact Us  Consulting  Web Development  Data Collection  Flexible Web Lists  Clarion Products  Downloads  How To Order  Site Map  Store  Home
Copyright (c) 1989-2013 Mitten Software Inc., All rights reserved.

Month List