FIX: TYPE() Function Returns Wrong Value for Appended Records

Last reviewed: October 29, 1997
Article ID: Q167406
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b
  • Microsoft Visual FoxPro for Macintosh, version 3.0b

SYMPTOMS

The TYPE() function returns the wrong current value for appended records in a buffered table. The TYPE() function returns "L" for logical type for all field types in the table. This behavior occurs regardless of the type of data buffering applied to the table.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Microsoft Visual FoxPro version 5.0 for Windows.

MORE INFORMATION

The following program creates a table, set the data buffering property to optimistic table buffering, and appends a blank record. Then a comparison displays the difference between the field types of the new record and the original table structure.

Steps to Reproduce Behavior

  1. Create a program that contains the following code:

          CLEAR
          CLOSE DATA ALL
          SET MULTILOCKS ON
          CREATE TABLE TheTable (;
    
            Char       C(40),;
            Date       D,;
            DateTime   T,;
            Numeric    N(20,9),;
            Double     B(9),;
            Currency   Y,;
            Logical    L,;
            Memo       M,;
            General    G,;
            Picture    P)
    
          ? "CURSORSETPROP('Buffer', 5)"
          = CURSORSETPROP('Buffer', 5)
          APPEND BLANK
          ? [TYPE("CURVAL('Char')") =], TYPE("CURVAL('Char')")
          ? [TYPE("OLDVAL('Char')") =], TYPE("OLDVAL('Char')")
          ? [TYPE("CURVAL('Date')") =], TYPE("CURVAL('Date')")
          ? [TYPE("OLDVAL('Date')") =], TYPE("OLDVAL('Date')")
          ? [TYPE("CURVAL('DateTime')") =], TYPE("CURVAL('DateTime')")
          ? [TYPE("OLDVAL('DateTime')") =], TYPE("OLDVAL('DateTime')")
          ? [TYPE("CURVAL('Numeric')") =], TYPE("CURVAL('Numeric')")
          ? [TYPE("OLDVAL('Numeric')") =], TYPE("OLDVAL('Numeric')")
          ? [TYPE("CURVAL('Double')") =], TYPE("CURVAL('Double')")
          ? [TYPE("OLDVAL('Double')") =], TYPE("OLDVAL('Double')")
          ? [TYPE("CURVAL('Currency')") =], TYPE("CURVAL('Currency')")
          ? [TYPE("OLDVAL('Currency')") =], TYPE("OLDVAL('Currency')")
          ? [TYPE("CURVAL('Logical')") =], TYPE("CURVAL('Logical')")
          ? [TYPE("OLDVAL('Logical')") =], TYPE("OLDVAL('Logical')")
          ? [TYPE("CURVAL('Memo')") =], TYPE("CURVAL('Memo')")
          ? [TYPE("OLDVAL('Memo')") =], TYPE("OLDVAL('Memo')")
          ? [TYPE("CURVAL('General')") =], TYPE("CURVAL('General')")
          ? [TYPE("OLDVAL('General')") =], TYPE("OLDVAL('General')")
          ? [TYPE("CURVAL('Picture')") =], TYPE("CURVAL('Picture')")
          ? [TYPE("OLDVAL('Picture')") =], TYPE("OLDVAL('Picture')")
          = TABLEREVERT(.T.)
          CLOSE DATA ALL
          DELETE FILE TheTable.DBF
          DELETE FILE TheTable.FPT
          SET MULTILOCKS OFF
    
    

  2. Run the program.

  3. Notice the current value of every field appears as a type logical (L). The TYPE() function reports the data type of each field in the newly appended record as a logical type. However, TYPE() reports the original field type correctly.
Keywords          : buglist3.00 buglist3.00b FxprgTable vfoxwin kbcode kbbuglist kbfixlist
Version           : 3.0 3.0b
Platform          : MACINTOSH WINDOWS
Issue type        : kbbug
Solution Type     : kbfix


================================================================================


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: October 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.