binarystreams in r2

Looks like 2015r2 doesn’t like the old binarystream-methods .read/write/short/long anymore. Why is there no mention of this in the release notes?
I’d like to see a complete list of replacements for each command.

Thanks.

They’re still there. Are you getting complie errors?

Yes. Don’t you?

No. I spent a good chunk of last night working with BinaryStreams and didn’t run into compile errors.

Are you mixing old and new framework code in the same method? Perhaps the compiler thinks you are looking for a Xojo.io.BinaryStream?

Nope, I am not using the new framework at all in that project.

The code:

SomeBinaryStream.WriteLong SomeInteger

doesn’t compile: Type “BinaryStream” has no member named “writelong”
Autocomplete reveals I have a choice between various write-variants (writeInt8,writeunint8 and the likes). I am uncertain which one to pick.

This code:

dim bs as BinaryStream
dim i as integer
bs.WriteShort i

compiles with r1, but not with r2.

Those were deprecated in 2006 (ReadByte, ReadLong, etc)
They have finally been removed

That’s alright with me, but still deserves a mention in the release notes. I have lots of legacy code still using all of those methods. I’d be happy if I just knew how the old commands map to the current ones.

WriteShort should be the same as WriteInt32 and WriteLong as WriteInt64.

No. WriteShort is WriteInt16 and WriteLong is WriteInt32.

Me too. Multiple errors like Maximilian.

Looks like this is case 29166 which I’m not sure why it isn’t in the release notes

Two solutions:

  • Do a global search and replace.
  • Create extension methods that restore those functions in your project.

Personally, I’d do the former.

They were deprecated nearly 10 years ago :slight_smile:

I also received the errors in projects where I am using ReadLong. I looked up the Language Reference and replaced ReadLong with ReadInt32 and my problems where gone. Do not miss ReadLong.

You really wont when 64 bit hits :stuck_out_tongue:

I had to change three lines ReadLong -> ReadUInt32 or ReadShort -> ReadUInt16. Not a big deal but it would have been nice to see it in the Release Notes, especially for those of us who don’t get to spend as much time on the forum or working with XOJO,

This might be better in a separate thread but now my app compiles clean but won’t run. It briefly flashes an error popup but I can’t tell what error is occurring. Is there a way to log the error? I did run Analyze Project and noticed several deprecated items. Would that maybe cause the program to stop running? I hadn’t noticed the deprecated items in a previous XOJO release as my app runs fine on 2015R1.

A is said previously it should have been in the notes but wasn’t

Sounds like this bug in the IDE feedback://showreport?report_id=38979
I’d check your project & see what, if any items that reveals

I’m up and running again. I am using a 3rd party zip package and after updating it all is well.

what about replacing “readByte” ?