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_Id_Next%

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


0001     WC_ID_NEXT% = NEXT_REC_ID
0002     WC_NEW_ID% = TRUE$
0003     IF WC_START% THEN
0004        WC_WI_NEXT% = WC_START%
0005     END ELSE
0006        WC_WI_NEXT% = WC_KEY_CNT% + 1
0007     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)
Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel