Re: [Lazarus] Unpack of PHP

2013-02-10 Thread silvioprog
2013/2/6 Marco van de Voort mar...@stack.nl [...] That's so boring! In FPC 2.7.1 this should work: uses Classes, SysUtils, StreamEx; var VFile: TFileStream; begin VFile := TFileStream.Create('data.ascii', fmOpenRead or fmShareDenyWrite); try VFile.Seek(2,

Re: [Lazarus] Unpack of PHP

2013-02-06 Thread Marco van de Voort
On Mon, Feb 04, 2013 at 03:29:54PM -0200, silvioprog wrote: Oops... And this is the full code: program project1; {$mode objfpc}{$H+} uses Classes, SysUtils; function ReadInt(AStream: TStream): Word; begin Result := 0; AStream.Read(Result, SizeOf(Word));

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread ik
On Mon, Feb 4, 2013 at 1:34 PM, silvioprog silviop...@gmail.com wrote: Hello, In FPC, I'm trying to load a ASCII content and onvert it to integer, but, without success. In PHP I do it easily. I send two files in attached: 1. php - demo in PHP working fine (the demo uses unpack function:

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread leledumbo
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 -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Unpack-of-PHP-tp4029070p4029074.html Sent from the Free Pascal - Lazarus

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread silvioprog
2013/2/4 ik ido...@gmail.com On Mon, Feb 4, 2013 at 1:34 PM, silvioprog silviop...@gmail.com wrote: Hello, In FPC, I'm trying to load a ASCII content and onvert it to integer, but, without success. In PHP I do it easily. I send two files in attached: 1. php - demo in PHP working

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread silvioprog
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. --

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread silvioprog
2013/2/4 silvioprog silviop...@gmail.com ... but I dont know how to convert ASCII to Integer. ... to convert ASCII pack to Integer. -- Silvio Clécio My public projects - github.com/silvioprog -- ___ Lazarus mailing list

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread silvioprog
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

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread David Knaack
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,

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread silvioprog
2013/2/4 David Knaack davidkna...@gmail.com 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

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread Vincent Snijders
2013/2/4 silvioprog silviop...@gmail.com: 2013/2/4 David Knaack davidkna...@gmail.com 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

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread silvioprog
2013/2/4 Vincent Snijders vincent.snijd...@gmail.com 2013/2/4 silvioprog silviop...@gmail.com: 2013/2/4 David Knaack davidkna...@gmail.com 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

Re: [Lazarus] Unpack of PHP

2013-02-04 Thread silvioprog
2013/2/4 silvioprog silviop...@gmail.com 2013/2/4 Vincent Snijders vincent.snijd...@gmail.com 2013/2/4 silvioprog silviop...@gmail.com: 2013/2/4 David Knaack davidkna...@gmail.com I may not understand the scope of your question, but could you use the swap function?