Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting text using low level techniques
Message
De
11/11/1998 12:21:37
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00156635
Message ID:
00156642
Vues:
29
>Hello All,
>does anyone know how to insert text at a specified point using Fopen, Fread etc?
>
>e.g.
>line1
>line2
>line3
>line4
>
>I want to insert newline line in between line2 and line3
>
>end result
>line1
>line2
>newline
>line3
>line4
>
>Thanks
>Pete Kane
nFilehnd=fopen("d:\vfp5test\file1.txt")
nNewfilehnd=fcreate("d:\vfp5test\file2.txt")
do while not feof(nFilehnd)
 cLine=fgets(nFilehnd)
 =fputs(nNewfilehnd,cLine)
 if cLine=="line2"
  =fputs(nNewfilehnd,"newline")
 endif
enddo
=fclose(nFilehnd)
=fclose(nNewfilehnd)
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform