Ask Dr. DePhobia - Questions and Answers about Clarion

by Jim DeFabia

Published 1999-05-01    Printer-friendly version

Q:Sometimes when I'm working on an application everything will work except one procedure, which will prevent the app from compiling. It would be nice to be able to flag that procedure so the compiler would ignore it and compile so I can test the rest of the app and come back to the faulty procedure another time. Can you help?
A:Yep. And, I can share this template with you. Just add it to the offending procedure and you can omit it anytime you like. I hope you find it useful.

Copy the text to a text file and name it <something>.tpl in your template directory. Then register the template. Once registered, you can add it to any procedure to OMIT the procedure. There is a checkbox to specify whether or not you want to omit the procedure. There is also a prompt to specify the message to display when the procedure is called.

Image6.gif

#TEMPLATE(OmitAProcedure,' Omit A Procedure '),FAMILY('ABC')
#!----------------------------------------------------------------
#! Omit A Procedure (to allow you to compile when a proc is hosed)
#! By Jim DeFabia (EMAIL: Error! Reference source not found.)
#! For Clarion Online subscribers only
#! Do Not redistribute without permission from Author
#!
#!----------------------------------------------------------------
#EXTENSION(AllowOmit,'Enable this procedure to be OMITted'),PROCEDURE
#BOXED('Allow Omit Settings')
#PROMPT('Omit this Procedure',CHECK),%OmitFlag,DEFAULT(1)
#PROMPT('Message Display',@s40),%MessageToShow,DEFAULT('Procedure disabled')
#ENDBOXED
#AT (%DataSection,''),FIRST
#IF(%OmitFlag)
  CODE
  MESSAGE('%MessageToShow')
  OMIT('!endomit*')
#ENDIF
#ENDAT
#AT (%LocalProcedures,''),LAST
#IF(%OmitFlag)
  !endomit*
#ENDIF
#ENDAT

Q:Doctor, I have three BrowseBoxes on a window, and my toolbar buttons only work for one of them. Can the toolbar work for each browse, and if so, how?

-Confused in Cleveland-

A:We'll talk about Cleveland later, but I can help with your toolbar issue now. The answer requires two steps for each BrowseBox:

First, you must check the Accept Browse control from toolbar box on all three browses (on the Actions tab).

Image7.gif

Next, you must set the target for the toolbar control to the selected browse. There is a control template which allows you to set this easily.

In the Window Formatter, double-click on the first browsebox, and find the Control Events, <list control>, Selected embed point.

Press the Insert button, then select the SelectToolbarTarget code template.

Image8.gif

You are prompted for the target. Select this browse box from the drop-list, then press the OK button.

Image9.gif

Repeat for the other two BrowseBoxes and your ToolBar will handle them all.

Q: Is it possible to have a list box display data in the reverse order of a key without creating a key in descending order?

A: Without being too condescending, I can tell you descending orders are a snap.

Merely specify No Key on the BrowseBox, then specify the key components in the BrowseBox's Additional Sort Fields with a minus sign in front of each. This allows you to display in reverse key order with no code.

For example, if you wanted to display the Order file in reverse Date order, you would type : -ORD:Date in Additional Sort Fields. If you have more than one key component, separate each with a comma.

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