Help please: bs.ReadShort


I am getting an error from the code below, (2015 Release 2.2) I got it from WFS - Type “BinaryStream” has no member named “ReadShort”

// Now process each of the events that
// we've been given, based on the type of the event
Dim bs as new BinaryStream( records )
for i as Integer = 0 to eventsRead - 1
  // Read in a short for the event type
  Dim eventType as Integer = bs.ReadShort
  Const KEY_EVENT = &h1
  Const MOUSE_EVENT = &h2
  // Read another short, which was stupid padding
  call bs.ReadShort

How can I fix that?
I used bs.ReadUInt16 instead of bs.ReadShort and I did not get an error, is that the correct fix?



I believe a Short is signed, so bs.ReadInt16 might be better.

Edit: just re-read your post, and it shouldn’t matter which one you use.

Thanks Tim.

I am now facing this. …
me.z_readDirectory(recover, mergeDittoEntries, abort) // sets “errmsg”

with an error message
Message: Type “Binary stream” has no member named "ReadLong’
Code: readLong
(this error message comes in a dropdown)

I am of the opinion that readDirectory is the problem.

Any suggestions?



Use ReadInt32 as ReadLong was removed earlier this year.