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

-- 
+++ GMX - die erste Adresse f�r Mail, Message, More! +++

Getestet von Stiftung Warentest: GMX FreeMail (GUT), GMX ProMail (GUT) (Heft
9/03 - 23 e-mail-Tarife: 6 gut, 12 befriedigend, 5 ausreichend)

Jetzt selbst kostenlos testen: http://www.gmx.net


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To
unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 8412



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 8414

Reply via email to