Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Another silly question abuot TFileStream

se_arese_are Member Posts: 11
Hello to everyone,
Sorry to bother you again, but I've encountered another little problem (Hopefuly the last one).

I'm trying to use a TFileStream component to print two parentesis, like this:

(
)

Then, in a second time, I Would like to write in the middle of the two parenthesis, like this:

(
A really long text)

I've tried by using the Seek method, but I think that it overwrites the closed parenthesis or that I've been using it in a wrong way.
Thank you for the time given to this post, good afternoon.

Comments

  • zibadianzibadian Member Posts: 6,349
    : Hello to everyone,
    : Sorry to bother you again, but I've encountered another little problem (Hopefuly the last one).
    :
    : I'm trying to use a TFileStream component to print two parentesis, like this:
    :
    : (
    : )
    :
    : Then, in a second time, I Would like to write in the middle of the two parenthesis, like this:
    :
    : (
    : A really long text)
    :
    : I've tried by using the Seek method, but I think that it overwrites the closed parenthesis or that I've been using it in a wrong way.
    : Thank you for the time given to this post, good afternoon.
    :
    The TStream object doesn't have an Insert() method. The Write() method will overwrite any existing data at that position. The best way to handle this is to read the closing parenthesis and everything after it in a buffer. Then go back to that position, write your really long text, and then write the stored buffer (i.e. closing parenthesis) again.
Sign In or Register to comment.