Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi-line Messagebox

Status
Not open for further replies.

Aseem1234

Programmer
Nov 26, 2003
33
0
0
US
How does one go about creating a multi-line messagebox in Foxpro 8. I cannot figure it out even with the escape characters. Is there another way?

Thanks
 
If you mean VFP's "standard" messagebox()

Here is one working example:

Code:
cMessageTitle = 'Error'
mcMsg1 = " Phone No: " + mcPhoneNo + " Not Found! "
mnLenMsg1 = LEN(mcMsg1)
mcMsg2 = PADC(" For Date: " + mcDate,mnLenMsg1)
cMessageText = mcMsg1;
      + CHR(13);
      + mcMsg2
nDialogType = 0 + 48 + 0
   *  0 = OK Button Only
   *  48 = Exclamation mark icon
   *  0 = First button is default

nAnswer = MESSAGEBOX(cMessageText, nDialogType, cMessageTitle)

Good Luck,
JRB-Bldr
 
Just add a CRLF (chr(13)+chr(10) at the end of each line. I believe you can go to about 20 lines!
Code:
Messagebox("Line 1"+chr(13)+chr(10)+ ;
           "Line 2"+chr(13)+chr(10)+ ;
           "Line 3"+chr(13)+chr(10)+ ;
           "Line 4"+chr(13)+chr(10)+ ;
           "Line 5"+chr(13)+chr(10), 0, "Multiline Message")
Rick
 
Hello Aseem1234.

If you are using VFP 7 or later, you can use the TEXTMERGE() function to do this like so:

Code:
TEXT TO lcMsg TEXTMERGE NOSHOW
  This is a test for a multi-line display
  in a messagebox. You can even EVALUATE
  items in the message at runtime using
  TEXTMERGE() like this:
  <<VERSION(1)>>
ENDTEXT
MESSAGEBOX( lcMsg )

Marcia G. Akins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top