George's mixed-based extension templates (for C4) ================================================= The idea is to support the display/input of non-decimal quantities such as seconds and inches. By specifying a class in the data dictionary, these can be automagically formatted for display as, say, feet and inches. To do this, in the user options for a field in the data dictionary, enter for example /FormatClass(FeetAndInches) or if the class definition is in my.inc /FormatClass(FeetAndInches,my.inc) The templates allow for totalling in reports (but not otherwise), and custom total types. Pre-defined classes, defined in george.inc and george.clw are: MinutesAndSeconds HoursMinutesAndSeconds DaysHoursMinutesAndSeconds StonesPoundsAndOunces PoundsAndOunces FeetAndInches DollarsWithFraction There is one pre-defined custom Total type, STD (standard deviation). It should be straightforward add new classes. To install, copy/unzip george.tpl to \clarion4\template george.inc to \clarion4\libsrc george.clw to \clarion4\libsrc AND perform the following edit to \clarion4\template\abbrowse.tpw - immediately after the 3 lines (at lines 1260-1262 in my source) #IF(%Field=%QFieldName) #SET(%QFieldType,'LIKE('&%Field&')') #SET(%QueueFieldComment,%QueueFieldComment&' - type derived from field') insert the 3 lines #ELSE #SET(%QFieldType,'LIKE('&%QFieldName&')') #SET(%QueueFieldComment,%QueueFieldComment&' - type derived from field name') [Unfortunate, but this seems necessary to get list boxes to work correctly]. In the Clarion IDE, select Setup/Template Registry and register george.tpl. After creating your .APP, select Global/Extensions and Insert the 3 extensions: Format all browse box fields Format all windows Format all reports [If only a few procedures require the feature, you may choose to add the extensions on a per-procedure basis] That's it, except for a custom total type, which you specify from the procedure properties dialog by: Click on Extensions Select 'Format report controls' Click on Insert Select Custom Total Fill in the field equate label of the control, and the custom total name, e.g. STD. Further points: The default entry mode for picture patterns is over-write. You may want to use insert mode (see Extra tab of the control), and also enable entry patterns on the window (Extra tab of window properties). stock.dct,stock.app and stock.tps is a simple test. I think the only changes made to the .app after wizard generation were to populate the global extensions (as per instructions above) and add average and standard deviation fields to the report. This stuff is free-ware, you can use it in any way you wish. Please let me know if you find any bugs, or have suggestions. George Barwood 4th April 1998 george.barwood@dial.pipex.com