PRB: TYPE Function Does Not Indicate Character(Binary)Last reviewed: October 29, 1996Article ID: Q157194 |
The information in this article applies to:
SYMPTOMSThe TYPE() function does not differentiate between Character and Character(binary) or Memo and Memo(binary) field types. The Type() function simply returns a "C" or an "M," respectively.
WORKAROUNDUse the AFIELDS() function to create an array that contains information on each field in the table. The procedure listed below, bin_fld, contains code that determines whether a character or memo field is binary. Before executing this code, issue the CREATE TABLE syntax provided in step 1 of the "Steps To Reproduce Behavior" section below.
The AFIELDS() function creates an array with specific information on each field in a chosen table. For example, the sixth element of the array created by the AFIELDS() function shows whether code page translation is allowed. This field contain a true (.T.) or false (.F.) value. If this element contains a true value in a Character or Memo field type, the field is binary. The TYPE() command handles any other field types. Entry of a nonexistent field name produces a "U," indicating undefined.
STATUSThis behavior is by design.
MORE INFORMATIONCharacter(Binary) or Memo (Binary) are not separate data types, as are Date, Currency, or Numeric types. The Binary versions of these fields prevent the field from conversion into another code page. The NOCPTRANS clause on the CREATE TABLE or ALTER TABLE commands creates a binary Character or Memo field. This clause prevents a Character or Memo field from being translated into another code page. Since the NOCPTRANS clause works only on character or memo fields, these are the only field types in Visual FoxPro that can be either binary or non-binary. Some fields, however, are binary by design, such as Integer and General types. Therefore, the TYPE() function provides adequate information.
Steps to Reproduce Behavior
|
KBCategory: kbprg kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |