tips:revmedia:v3i4a7

Uncommon Knowledge - WC_Id_Next%

Published ByDateVersionKnowledge LevelKeywords
Sprezzatura Ltd01 AUG 19912.03+EXPERTWINDOW_COMMON%, WC_ID_NEXT%, WC_NEW_ID%

A variable used to indicate to the system what the next record ID used ought to be. To indicate to the system that a new id is active, the variable WC_New_Id% must also be set to true. Then depending upon the location in the processing, and upon the value of WC_RESET%, the value in WC_Id_Next% will become the new Id.

The Reset values required to force the system to recognise WC_Id_Next% are identical to those required for WC_Browse_Next% as documented in Vol 2 Issue 10 q.v.

Note that when loading new Ids in this manner, the cursor will remain at the current prompt. In the case of a new record this might not be desirable. It might therefore be wise to amend the code loading WC_Id_Next% to set WC_Wi_Next% either to the starting prompt (if one has been specified for the window using Paint, F10, Customise) or to the prompt immediately following the key (using Key_Cnt documented later) as follows

 WC_ID_NEXT% = NEXT_REC_ID
 WC_NEW_ID% = TRUE$
 IF WC_START% THEN
    WC_WI_NEXT% = WC_START%
 END ELSE
    WC_WI_NEXT% = WC_KEY_CNT% + 1
 END

To clear the screen programatically (as though F8 had been pressed but without the double check), load WC_Id_Next% with null and set WC_New_Id% to true. Note that in most circumstances, WC_Id_Next% is just a specialised form of WC_Browse_Next% loaded with a single value so the same effect could be achieved by setting WC_Browse_Next% to null and WC_New_Browse% to true.

(Volume 3, Issue 4, Page 14)

  • tips/revmedia/v3i4a7.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1