In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
  
Home page Home page Home page Home page
Pixel
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel
Pixel

Uncommon Knowledge - WC_Unkeys%

A field mark delimited list of keys which are to be disabled in the window. Primarily used to link to the "Key Disable" option in Paint. This variable is used by the system to modify WC_WExit_Keys% and WC_Except_Keys% (q.v.) by swapping out the appropriate scan codes for the literal "!!" in these variables. Thus once these variables have been changed they are no longer affected by the contents of WC_UnKeys%.

As this swapping seems to be done AFTER the Pre_Init process it is possible to amend WC_UnKeys% at the Pre_Init process by directly modifying @RECORD which contains the current template record. This has the effect of changing the disabled keys in the window. Note that this means that WC_UnKeys% can only be effectively modified at the Pre Init stage - after this it is not referenced again.

Note further that the same effect could be achieved anywhere in the window by swapping the appropriate scan codes for the literal "!!" in WC_WExit_Keys% and WC_Except_Keys% (q.v.). In either case, rather than looking for the scan code itself one should use the EDIT.KEYS include record look to ensure that if the user has remapped the keyboard that the scan code will still be found.

There follows an example piece of code to illustrate the use of WC_UnKeys% in a pre init process.


0001      Subroutine Kill_Refresh
0002        $Insert Include, Edit.Keys
0003        Equ Dlm$    To Char(247)
0004        * Get Unkeys from @Record - from pos 43 delimited by char(247)s
0005        Un = Field(@Record, Dlm$, 43)
0006        Un<-1> = Refresh.Key
0007        @Record=Fieldstore(@Record,Dlm$,43,-1,Un)
0008      Return

Normally this should be sufficient, however under some circumstances (such as with some collector windows and some releases of the software) this might not be enough as Curt Putnam points out "the window processor sets flags within the body of the template record to indicate whether there are any further options to process". This helps speed up the loading process. These flags are referred to in the TEMPLATE record in UTILITY.DOC as OPTIONS1 and OPTIONS2 and are found in positions 20 and 35 respectively (delimited by char(247)s).

Normally these flags are ALWAYS set as the system sets recalculate options and WC_Atr_Ovr% automatically upon save and this is enough to trigger them. If however you find that the above code does not work on the release of AREV you are working with, try amending it by inserting the following two lines after the @Record = Fieldstore line.


0001     * Set Options1
0002     @Record=Fieldstore(@Record,Dlm$,20,-1,1)
0003     * Set Options2
0004     @Record=Fieldstore(@Record,Dlm$,35,-1,1)

(Volume 3, Issue 10, Pages 11,12)
Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel