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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Messagebox message truncated 2

Status
Not open for further replies.

205xld

Programmer
Jul 26, 2003
22
0
0
GB
Hopefully an easy one for someone....
I'm reporting on some issues in a messagebox and the message is of variable length depending on circumstances. The sample I used was a 1700 char string. Unfortunately, the message is being truncated at around 1000 chars (haven't counted the exact number). The VFP help doesn't say there is a max message length (it says the box is resized to fit the message whatever the length). Anyone know what determines the limit and whether there's a way to change it (apart from the obvious solution of building my own messagebox class)? Thanks for any help you can give!
 
205XLD,

Straight from VFP help file:

eMessageText
Specifies the text that appears in the dialog box. You can also specify any valid Visual FoxPro function, object, or data type instead of eMessageText. The maximum amount of text you can specify is 1024 characters.

So, as I expected if you are losing them "Around 1000 characters" that 1024 was going to be the magic number. You're answer to your own question "Make your own message box" is probably the "right" answer. I'd suggest making it based on an auto-resizeable edit box, driven by a memo field as your control source, if possible.



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Just to avoid a reputation as a complete numbskull, I'd like to point out that VFP7 (which I'm using) Help only says:

"eMessageText
Specifies the text that appears in the dialog box. Use a carriage return (CHR(13)) in eMessageText to move a portion of the message to the next line in the dialog box. The height and width of the dialog box is increased as necessary to contain cMessageText."

and makes no mention of a max number of chars! Someone must have added it into later vesions of Help. Thanks for the suggestions for a class design by the way. I'll get on to it.

Regards

G
 

You're both right. The limit of 1024 characters was always present, but it wasn't documented before VFP 9.0.

G: If you decide to do your own MessageBox replacement, you might want to consider using a resizable read-only edit box to display the message. That way, you can make the text as long as you like, and the user can resize or scroll in whatever way is comfortable for them.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top