TYPE() Returns "N" for Double, Float, and IntegerLast reviewed: April 30, 1996Article ID: Q130350 |
The information in this article applies to:
SUMMARYIn Visual FoxPro for Windows, a field may be given the TYPE B for Double, and F for Float, but the TYPE() function always returns "N" (Numeric) for Double, Float, and Integer data types.
MORE INFORMATION
Sample CodeThe following code demonstrates this:
***TYPETEST.PRG*** CLEAR CREATE CURSOR SYS(2015) (bField B(6),fField F(16,8),yField Y) INSERT INTO (ALIAS()) VALUES (111.111, 222.222, 333.333) ? "The types are: Created Double="+TYPE("bField")+", Created Float="; + TYPE("fField")+", Created Currency="+ TYPE("yField")Here is the result:
"The types are: Created Double=N, Created Float=N, Created Currency=Y"Why Numeric Is Always Returned The Float type is included for compatibility only. It is functionally equivalent to Numeric. The Double type is relevant only in a table, denoting how the field data is stored to disk. All Float types are stored internally as Doubles, converted to ASCII when written to disk, and then converted back when read. This can result in a loss of accuracy, so a Double type field is stored as an 8-byte binary value to avoid inaccuracies.
|
Additional reference words: 3.00 VFoxWin character
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |