Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lose small sqaure at end of text file
Message
De
14/05/2009 01:51:45
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01399805
Message ID:
01399809
Vues:
86
>Anyone know how to get rid of the small square that appears at the end of each and every text file?
>
>k
>
>set alte to sample.txt
>set alte on
>? "this is a sample of the text."
>close alte
>
>modi file sample.txt
>voila:
>
>This is a sample of the text
* You can use Asc() to determine the unknown byte: 
? ASC(RIGHT(FILETOSTR('sample.txt'),1)) && says 26
* so you can use StrTran() or ChrTran() together with FileToStr/StrToFile() to get rid of the Chr(26)
? ASC(RIGHT(STRTRAN(FILETOSTR('sample.txt'),CHR(26)),1))

* Or use Text/EndText instead of Set Alternate:
Local lcContent
TEXT TO lcContent NOSHOW
this is a sample of the text.
ENDTEXT
STRTOFILE(m.lcContent,'sample2.txt')
? ASC(RIGHT(FILETOSTR('sample2.txt'),1))
hth
-Stefan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform