Domanda

I am using binary readers and writers to read / write data to a file. For example for this:

MyWriter.Write(Ord(TMyEnum(2)));

I would expect it to write down SmallInt to be read with

MyReader.ReadSmallInt

But in IDE I see it writes down byte. How do I force the writer to write the type that I want?

È stato utile?

Soluzione

Cast it to Smallint

Smallint(SomeEnum)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top