Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending dilemma
Message
 
À
25/10/1999 14:37:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00281093
Message ID:
00281151
Vues:
15
>Huh? I don't follow......
I am not real familiar with some of the commands but in just executing there are errors:
In lines 2-4 'variable not found'
and the last line gives a syntax error.


>>Ok, trying it but should the nFH's line 2-3 be changed to something declared?
>>>OK, Tim....DIME aFH(3),aIsData(3),cData(3)
>>>nFH(1)=FOPEN("a.txt")
>>>nFH(2)=FOPEN("b.txt")
>>>nFH(3)=FOPEN("c.txt")
>>>STORE .T. TO aIsData
>>>STORE "" TO cData
>>>USE mydbf
>>>DO WHILE aIsData(1) AND aIsData(2) AND aIsData(3)
>>> FOR i = 1 TO 3
>>> cData(i)=""
>>> IF !FEOF(aFH(i))
>>> cData(i)=FGETS(aFH(i))
>>> ELSE
>>> aIsData(i)=.F.
>>> ENDIF
>>> ENDFOR
>>> INSERT INTO mydbf (a,b,c) VALUES (cData(1),cData(2),cData(3)

>>>
>>>How about this:
>>>>>>ENDDO
>>>
>>>
>>>>John, the lengths are 6,8,6 chars respectively. no releation exists between the three.
>>>>
>>>>
>>>>>Are a.txt, b.txt, and c.txt of the same record length? Is there a 1-to-1-to-1 correlation between the 3?
>>>>>
>>>>>If so, you could always use FOPEN() to open all three and then loop until FEOF(). Use FGETS to get a line from each of the three into vars, APPEND BLANK (or INSERT INTO) for the table and then get the vars into the table.
>>>>>
>>>>>
>>>>>>I ran out of ideas for accomplishing the following:
>>>>>>I have an empty dbf with fields a,b,c and I have 3 txt files a.txt, b.txt,c.txt to be appended using sdf. I want a,b,c to be populated from top down with no blanks.Instead, by nature, new records keep getting appended leaving fields c & d blank to start.
>>>>>>hmmmmm.
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform