I may not understand the scope of your question, but could you use the swap function?
http://www.freepascal.org/docs-html/rtl/system/swap.html Like so (edited in email, not compile checked): function ReadMWord(AStream: TStream): Word; var MW: Word begin AStream.Read(MW, SizeOf(Word)); Result := Swap(MW); end; On Mon, Feb 4, 2013 at 9:13 AM, silvioprog <silviop...@gmail.com> wrote: > 2013/2/4 silvioprog <silviop...@gmail.com> > >> 2013/2/4 leledumbo <leledumbo_c...@yahoo.co.id> >> >>> > ps. I tried the Unpack function of FPC, but I don't know how to use it. >>> >>> Unpack() is for unpacking previously Pack()-ed data >>> >> >> So, I'm trying to improve the PowerPDF to support PNG images, but I dont >> know how to convert ASCII to Integer. >> > > Solved: > > function ReadMWord(AStream: TStream): Word; > type > TMotorolaWord = record > case Byte of > 0: (Value: Word); > 1: (Byte1, Byte2: Byte); > end; > var > MW: TMotorolaWord; > begin > AStream.Read(MW.Byte2, SizeOf(Byte)); > AStream.Read(MW.Byte1, SizeOf(Byte)); > Result := MW.Value; > end; > > :) > > -- > Silvio Clécio > My public projects - github.com/silvioprog > > -- > _______________________________________________ > Lazarus mailing list > Lazarus@lists.lazarus.freepascal.org > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > >
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus