Some notes I made while comparing 14487 to 14438:
LibSrc changes in 14487 from 14438
Not too much new in LibSrc, just 5 files changed affecting 3 classes. Browse Entry locator may be significant with change to always
DateTime.CLW
Added .Pct() method has LEFT(CLIP()) on all RETURN as suggested
ABBrowse.INC
EntryLocatorClass CLASS(LocatorClass),TYPE,MODULE('ABBROWSE.CLW'),DLL(_ABCDllMode_)
!Shadow CSTRING(40) !14438 was Narrow so this affects ALL Entry Locators
Shadow USTRING(40) ! The locator entry's USE variable: wide, so typed text outside the ANSI code page survives
ABBrowse.CLW
Code Excerpts, have not tried to understand its impact. Need to review where .Shadow is set and all use.
!14438 Old Code
FilterLocatorClass.UpdateWindow PROCEDURE
FN CSTRING(100),AUTO
SN CSTRING(100),AUTO
CODE ...
SN = CHOOSE(INSTRING('UPPER(',FN,1,1) = 0,QUOTE(SELF.Shadow),QUOTE(UPPER(SELF.Shadow)))
IF SELF.FloatRight
SELF.ViewManager.SetFilter(CHOOSE(SN='','','INSTRING('''&SN&''','&FN&',1,1) <<> 0'),'3 Locator')
ELSE
IF LEN(SELF.Shadow)>0
SELF.ViewManager.SetFilter('SUB('&FN&',1,'&LEN(SELF.Shadow)&') = '''& SN & '''','3 Locator')
ELSE
!14487 New Code ... note above in INC file "Shadow" chnaged from CSTRING to wide USTRING... so code is always wide?
FilterLocatorClass.UpdateWindow PROCEDURE
FN CSTRING(100),AUTO
SN CSTRING(100),AUTO
CODE ...
SN = 'Locator' & ADDRESS(SELF.Shadow) !Address makes it Unique per Class Instance
BIND(SN,SELF.Shadow) !BIND() removed by POPBIND at return
IF INSTRING('UPPER(',FN,1,1)
SN = 'UPPER(' & SN & ')'
END
IF SELF.FloatRight
SELF.ViewManager.SetFilter(CHOOSE(LEN(SELF.Shadow) = 0,'','INSTRING('&SN&','&FN&',1,1) <<> 0'),'3 Locator')
ELSE
IF LEN(SELF.Shadow)>0
SELF.ViewManager.SetFilter('SUB('&FN&',1,'&LEN(SELF.Shadow)&') = '& SN,'3 Locator')
! The typed text reaches the filter as a BOUND variable, never as a literal: a filter expression is narrow
! text, so a literal loses every character outside the ANSI code page, while the bound USTRING keeps its
! units and the expression evaluator compares them with a wide column directly. The name is unique per
! object (two conditional locators in one procedure must not share it) and needs no quoting of the value.
! The window's PUSHBIND/POPBIND (WindowManager.Init/Kill) scopes the name, as it does every BIND the
! classes make; an UNBIND of its own would run after that POPBIND and post an error the caller could read.
ABReport.INC and ABReport.CLW
ReportManager CLASS(WindowManager),TYPE,...
!14487 adds new Method
HasPreviewer PROCEDURE(),BYTE ! TRUE when a previewer is attached: Preview (PrintPreviewClass) or PreviewI (IReportPreviewer)
! A ReportPreviewClass is not a PrintPreviewClass by type, so it arrives through the IReportPreviewer Init and
! leaves Preview NULL. Code that asks "is there a previewer?" tests this instead of SELF.Preview alone.
ReportManager.HasPreviewer PROCEDURE()
CODE
RETURN CHOOSE(NOT SELF.Preview &= NULL OR NOT SELF.PreviewI &= NULL)
Template changes in 14487 from 14438
ABBrowse.TPW
#OROF('USTRING') added 2 places so treated like STRING for Thumb and %StepManagerXxxxxType.
Generated CLWs see USTRING change from StepRealClass to StepStringClass
ABProcs.TPW
Same as above #OROF('USTRING') added 3 places so treated like STRING.
ABProgrm.TPW
%InitialValue gets USTRING handling like STRING. New #ELSIF checks for U'' prefix on Initial Value so it does not output something like =''U''''value'''''. Second #ELSEIF adds OR %FieldType = 'USTRING'
#ELSIF(UPPER(SUB(%InitialValue,1,2))='U''' AND SUB(%InitialValue,LEN(%InitialValue),1)='''' AND LEN(%InitialValue)>3)
#! A U'' wide literal is a complete string expression already - assigned as it stands
#ELSIF((%FieldType = 'STRING' OR %FieldType = 'CSTRING' OR %FieldType = 'PSTRING' OR %FieldType = 'USTRING') AND SUB(%InitialValue,1,1) ~= '''')
#! If the user want to add () parenthesis to the the string initial value then the whole initial value must be between single quotes
#IF(NOT (INSTRING('(',%InitialValue) AND INSTRING(')',%InitialValue)))
#SET(%InitialValue, %SVStripPling(%InitialValue))
#ENDIF
#ENDIF
Validation INLIST adds USTRING treatment adding check OR %FieldType = 'USTRING'
#AT(%FieldLevelValidation),WHERE(ITEMS(%FieldValues) AND (%FieldValidation = 'INLIST')),PRIORITY(6000)
...
#IF(%FieldType = 'STRING' OR %FieldType = 'USTRING' OR %FieldType = 'MEMO')
IF INSTRING(']' & CLIP(%Field) & '[', %CDList, 1, 1) = 0
ABWApp.TPW, ABWBrw ABForm ABWRep ABWCus - WApp WBrowse WForm WReport
Major feature Wizards add FONT code to ABWCus.TPW that the others use to allow Developer to set the Window Font.
#GROUP(%DefaultFontWizardPrompts)
#! The wizard's Theme page: the developer's choice to take the default font (Tools > Options > Clarion >
#! Applications) for the windows the wizard makes; shown only when a face is set.
#ENABLE(%DefaultWindowFontName<>'')
#PROMPT('Use my default font for the windows',CHECK),%QuickUseDefaultFont,AT(90,,235),DEFAULT(%True)
#DISPLAY('(' & %DefaultWindowFontName & ' ' & %DefaultWindowFontSize & ', from Tools > Options > Clarion > Applications)'),AT(105,,220)
#DISPLAY('(unchecked = the theme''s fonts)'),AT(105,,220)
#ENDENABLE
Legacy CONTROL.TPW and CtlBrowA.TPW
Like ABProgrm.TPW %InitialValue gets USTRING handling like STRING. New #ELSIF checks for U'' prefix on Initial Value so it does not output something like =''U''''value'''''. Second #ELSEIF adds OR %FieldType = 'USTRING'.
#ELSIF(UPPER(SUB(%InitialValue,1,2))='U''' AND SUB(%InitialValue,LEN(%InitialValue),1)='''' AND LEN(%InitialValue)>3)
#! A U'' wide literal is a complete string expression already - assigned as it stands
#ELSIF((%FieldType = 'STRING' OR %FieldType = 'CSTRING' OR %FieldType = 'PSTRING' OR %FieldType = 'USTRING') AND SUB(%InitialValue,1,1) ~= '''')
#!%FieldValidation = 'INLIST' AND
#SET(%InitialValue, %SVStripPling(%InitialValue))
Legacy CtlBrow.TPW
What I see as a BIG CHANGE the Legacy Browse Incremental, Filtered and Entry Locator changes from STRING to USTRING for ALL Keys i.e. so existing STRING types will generate code to process locators as wide USTRING. Simple change from STRING to USTRING, but no other changes to the logic. It assumes no UTF-32 which is reasonable. E.g. if Backspace is pressed if removes 1 character.
| 14438 Old Code |
14487 New Code |
#IF(%BrowseLocatorType='Incremental' OR ...='Filtered') |
#IF(%BrowseLocatorType='Incremental' OR ...='Filtered') |
#SET(%ValueConstruct,%BrowsePrefix & ':LocatorValue') |
#SET(%ValueConstruct,%BrowsePrefix & ':LocatorValue') |
%[20]ValueConstruct CSTRING(31) |
%[20]ValueConstruct USTRING(31) <--- Wide String |
#SET(%ValueConstruct,%BrowsePrefix & ':LocatorLength') |
#SET(%ValueConstruct,%BrowsePrefix & ':LocatorLength') |
%[20]ValueConstruct BYTE |
%[20]ValueConstruct BYTE |
#ELSIF(%BrowseLocatorType='Entry') |
#ELSIF(%BrowseLocatorType='Entry') |
#SET(%ValueConstruct,%BrowsePrefix & ':LocatorValue') |
#SET(%ValueConstruct,%BrowsePrefix & ':LocatorValue') |
%[20]ValueConstruct STRING(30) |
%[20]ValueConstruct USTRING(31) <--- Wide String |
#ENDIF |
#ENDIF |
Other
ABWDctP.TPW ABC Dictionary Print Wizard adds #OROF('USTRING') to #GROUP(%ConstructType)
WDctPrn.TPW Legacy Dictionary Print Wizard adds #OROF('USTRING') to #GROUP(%ConstructType)
ADO.TPW adds many #OROF('USTRING')
QCenter.TPW - BrowseQBEList adds two #OROF('USTRING') to treat as 'datatype:string'
Standard.TPW adds #OROF('USTRING') to treat as String for %StandardViewFilter, plus OR %FieldType='USTRING' for %StandardWriteViewOrder