Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Equiv. to COBOL Redefine
Message
De
09/03/1998 10:18:27
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00083230
Message ID:
00083387
Vues:
31
>>>In order to communicate with Sterling Commerce EDI products I need to create a flat file that contains multiple record types. In COBOL I did this with a master record then an infinite number of REDEFINEs for that record for each record type. How does one do this in VFP?
>>>
>>>Regards/yb
>>
>>
>>You need to write things out to an ASCII file. Look at the low level file functions (FCREATE, FWRITE, etc.)
>
>Thanks for the prompt response.
>
>I could create multiple cursors for the record types, but neither fwrite or fputs take the cursor as an arguement:
>
>For Example
>
>create cursor rectyp1 (field1 c(10), field2 n(2,1)...)
>...
>
>nfid=fcreate("temp.tmp")
>
>=fputs(nfid,rectyp1)
>
>...

Of course not, but you could write a routine which does

Do FputCurs with "alias_of_the_cursor"

and

Proc FputCurs
Para CursAlias
Select (CursAlias)
Local n, i, tmp[1]
n=afields(tmp)
for i=1 to n
=fputs(nfid, eval(tmp[i]))
endf

This function will write all of your fields, one by one, into the ascii file, provided they are all strings. Otherwise, you'd better write a routine for each of the cursors, or provide some kind of All2String function to convert values you'll fPuts().

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform