Microsoft KB Archive/115814

{| = PRB: VARREAD and SYS(18) Do Not Work for BROWSE in Debug =
 * width="100%"|

ID: Q115814

2.50 2.50a 2.50b | 2.00 2.50 2.50a 2.50b | 2.50b

WINDOWS         | MS-DOS                | MACINTOSH kbprg kbprb The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b
 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, 2.5b
 * Microsoft FoxPro for Macintosh, version 2.5b

SYMPTOMS
The FoxPro documentation states that:

If a Browse, Change or Edit window is active, the name of  the current field is returned with the first letter of the field name capitalized.

VARREAD is identical to SYS(18). Both can be used to  pass the current field or control name to a procedure.... When you work with GET objects, issuing VARREAD or SYS(18) in the left side of the Debug window displays the name of the current field. However, in a browse, VARREAD and SYS(18) are not updated in the Debug window as you move from one field to the next.

CAUSE
As the documentation states, VARREAD and SYS(18) pass the current field's name to a procedure. Moving from field to field in the Browse window does not execute a procedure that would return the value in VARREAD or SYS(18) to the Debug window.

Steps to Reproduce Behavior
As the documentation states, both VARREAD and SYS(18) return the name of the current field in a Browse. The following steps demonstrate this behavior.

1. Assuming you have installed the tutorial files and that your main FoxPro

directory is called C:\FOXPRO, issue the following commands in the Command window:

ON KEY LABEL F8 WAIT WINDOW VARREAD USE c:\foxpro\tutorial\customer BROWSE FIELDS cno, company, ytdpurch 2. Move from field to field and press the F8 key to see the value returned by VARREAD. (You can substitute SYS(18) for VARREAD since they are  the same.) 3. Activate the Debug window by issuing the following command in the Command window:

ACTIVATE WINDOW DEBUG

In the left side of the Debug window, type "VARREAD" (without the  quotation marks) and press the ENTER key. Below VARREAD, type "SYS(18)" (without the quotation marks) and press the ENTER key. 4. Go back to the Browse window and move from field to field. No return values are displayed in the right side of the Debug window. 5. As you move from field to field in the Browse window, press the F8 key. The WAIT window will display the current field's name. Simultaneously, you will see the current field's name appear in the right side of the Debug window. The field's name is displayed in this case because WAIT WINDOW is a procedure that is executed when you press the F8 key. The value returned by VARREAD and SYS(18) is passed to the procedure and made available to the Debug window. Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b KBCategory: kbprg kbprb KBSubcategory: FxtoolDebug

Keywords         : FxtoolDebug Version          : 2.50 2.50a 2.50b | 2.00 2.50 2.5 Platform         : MACINTOSH MS-DOS WINDOWS
 * }