Microsoft KB Archive/141145

= PRB: APPEND FROM to Logical Field Loads Literal t or y Values =

Article ID: 141145

Article Last Modified on 12/11/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q141145



SYMPTOMS
Using the the following command saves literal "t" and "y" values as false in a logical field: APPEND FROM TYPE DELIMITED



CAUSE
The APPEND FROM command does not recognize lowercase "t" or "y" as valid logical values.



RESOLUTION
Change the table structure of the logical field to a character field. After appending the records to the table, change the structure of the character field back to a logical field.



STATUS
This behavior is by design.



Steps to Reproduce & Resolve Behavior
The following program converts all the logical fields in a table to character fields. Records are appended to the table from a text file. All of the records in character field are converted to uppercase and switched back to logical field type.

 Create a new text file called Mytext.txt. There should be no spaces, tabs, or periods on each line. Type the following exactly as shown:

T

F

t

f

Y

y

N

n

  Open a program file and type the following lines of code into it: CREATE TABLE TABLE1 (FIELD1 L)  DIMENSION laMyarray(fcount) laMyarray=.F.  FOR lnI = 1 TO FCOUNT IF TYPE(FIELD(lnI)) = "L" laMyarray(lnI)=.T.        lcFld=FIELD(lnI) ALTER TABLE TABLE1 ALTER COLUMN &lcFld c(1) ENDIF ENDFOR APPEND FROM mytext.txt TYPE DELIMITED FOR lnI=1 to FCOUNT IF laMyarray(lnI) lcFld=FIELD(lnI) REPLACE ALL &lcFld WITH UPPER(&lcFld) ALTER TABLE TABLE1 ALTER COLUMN &lcFld L     ENDIF ENDFOR  Save and close the program.  In the Command window, type: DO  BROWSE Notice that the logical fields now correctly display T or F. </ol>

Additional query words: VFoxWin

Keywords: kbcode KB141145

-

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

© Microsoft Corporation. All rights reserved.