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

Error: String too long to fit (in edit box)

Status
Not open for further replies.

DaveInKansas

Programmer
Oct 20, 2000
1
US
Ok, I've searched previous threads and don't find this one. Let's say you create a memory variable, then load the contents of a memo field with a huge amount of text into the variable. (There is virtually no limit to the width of a memory variable). If I echo the contents of the memory variable to the screen using "?MVar", I see all the text. Now, when I run my application, I load up a declared memory variable, then use the variable as the control source for an edit box, rather than binding it directly to the memo field. This way, if the user edits the text and messes something up like deleting some text, and then clicks on another object on the form before leaving the form, I can ask the user if they want to save changes or abandon them... I very helpful feature. This works with text boxes containing dates, numerics, characters, logicals... but when the memo contains more than 255 characters, I get the error code "String too long to fit". I've got someone at Microsoft tech support working this, but the guy has never run into it before. Any ideas?

Dave
[sig][/sig]
 
How long is your text string? I get error you mentioned when no enough memory to fit variable in memory. My limit with default settings of VFP was about 15MB text. Howver, when I put 15MB text into editbox, nothing bad happens. More, when I copy text, go to end of edit box, paste text (now size of text is double - 30MB!), no error! However, performanse reduced significantly, probably because memory swapping to disk.
Finally, which version of VFP you use?
[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br><a href= Serve</a><br>The professional level of programmer could be determined by level of stupidity of his/her bugs[/sig]
 
When I have to edit a large memo field I export the field to as text file and then call a text editor to modify it. This adds spell check, Search and replace feature etc, that the text box can not give you. When the user saves the file I confirm the changes and then repace the memo field with the text file.
[sig]<p>David W. Grewe<br><a href=mailto:Dave@internationalbid.com>Dave@internationalbid.com</a><br>ICQ VFP ActiveList #46145644[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top