Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove carriage returns in memos
Message
De
13/06/2001 06:07:49
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
12/06/2001 08:08:01
Denis Filer
University of Oxford
Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00518280
Message ID:
00518760
Vues:
23
>Is there an obvious way to remove trailing carriage returns at the end of memo field - nasty in reports that display alltrimed memos. I have tried a substr() command replacing chr(13) with "" but this not working. Thank you in advance if someone knows the best way.

Denis,
You already have good suggestions. I'd like to add my .2 cents. Linefeeds in a memo are not just chr(13) but chr(13)+chr(10) (in rare circumstances any combination might occur). Also besides trailing, multiple linefeeds between paragraphs were a problem for me too. Worst these characters are not trimmable and 'T' formatting has no effect.
lcMemo = chrtran(myMemo,chr(13)+chr(10),chr(10)) && CRLF to LF
do while occurs(chr(10)+chr(10),lcMemo)>0 && While multipl LF exists
  lcMemo = strtran(lcMemo,chr(10)+chr(10),chr(10)) && Half the LFs
enddo
lcMemo = left(lcMemo,len(lcMemo)-iif(right(lcMemo,1)=chr(10),1,0))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform