Binary Writing

For questions about using Classic.

Post » Wed Jun 24, 2009 10:32 pm

Hi. I'm having trouble with writing files with the binary object. I've looked on the wiki and here and didn't find the answer.

It seems when I write to a file, it keeps appending to the end of the file. I set the binary cursor to 0 and even tried deleteing the file so it always creates a new one, but it looks like it just pastes what was previously in the file.

My code looks something like this:
Binary: Set cursor to 0
Binary: Write string (Text feild object)
Binary: Write integer (Text Box) //This is repeated for a few different text boxes
Binary: save to file (Dialog.firstselectedfile)


Thanks!
B
5
S
1
G
3
Posts: 9
Reputation: 1,108

Post » Thu Jun 25, 2009 5:55 pm

Posting a cap would be helpful when you ask for help that way we can better help you.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Tue Jul 07, 2009 11:53 am

A late reply; setting the cursor during writing has no effect, it's only for reading.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Tue Jul 07, 2009 12:35 pm

[quote="Rich":kti5gf56]A late reply; setting the cursor during writing has no effect, it's only for reading.[/quote:kti5gf56]
Interesting, but is there a reason why it's appending the data to the end of his file?
My first thoughts were to delete the file and create a new one with the new data, but I see that he's already done that, and the old data that was in the deleted file is still written to the new file before the new data is written.

Sounds like a bug to me.

Sponge.
B
2
S
1
G
3
Posts: 105
Reputation: 1,310

Post » Tue Jul 07, 2009 4:51 pm

If you use write actions, then save, the written data's still in the object. Perhaps a 'clear' action is needed.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests