PRB: VARREAD() and SYS(18) Do Not Work for BROWSE in Debug

Last reviewed: May 6, 1996
Article ID: Q115814
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.

MORE INFORMATION

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 6, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.