Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word Wrap a Memo Field
Message
 
À
10/09/2002 11:00:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00698752
Message ID:
00698916
Vues:
18
The MLINE solutin worked for me so I will take your advice and try a ALINES solution and check for speed difference.


>Hi Again,
>
>I just read in HackFox that Alines() is quicker than using Mline(). Also, mline will strip trailing blanks.
>
>Using the alines will give you more control over the parsing and being able to split at spaces.
>
>Mace
>
>>So what you are implying here is that the SET MEMOWIDTH will automatically limit MLINE to returning a word wrapped line that does not exceed 75, but can be less than 75 characters. Is that correct Sergey?
>>
>>>VFP can parse it for you.
SET MEMOWIDTH TO 75
>>>lcMemo = < text to format >
>>>lcNewMemo = ""
>>>_MLINE  = 0
>>>FOR i= 1 TO memlines(lcMemo)
>>>	lcNewMemo = lcNewMemo + MLINE(lcMemo,1,_MLINE) + CHR(13) + CHR(10)
>>>ENDFOR
>>>
>>>REPLACE mymemo WITH lcNewMemo
>>>* or if you don't want CRLF after the last line
>>>REPLACE mymemo WITH LEFT(lcNewMemo, LEN(lcNewMemo)-2)
>>>
>>>
>>>>I need some help on a best (quickest) way to break a memo field down. Here is the scenario:
>>>>
>>>>I have to read in a set of characters into a memo field.
>>>>Once they are in the memo field I need to break them every 75 characters with a Carriage Return Line Feed, but I don't want to break them on a word.
>>>>I want to back down until I get to a space and then put in the carriage return line feed.
>>>>
>>>>So does anyone have a code solution that would quickly do this as I am dealing with a large amount of data.
>>>>
>>>>TIA
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform