Hi Spencer! You're right, it's the value-statement in a edittext control. Even the statement "Alter Control 4004 Value SubjectData" doesn't work and cuts the string, too. I think this was the only possible work arround, other ideas? I can't imageine it isn't possible to fill an edittext-control with the context of a textfile (that's what i want to do).
By the way: everything seems to be ok if it is a statictext control in stead of en edittext. Do the MI-people read this list? Thank you Spencer! Martin -----Original Message----- From: Spencer Simpson [mailto:[EMAIL PROTECTED] Sent: Wed, 17 Sep 2003 10:18:38 -0400 To: [EMAIL PROTECTED] Subject: MI-L EditText controls (Was: MI-L string-variables with word wraps) It's not the string value's fault; it's the fault of the EditText control. It appears that if you attempt to set an EditText control's value to something with more than 39 carriage returns in it, it eats most of the string. I stuck the following code before Mr. Kofahl's dialog: dim i as smallint SubjectData = "1" for i = 2 to 41 SubjectData = SubjectData + chr$(13) + str$(i) next note len(SubjectData) The first time the dialog runs, the "note" statement correctly reports a length of 113. When the dialog appears, however, it contains only two carriage returns and a "41". The next "note" statement reports a length of 3. Eeven more bizarre, the EditText control *reads* the string value corectly. If you type in 1 through 41 separated by carriage returns, and click on "Next" and "go back", the "note" statement reports a length of 113. The problem appears to happen only when you set the value of an EditText control. Hope this helps Spencer -----Original Message----- From: Martin Kofahl [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 8:19 AM To: [EMAIL PROTECTED] Subject: MI-L string-variables with word wraps Hi List! The MB-reference says that a "string variable can contain a text string up to 32 kilobytes in length." However, if there're lots of line breaks in this variable, it will be cutted by Mapinfo. I'm running Mapinfo 7.0 release 26 and Mapbasic 6.5 release 19. Does anyone know about this behaviour and a work arround? Example code below. You may test it by entering some text in the editbox (eg. "1"<lienbreak>"2"<linebreak> and so on up to ~50), pressing "go" and "back" and - at least in my case - there're only the lines 41-50 left in the editbox. Thanks for your help! Martin Include "mapbasic.def" Define x*4 Define y*8 Global SubjectData As String Declare Sub Main Declare Sub Dialog2 Sub Main Dialog Title "Strings" Width 90x Height 25y Control StaticText Id 4003 Title "Enter String:" Position 1x,1y Control EditText Id 4004 Value SubjectData Into SubjectData Position 20x,1y Height 18.75y Width 69x Control OkButton Id 4098 Title "go >>" Position 78x,22y Width 10x If CommandInfo(CMD_INFO_DLG_OK) Then Call Dialog2 End If End Sub Sub Dialog2 Dialog Title "go back" Width 90x Height 25y Control OkButton Id 5098 Title "<< back" Position 78x,22y Width 10x If CommandInfo(CMD_INFO_DLG_OK) Then Call Main End If End Sub --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 8420
