Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Way to limit width of messagebox?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01314437
Message ID:
01314441
Views:
14
This message has been marked as the solution to the initial question of the thread.
>Is there any way to limit the width of a messagebox? In other words, if I pass a rather long message as the message text, rather than the messagebox stretching out the width of my screen, I'd like it to display only about 70 characters per line and do wordwrap on anything longer.
>
>Is there any kind of function or routine that will take a string and add the chr(10) + chr(13) at the right places to give you a "text-wrapped" string to pass to Messagebox()?
lcText = "Is there any way to limit the width of a messagebox? " + ;
			"In other words, if I pass a rather long message as the message text, " + ;
			"rather than the messagebox stretching out the width of my screen, " + ;
			"I'd like it to display only about 70 characters per line and do wordwrap on anything longer."

lnMemowith = SET("Memowidth")
SET MEMOWIDTH TO 70
lcNewText = ""
FOR i=1 TO MEMLINES(lcText)
	lcNewtext = lcNewText + MLINE(lcText,i) + CHR(13)
ENDFOR
lcNewtext = LEFT(lcNewtext, LEN(lcNewtext )-1)
SET MEMOWIDTH TO (lnMemowith)
MESSAGEBOX(lcNewtext )
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform