Discussion:
Two questions
David Johnson
2007-02-08 04:47:27 UTC
Permalink
Well, I will ask these and hope for an answer before this list shuts
down. :-)

1. When I create a text file ("text/plain") using
textOutputStream1.WriteLine and then read it back, the EndOfLine
characters are detected correctly. But when I create a text file with
a word processor (like TextEdit) the carriage returns are *not*
detected as EndOfLine characters.
For example:

newarray = split(fileString, EndOfLine)
newarray = split(fileString, chr(13) )

Neither of these parse a text processor string into lines.

Is there something I can do to a string that will allow the CRs to be
seen as EndOfLine?


2. When a user of my appllication saves a document, almost all of the
data is text. But the user may have added one (or more) pictures to
the document. How do I save the picture with the text and recover it
when he opens the document later?

RB5.5 pro, OSX 10.3.9

Thanks.

As far as the new list is concerned, will the RB regulars (Joe Stout,
Geoff Perlmann, et. al.) be answering questions on the new list, or
will they be confined to monitoring the forum?

Thanks again,
David
RBNUBE
2007-02-08 05:56:36 UTC
Permalink
1)
Post by David Johnson
Is there something I can do to a string that will
allow the CRs to be seen as EndOfLine?
Try ReplaceLineEndings:
Dim s as String
s=ReplaceLineEndings(YourText, EndOfLine)

2.
Post by David Johnson
But the user may have added one (or more)
pictures to the document.
I wasn't aware that RB now supports embedded images. I'm still using
5.5.5...

If it still doesn't, you could save the images out with a similar name as
the document. For instance, Document1_Image_001.jpg, etc. Then load images
based on the document name. Of course this isn't fool proof...

3)
The new list is already history. RB has declared that they are going to
reactivate the NUG list, but they are still dropping this beginner list.

HTH
Norman Palardy
2007-02-08 05:55:47 UTC
Permalink
Post by David Johnson
Well, I will ask these and hope for an answer before this list
shuts down. :-)
Subscribe to the NUG as REAL has recanted and will NOT be shutting
that list down
Subscription pages should be back up tomorrow
Post by David Johnson
1. When I create a text file ("text/plain") using
textOutputStream1.WriteLine and then read it back, the EndOfLine
characters are detected correctly. But when I create a text file
with a word processor (like TextEdit) the carriage returns are
*not* detected as EndOfLine characters.
newarray = split(fileString, EndOfLine)
newarray = split(fileString, chr(13) )
Neither of these parse a text processor string into lines.
Is there something I can do to a string that will allow the CRs to
be seen as EndOfLine?
TextEdit uses Unix line ending which amounts to chr(10)
Post by David Johnson
2. When a user of my appllication saves a document, almost all of
the data is text. But the user may have added one (or more)
pictures to the document. How do I save the picture with the text
and recover it when he opens the document later?
If they are saving documents from TextEdit with pictures you'll be
dealing with RTFD documents
Post by David Johnson
RB5.5 pro, OSX 10.3.9
Thanks.
As far as the new list is concerned, will the RB regulars (Joe
Stout, Geoff Perlmann, et. al.) be answering questions on the new
list, or will they be confined to monitoring the forum?
Probably back to monitoring the old NUG list (see above)
Octave Julien
2007-02-08 09:57:17 UTC
Permalink
About EndOfLine :
Personaly, I use "EndOfLine.macintosh" in my code. Using the
EndOfLineType (Macintosh, Unix or Windows) might be helpful when
processing a text that comes from an app such as TextEdit.

Octave
Post by David Johnson
Well, I will ask these and hope for an answer before this list shuts
down. :-)
1. When I create a text file ("text/plain") using
textOutputStream1.WriteLine and then read it back, the EndOfLine
characters are detected correctly. But when I create a text file with
a word processor (like TextEdit) the carriage returns are *not*
detected as EndOfLine characters.
newarray = split(fileString, EndOfLine)
newarray = split(fileString, chr(13) )
Neither of these parse a text processor string into lines.
Is there something I can do to a string that will allow the CRs to be
seen as EndOfLine?
2. When a user of my appllication saves a document, almost all of the
data is text. But the user may have added one (or more) pictures to
the document. How do I save the picture with the text and recover it
when he opens the document later?
RB5.5 pro, OSX 10.3.9
Thanks.
As far as the new list is concerned, will the RB regulars (Joe Stout,
Geoff Perlmann, et. al.) be answering questions on the new list, or
will they be confined to monitoring the forum?
Thanks again,
David
Continue reading on narkive:
Loading...