home *** CD-ROM | disk | FTP | other *** search
- /*
- These modifications have been designed specifically with the DataBoss
- CASHBOOK example in mind. Copy DBP.SKL to CASH.SKL and make the following
- modifications to "Custom_Key". Re-generate CASHBOOK specifying CASH.SKL
- to observe the results when <F2> is pressed when editing the cheque
- details, (AMOUNT or LEDGER CODE fields).
-
- a) How to use Custom_Key to pop up a "Choose" box to select a field value.
-
- b) How to use Custom_Key to pop up a "List" to select a field value and
- then fill in default values for other fields from the listed file.
- */
-
- bool custom_key(int scr, int fno, int *fld, uchar *key)
- /*
- We save and restore the value of "*fld" because functions like "list()",
- "choose()" and "found()" can modify its value, which would change the field
- we would edit next.
-
- Before we call "displayrec()" to update the screen we disable the "tabular"
- nature of file 3 because a full table display could possibly get different
- data into the record buffers.
- */
- {
- bool tb;
- uchar dummy[81];
- int savFld, savTab;
-
- savFld = *fld; /* Save the current value of *fld */
-
- /*a*/
- /**/ if ((*key == F2) && (fno == 3) && (*fld == 5))
- /**/ choose(dummy," 123.00| 234.00","Rent|Car Lease",CASHBOOK3.AMOUNT);
-
- /*b*/
- /**/if ((*key == F2) && (fno == 3) && (*fld == 7)) {
- /**/ list(dummy,7,1,CASHBOOK3.LEDGER_CODE);
- /**/ pad(CASHBOOK3.REASON,CASHCODE1.DESCRIPTION,30,Right);
- /**/ savTab = tabsize[3]; tabsize[3] = 1; /* Disable "tabular" in edit */
- /**/ displayrec(3,2);
- /**/ tabsize[3] = savTab; /* Restore "tabular" */
- /**/}
-
- *fld = savFld; /* Restore the old value of *fld */
-
- ⁿcodedispⁿ
- return(False);
- }
-