This may be a case where the built-in control is a little too smart...
I want to display raw data in an EditField, and sometimes that data might
contain a CR/LF combination. Unfortunately, in those cases, RB replaces that
combo with just a single CR (on a Mac), so this is what I did: I split the
string by LF, then used fld.AppendText to enter the string in chunks, each
followed by a LF until the last chunk. Was there an easier way?
if txt.Contains( crlf ) then
dim arr( -1 ) as string = split( txt, lf )
dim lastIndex as Int32 = arr.Ubound - 1
for index as Int32 = 0 to lastIndex
fld.AppendText arr( index )
fld.AppendText lf
next index
fld.AppendText arr( arr.Ubound )
else // no crlf in txt
fld.Text = txt
end if
__________________________________________________________________________
Kem Tekinay (212) 201-1465
MacTechnologies Consulting Fax (914) 242-7294
http://www.mactechnologies.com Pager (917) 491-5546
To join the MacTechnologies Consulting mailing list, send an e-mail to:
mactechnologies_consulting-subscribe@yahoogroups.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|