Microsoft KB Archive/167406

= FIX: TYPE Function Returns Wrong Value for Appended Records =

Article ID: 167406

Article Last Modified on 10/15/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 3.0b for Macintosh

-



This article was previously published under Q167406



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
  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  Run the program. 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: kbbug kbfix kbcode KB167406

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.