Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Wrap a Memo Field
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00698752
Message ID:
00698812
Views:
21
This message has been marked as a message which has helped to the initial question of the thread.
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform