[fpc-pascal] how can i search the archive of this email list?

2013-02-16 Thread Dennis Poon
I know I can download the archived zip files but can I search it? Is there any web site where I can search the archive? Searching on google never return anything from this elist but I was told most supports happen on this list. Many thanks. Dennis _

[fpc-pascal] Xcode 4.6 Objective pascal template does not work

2013-02-16 Thread Dennis Poon
As told by the objectivepascal web site, I download and installed the template http://dl.dropbox.com/u/28343282/ObjP/Xcode_Templates.html however, when I compiled an IOS project, it stuck at the unit not found iPhoneAll.pas I tried to give it a full path by changing it to: uses iPhoneAll i

[fpc-pascal] newbie question on LazDaemon

2013-05-07 Thread Dennis Poon
I learned from the free pascal wiki and installed the LazDaemon package. I 'new' a project as a Daemon (Service) application. However, when I compile it, it has many (dozens of) warnings e.g. undefined reference to 'WSRegisterCustomPage', 'WSregisterCustomNotebook', 'WSRegisterCustomIamgeList'

[fpc-pascal] Lnet problem. In console mode, cannot have 2 listening socket

2013-05-10 Thread Dennis Poon
I use the console example lserver.pp in LNet and it works fine that way. However, when I modified it to have 2 listening socket (TLTCP) listen one after another , and in the run loop, repeat socket1.CallAction; socket2.CallAction; until Quit1 or Quit2; Only the first socket that

Re: [fpc-pascal] How to handle External:SIGPIPE on linux

2013-05-31 Thread Dennis Poon
Ewald, Please kindly share your sample codes for both approaches. Thanks a lot. Dennis Ewald wrote: On 31 May 2013, at 13:31, Dennis wrote: Is there something I can do to trap this external SIGPIPE? You might try catching the signal using fpSignal (http://www.freepascal.org/docs-html/rtl

Re: [fpc-pascal] how to generate Free Pascal program for Open source router OpenWrt?

2013-06-04 Thread Dennis Poon
I did some search and it seems the CPU Atheros used by Netgear is MIPS. I will try to learn how to cross compile into MIPS. If it does not work on the virtual box, I will try to run it directly in the router via ssh. (the virtual box virtual machine image was provided by the OpenWrt web site. Th

[fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-05 Thread Dennis Poon
ent or cross compiler already ready for use? Thanks a lot in advance. Dennis Poon. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-06 Thread Dennis Poon
But which FPC version should I used? The doc said 2.4, should I use 2.6 or 2.7? Thanks. Dennis On 05.06.2013 16:33, Dennis Poon wrote: or x86-Windows -> MIPS-linux cross compiler or x86-MacOS->MIPS-linux cross compiler? any one of the above will be big help to me. I searched the n

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-07 Thread Dennis Poon
conflicts)? Thanks in advance. Dennis On 06.06.2013 18:33, Dennis Poon wrote: But which FPC version should I used? The doc said 2.4, should I use 2.6 or 2.7? Ah, didn't read that. Basic rule: always use the latest release to build a development (e.g. 2.7.1) or fixes version (e.g. 2

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-08 Thread Dennis Poon
dly show Step 2 for Debian in the document as well. Thanks. Dennis On 08.06.2013 09:53, Sven Barth wrote: On 08.06.2013 08:53, Dennis Poon wrote: On debian squeeze, I installed*fpc 2.6.0-9* and I followed the instruction "svn checkout http://svn.freepascal.org/svn*/fpc/trunk* fpc" whic

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-08 Thread Dennis Poon
d-stamp.mipsel-linus] Error 2 Any clues? Dennis On 08.06.2013 12:04, Dennis Poon wrote: Sven, Thanks for the update but the document 's Step 1 is "From Linux to Linux-MIPS" so it only shows instructions on how to add the repository of crosstools, binutils for debian only. But the

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-08 Thread Dennis Poon
tall fpc...deb What shuold I do now? Also, if it succeeds finally, how should I make the new target CPU available in Lazarus? Thanks a lot. Dennis On 08.06.2013 13:43, Dennis Poon wrote: Sven, Thanks for the prompt reply. I did "make all " and after many lines of messages, the la

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-08 Thread Dennis Poon
Sven, I am more than happy to start all over with windows. Can give me instructions on how to install the crosstools and binutils for windows? and maybe add them to the doc as well? Will I need to install mingw and other c related stuff (like make command etc) in windows first? Hopefully, aft

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-09 Thread Dennis Poon
Sven, make all CPU_TARGET=mipsel OS_TARGET=linux BINUTILSPREFIX= my fpc folder is /home/dennis/fpc I already login as root and issue the above command as you instructed but I got: /bin/rm -f /home/dennis/fpc/rtl/units/mipsel-linux/math.rst /home/dennis/fpc/rtl/units/mipsel-linux/varutils

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-09 Thread Dennis Poon
Michael, Thanks for your advice. My binutils as , ld etc files are located at /usr/mips-linux-gnu/bin/ so I make all CPU_TARGET=mips OS_TARGET=linux BINUTILSPREFIX=/usr/mips-linux-gnu/bin/ and this time, no errors ! And I can find the resultant *.o *.ppu in /home/dennis/fpc/rtl/units/mips-lin

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-09 Thread Dennis Poon
from to ? Frankly, I don't understand why I have to BOTH change the compiler path AND change the project's option "Code Generation"->"Target Platform". That looks redundant to me. Anyone has any idea will be highly appreciated. Thanks. Dennis In our p

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-09 Thread Dennis Poon
Also, in Lazarus, it still report /usr/bin/fpc does not support mips-linux. Should I go into the .lazarus folder in my user folder and change the environmentoptions.xml from to ? Frankly, I don't understand why I have to BOTH change the compiler path AND change the project's option "Code

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-11 Thread Dennis Poon
Jonas, Thanks for the guidance. Where is cpumips defined? Also, I could not use the $fpctarget variable, I had to use the exact file path to avoid some complains in lazarus. #include /etc/fpc.cfg #ifdef cpumips -Fu/home/dennis/fpc/$fpcversion/units/$fpctarget -Fu/home/dennis/fpc/$fpcversion/uni

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-12 Thread Dennis Poon
ide me with links of PROVED binutils for MIPS linux? Thanks, Dennis On 06/09/2013 05:43 PM, Dennis Poon wrote: My binutils as , ld etc files are located at /usr/mips-linux-gnu/bin/ ... first try to start these files form the command-line. (e.g. "ld -v") If they don't work d

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-12 Thread Dennis Poon
But I am working on a i386 Debian box. I typed gcc -v and it just says Target: i486-linux-gnu but isn't that normal? Anyway, where else should I download the cross compiler binutils from linux->MIPS? Dennis On 06/12/2013 11:13 AM, Dennis Poon wrote: Michael, I just typed "

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-12 Thread Dennis Poon
Michael, You are right, those files are also present at /usr/bin. Now I see that they seem to be the same set of files, only with the difference of a prefix. They have the same file size and date. If I open the .deb file with archive manager, it seems to suggest the set of files in side /usr/bin

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-12 Thread Dennis Poon
elf_l1om elf_k1om What does that mean? Dennis In our previous episode, Dennis Poon said: I just typed "ld -v" and it replied: GNU ld (GNU Binutils for Debian) 2.22 Then type ld -V (with capital) ___ fpc-pascal maillist -

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-12 Thread Dennis Poon
kindly send again as I did not see it on the fpc discussion list. Thanks. Dennis Dennis Poon wrote: Michael, I just typed "ld -v" and it replied: GNU ld (GNU Binutils for Debian) 2.22 I do agree they look different. I supposed they should look like "mipsel-linux-ld" but

[fpc-pascal] can someone please email me a zipped hello world binary program MIPS big endian for testing on my MIPS hardware?

2013-06-12 Thread Dennis Poon
Since I have spent days but still cannot produce a helloworld binary for MIPS big endian, I need someone to to produce that for me so I can test it on my MIPS hardware. I need to know at this stage whether a FPC produced program compiled for MIPS (big endian) can actually run on my hardware. I

Re: [fpc-pascal] can someone please email me a zipped hello world binary program MIPS big endian for testing on my MIPS hardware?

2013-06-12 Thread Dennis Poon
talking about littleendian and now you talk about big endian, which one is right? A little endian binary will never ever run on a big endian system and your crosscompiler will need to also be configured && build with the correct endian. Michael Am 12.06.13 14:00, schrieb Dennis Poon:

Re: [fpc-pascal] can someone please email me a zipped hello world binary program MIPS big endian for testing on my MIPS hardware?

2013-06-12 Thread Dennis Poon
e. Dennis Did you try: ftp://ftp.freepascal.org/pub/fpc/snapshot/trunk/mips-linux/ I just produced an up-to-date snapshot. Pierre Muller -Message d'origine- De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal- boun...@lists.freepascal.org] De la part de Den

Re: [fpc-pascal] can someone please email me a zipped hello world binary program MIPS big endian for testing on my MIPS hardware?

2013-06-12 Thread Dennis Poon
Mark, Yes, please kindly send both test executables to me. Also, if you say the compiler has changed since last christmas, do you know how I can download the fpc sources version of last christmas? Thanks a lot. Dennis Mark Morgan Lloyd wrote: Dennis Poon wrote: Since I have spent days but

Re: [fpc-pascal] can someone please email me a zipped hello world binary program MIPS big endian for testing on my MIPS hardware?

2013-06-13 Thread Dennis Poon
Openwrt, I previously thought DD-wrt was a spin off of openwrt, Sorry). Dennis Mark Morgan Lloyd wrote: Mark Morgan Lloyd wrote: Dennis Poon wrote: Since I have spent days but still cannot produce a helloworld binary for MIPS big endian, I need someone to to produce that for me so I can test it

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-15 Thread Dennis Poon
I eventually found this page which talked about downloading a special toolchain from openwrt web site http://www.dd-wrt.com/phpBB2/viewtopic.php?t=61112 I followed its instruction and successfully compiled a helloworld c program and successfully RUN the helloworld binary on Netgear 3700 run

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-16 Thread Dennis Poon
non-shared code -mabi=ABIcreate ABI conformant object file for: 32, o64, n32, 64, eabi -32create o32 ABI object file (default) -n32create n32 ABI object file -64create 64 ABI object file On 15.06.2013 19:19, Dennis Poon wrote: I eventually foun

[fpc-pascal] How to use UPnP to create port forward in the router?

2013-06-22 Thread Dennis Poon
I know some software can use UPnP to add a port forwarding rule to the router automatically. I want to do the same with FPC. Anyone has any idea on how to do so without using Microsoft's API? I want a linux approach, possibly cross platform is possible. Thanks. Dennis

[fpc-pascal] I have created this 1.3G SD Card Image for Raspberry Pi - Raspbian OS with FPC + Lazarus

2013-07-02 Thread Dennis Poon
For new users of Raspbery Pi, you can download my SD Card image at: http://api.avidsoft.com.hk/fpc-arm/130702-Raspbian-Lazarus-VNC-Chrome.zip I have also created a BitTorrent file for it but I can only provide seeding during HK hours. Hope it can become prevalent so other seeders in other time

[fpc-pascal] How to use UART of ARM platforms (e.g. Raspberry Pi ) through free Pascal?

2013-07-03 Thread Dennis Poon
Anyone has some sample codes or links to share on this? So far, I only found this: http://code.google.com/p/fprpbm/source/browse/#svn%2Ftrunk%2Fexamples%2Fminiuart%253Fstate%253Dclosed Thanks in advance. Dennis ___ fpc-pascal maillist - fpc-pasca

Re: [fpc-pascal] How to use UART of ARM platforms (e.g. Raspberry Pi ) through free Pascal?

2013-07-03 Thread Dennis Poon
Michael, I used the synapser.pas unit but the compiler choked at line 232 at the identifier 'B50', 'B576000' not found. Any idea ? Dennis Rates: array[0..MaxRates, 0..1] of cardinal = ( (0, B0), (50, B50), (75, B75), (110, B110), (134, B134), (1

Re: [fpc-pascal] How to use UART of ARM platforms (e.g. Raspberry Pi ) through free Pascal?

2013-07-03 Thread Dennis Poon
After some studying, synaser.pas seems to deal with com port instead of the low level UART interface. Can you give me some pointer on directly using UART? I need to implement half-duplex using UART for rs-485 protocol. Thanks. Dennis Michael Schnell wrote: Synaser: http://synapse.ararat.cz/

Re: [fpc-pascal] How to use UART of ARM platforms (e.g. Raspberry Pi ) through free Pascal?

2013-07-04 Thread Dennis Poon
Michael Schnell wrote: On 07/03/2013 06:36 PM, Dennis Poon wrote: Can you give me some pointer on directly using UART? I need to implement half-duplex using UART for rs-485 protocol. In a Linux system, accessing the hardware by user code is strictly discouraged, at least whenever

Re: [fpc-pascal] How to use UART of ARM platforms (e.g. Raspberry Pi ) through free Pascal?

2013-07-04 Thread Dennis Poon
half-duplex translation mode. Dennis Luca Olivetti wrote: Al 04/07/13 11:16, En/na Dennis Poon ha escrit: With RS-485 hardware you can - and supposedly need to - do "half-duplex with output enable", if your hardware provides this. After days of google search, I am afr

[fpc-pascal] synapser freezes on fopen(FDevice, 0_RDWR or 0_SYNC) on raspberry Pi

2013-07-08 Thread Dennis Poon
I downloaded http://www.turbocontrol.com/easyfpgui.htm which as a zip of example of using synapse on ARM platform. It worked on raspberry Pi (raspbian os) but it uses a specialized trimmed down version of Free Pascal library. I need to work with the traditional free pascal library since my other

Re: [fpc-pascal] synapser freezes on fopen(FDevice, 0_RDWR or 0_SYNC) on raspberry Pi

2013-07-08 Thread Dennis Poon
freezes on connect to /dev/ttyAMA0 It is so weird :-( Dennis Ewald wrote: On 08 Jul 2013, at 12:09, Dennis Poon wrote: However, when I extract the relevant code from that example and use the normal fpc compiler (2.6.0) instead of the pparm (2.6.2) and special fp lib inside that zip, my

Re: [fpc-pascal] synapser freezes on fopen(FDevice, 0_RDWR or 0_SYNC) on raspberry Pi

2013-07-08 Thread Dennis Poon
Although not 100% sure, I kinda fixed the problem. I remove a lot *.o *.ppu from the example and recompile again, both fpc 2.6 and ppcarm 2.6.2 can produce programs that work. I don't understand why and I am happy for now. thanks for advice. Dennis Dennis Poon wrote: Ewald, It does no

Re: [fpc-pascal] Console Encoding in Windows (Local VS. UTF8)

2013-07-09 Thread Dennis Poon
I have followed steps in the Wiki, etc., but to little avail, so I have some questions for anyone who knows more than me: 1. What encoding "should" I be writing to the terminal? from experimenting with text files using the cat command in powershell, it seems that local ("ANSI") encoding shoul

[fpc-pascal] is there a circular queue implementation already in FPC or FCL?

2013-07-26 Thread Dennis Poon
if not, I shall write my own. Just want to check first. Thanks. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] is there a circular queue implementation already in FPC or FCL?

2013-07-26 Thread Dennis Poon
thanks Martin. But that looks a bit too complex. I only need something simpler and preferably in generics style. It is used for tcp data buffering which needs to be fast. I will just write it myself. Dennis Martin Schreiber wrote: On Friday 26 July 2013 17:19:52 Dennis Poon wrote: if

[fpc-pascal] what is the FPC equivalent of Delphi's zlib unit?

2013-07-28 Thread Dennis Poon
I need to use CompressBuf and DecompressBuf of zlib in fpc. Thanks, Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] what is the FPC equivalent of Delphi's zlib unit?

2013-07-28 Thread Dennis Poon
thanks a lot. Dennis Michael Van Canneyt wrote: There are 3 options: paszlib.pas pascal implementation of libz. zstream.pp stream interface, uses paszlib. zlib.pp native interface to C libz library. Michael. On Mon, 29 Jul 2013, Dennis Poon wrote: I need to use CompressBuf and

[fpc-pascal] Lazarus produces Fatal: Internal error 200602035

2013-07-29 Thread Dennis Poon
What does that mean? The IDE's selected line stopped at the end of a unit of my project. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazarus produces Fatal: Internal error 200602035

2013-07-29 Thread Dennis Poon
Forgot to mention: It's Lazarus 1.0.8 FPC 2.6.2 On windows. I actually also tried it on Linux (ARM) Lazarus 1.0.10 and FPC 2.6.2 but the same error. Dennis Poon wrote: What does that mean? The IDE's selected line stopped at the end of a unit of my project

Re: [fpc-pascal] Lazarus produces Fatal: Internal error 200602035

2013-07-29 Thread Dennis Poon
exception object try except on E: exception do begin localVar := E.Message; end; end; Mattias Gaertner wrote: On Tue, 30 Jul 2013 00:46:16 +0800 Dennis Poon wrote: What does that mean? The IDE's selected line stopped at the end of a un

[fpc-pascal] has anyone successfully written an app for iOS using Free Pascal and got it approved by Apple Appstore?

2013-08-29 Thread Dennis Poon
Just want to make sure this path is plausible before I invest more time in it. Thanks a lot. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] has anyone successfully written an app for iOS using Free Pascal and got it approved by Apple Appstore?

2013-08-30 Thread Dennis Poon
I would assumed so because of the existence of Firemonkey for Delphi and Xamarin for C#. I asked this questions because I wrote a FREE (without advertisement) app with Free Pascal. The app was about Acupuncture (Chinese medicine) and was in Chinese interface only and I submitted to the Apple App

Re: [fpc-pascal] has anyone successfully written an app for iOS using Free Pascal and got it approved by Apple Appstore?

2013-08-30 Thread Dennis Poon
instead of iphone as their first smartphone. Reimar Grabowski wrote: On Fri, 30 Aug 2013 19:23:18 +0800 Dennis Poon wrote: Frankly, I was unhappy and I replied: "It is a FREE App without advertisement or anything. I don't get any reward from this app. I am mere contributing my time

Re: [fpc-pascal] lnet for TCP daemon

2013-09-12 Thread Dennis Poon
Mark Morgan Lloyd wrote: Is it feasible to use lnet for a simple TCP daemon on Linux, i.e. wait for a connection on a predefined port, read as much data as is available, repeat? And if so, what does the SerSock parameter to Accept() represent? I'd normally use a thread for this, but I've al

[fpc-pascal] Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-17 Thread Dennis Poon
I have this: uses fgl; Type RScene=record ID : Word; Name, Category : String; end; TSceneList=specialize TFPGList; The error is: Operator is not overloaded: "RScene" = "RScene" I suppose the generic thing does not know how to compare 2 records. How do I solve that? Dennis ___

Re: [fpc-pascal] Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-17 Thread Dennis Poon
Sven, Thanks a lot. It worked. Generics, advanced record, customized operator ... all these new features are so cool. I am impressed that Free Pascal has become so powerful. Dennis uses fgl; Type RScene=record ID : Word; Name, Category : String; end; TSceneList=special

Re: [fpc-pascal] Generic TFPGList gives me compiler error: Operator is not overloaded

2013-09-18 Thread Dennis Poon
Sven, I am still using fpc 2.6.2. May I know whether the generics bugs for 2.6.2 are catchable at compiler times or I only get to find out at run time? Dennis Sven Barth wrote: On 17.09.2013 17:39, Dennis Poon wrote: Sven, Thanks a lot. It worked. Generics, advanced record, customized

[fpc-pascal] does Advanced Record constructor automatically zero all the memory space of that record?

2013-09-24 Thread Dennis Poon
if not, is there a clean and easy way to initialize the entire record memory space to zeros e.g. constructor TMyRecord.Create(TheValue : Integer); begin FillChar(self, sizeof(Self), 0); Value := TheVal; end; Is there a Self variable for advanced record methods/constructors ? By the way, is

Re: [fpc-pascal] does Advanced Record constructor automatically zero all the memory space of that record?

2013-09-24 Thread Dennis Poon
Sven Barth wrote: does Advanced Record constructor automatically zero all the memory space of that record? No, it does not. Neither in Delphi nor in FPC. Am 24.09.2013 12:36, schrieb Dennis Poon: if not, is there a clean and easy way to initialize the entire record memory space to zeros e.g

[fpc-pascal] where is the sqlite3.so located in debian?

2013-09-26 Thread Dennis Poon
In debian, I have already apt-get install sqlite3 and I can execute the command sqlite3 freely. I know it is located in /usr/bin/ but I cannot find sqlite3.so to passed to SQLiteLibraryName inside the sqlite3conn unit. Please help. Dennis ___ fpc-pa

Re: [fpc-pascal] where is the sqlite3.so located in debian?

2013-09-26 Thread Dennis Poon
On Thu, 26 Sep 2013, Dennis Poon wrote: In debian, I have already apt-get install sqlite3 and I can execute the command sqlite3 freely. I know it is located in /usr/bin/ but I cannot find sqlite3.so to passed to SQLiteLibraryName inside the sqlite3conn unit. You need the developer

[fpc-pascal] property TField.AutoGenerateValue missing in 2.6.2

2013-09-30 Thread Dennis Poon
I just noticed the above property is missing in FPC 2.6.2 I am porting some old delphi code to FPC and noticed it. If I simply ignore this property value (always assume it to be arNone), will it cause any problem? Dennis ___ fpc-pascal maillist -

[fpc-pascal] how to directly access field/record value of TBufDataSet?

2013-09-30 Thread Dennis Poon
Since TBufDataSet is in-memory, to speed things up, how can I directly access the N'th record and M'th field's value as Variant? At this stage, I only need to read the value, no to write it. Also, how do I use the procedure LoadFromStream(AStream : TStream; Format: TDataPacketFormat = dfAn

Re: [fpc-pascal] property TField.AutoGenerateValue missing in 2.6.2

2013-09-30 Thread Dennis Poon
Michael Van Canneyt wrote: On Mon, 30 Sep 2013, Dennis Poon wrote: I just noticed the above property is missing in FPC 2.6.2 I am porting some old delphi code to FPC and noticed it. If I simply ignore this property value (always assume it to be arNone), will it cause any problem? That

Re: [fpc-pascal] how to directly access field/record value of TBufDataSet?

2013-09-30 Thread Dennis Poon
Also, how do I use the procedure LoadFromStream(AStream : TStream; Format: TDataPacketFormat = dfAny)? Especially, I don't understand the TDataPacketFormat parameter. Using Format parameter you can signal to DatapacketReader in which format expect data (dfBinary, dfXML etc) It is not requi

[fpc-pascal] sizeof(Enumerated type in Delphi 5) <> sizeof(The same type in FPC)

2013-09-30 Thread Dennis Poon
In Delphi 5, var G : TAutoRefreshFlag; //where type TAutoRefreshFlag = (arNone, arAutoInc, arDefault); sizeof(G) returns 1 in FPC if defined type TAutoRefreshFlag = (arNone, arAutoInc, arDefault); and same Var G : TAutoRefreshFlag; sizeof(G) returns 4. This different behaviour bre

[fpc-pascal] how to speed up lazarus compilation and debugging

2013-09-30 Thread Dennis Poon
I came from the old delphi 5 IDE and I found the lazarus 1.0.8 /FPC 2.6.2 's compilation and debugging a lot slower than Delphi 5. Are there any settings that I can make to speed up Lazarus? Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepasca

Re: [fpc-pascal] how to speed up lazarus compilation and debugging

2013-09-30 Thread Dennis Poon
On Mon, 30 Sep 2013, Dennis Poon wrote: I came from the old delphi 5 IDE and I found the lazarus 1.0.8 /FPC 2.6.2 's compilation and debugging a lot slower than Delphi 5. Are there any settings that I can make to speed up Lazarus? Switch to Linux. It is faster on Linux but stil

Re: [fpc-pascal] how to directly access field/record value of TBufDataSet?

2013-09-30 Thread Dennis Poon
Since TBufDataSet is in-memory, to speed things up, how can I directly access the N'th record and M'th field's value as Variant? Simply said: You cannot. Can any one suggest an in-memory dataset in fpc/lazarus that allows direct access? Does TMemDataset allow it? Thanks. Dennis _

Re: [fpc-pascal] how to directly access field/record value of TBufDataSet?

2013-10-01 Thread Dennis Poon
Michael Van Canneyt wrote: On Tue, 1 Oct 2013, Dennis Poon wrote: Since TBufDataSet is in-memory, to speed things up, how can I directly access the N'th record and M'th field's value as Variant? Simply said: You cannot. Can any one suggest an in-memory dataset in f

Re: [fpc-pascal] does Advanced Record constructor automatically zero all the memory space of that record?

2013-10-04 Thread Dennis Poon
>You can use either FillChar as you did or use "Self := Default(TTest);" (default is a compiler intrinsics that returns a 0 value of the type >you passed in, e.g. Nil for classes, '' for strings, 0 for ordinals and for records all fields are set to 0) How can I make it so that I only do the

Re: [fpc-pascal] does Advanced Record constructor automatically zero all the memory space of that record?

2013-10-04 Thread Dennis Poon
Thanks a lot for clarification. Dennis Sven Barth wrote: On 04.10.2013 14:48, Dennis Poon wrote: >You can use either FillChar as you did or use "Self := Default(TTest);" (default is a compiler intrinsics that returns a 0 value of the type >you passed in, e.g. Nil for classes

[fpc-pascal] is it possible to subclass a generic class?

2013-10-06 Thread Dennis Poon
I want to do something like this but the compile complains. Type generic TMyMap =class( generic TFPGMap) destructor Destroy; override; constructor Create; end; I want to override some methods and destructor before my class is specialized later. Is it possible? How? Denni

Re: [fpc-pascal] [OT] sealed?

2013-10-07 Thread Dennis Poon
> It is wonderful, thank you very much Sven! :) Well, the opinion whether this feature is wonderful or not differs among FPC/Delphi users :P Regards, Sven May I know the usual use of such feature? I can only think of library vendors want to seal a class to prevent users from modifying it w

Re: [fpc-pascal] Re: what is the FPC equivalent of Delphi's zlib unit?

2013-10-14 Thread Dennis Poon
Please help. I am using Delphi 5's zlib procedure CompressBuf(src,SrcLen, Dest, DestLen); to compress data to be decompressed by FPC's paszlib unit, but I don't know which one of the many procedure is the right right to use? I tried uncompress(Dest, DestLen, Src, SrcLen) but it is obviously wr

[fpc-pascal] which procedure is used for the old zlib decompression in the paszlib unit?

2013-10-14 Thread Dennis Poon
{This is a resend since the last email did not appear on the elist} I am using the Delphi 5's zlib procedure CompressBuf (Src, SrcLen, Dest, DestLen) to compress data to be decompressed by FPC's paszlib unit but I don't know which one of the many procedure is the right one to use. I already tr

[fpc-pascal] synapse + ssl on linux ,how to use libc

2013-10-22 Thread Dennis Poon
I need to use synapse + ssl on linux and it requires libc but I cannot locate this unit. Can anyone help? Also, has anyone used it before? Is it stable? I have been using lnet + ssl but it was unstable , so wanted to try synapse. Any comments are appreciated. Dennis __

[fpc-pascal] is there a way to list out all classes defined in a unit during run time?

2013-11-07 Thread Dennis Poon
I have a unit which I will incrementally add new subclasses of TCommand. At run time, I want to get a list of subclasses of TCommand so that I can compare the where the user's required input (from network) matches the name of any TCommand. Currently, I have to register each subclass in the in

[fpc-pascal] any workable synapse https server (SSL) sample available?

2013-11-08 Thread Dennis Poon
I downloaded the synapse4.0 but the sample project httpSserver inside does not work. When I pointed the Chrome and Firefox browser to http://192.168.1.4/ firefox reported: Secure Connection Failed An error occurred during a connection to 192.168.1.4. SSL received a record that exce

Re: [fpc-pascal] any workable synapse https server (SSL) sample available?

2013-11-08 Thread Dennis Poon
waldo kitty wrote: On 11/8/2013 9:59 AM, Dennis Poon wrote: I downloaded the synapse4.0 but the sample project httpSserver inside does not work. When I pointed the Chrome and Firefox browser to http://192.168.1.4/ is that url accurate? i can't help with that as all my synapse codi

Re: [fpc-pascal] UPnP Component

2013-11-11 Thread Dennis Poon
Dimitrios Chr. Ioannidis wrote: Hi all, at work, i have a project which needs very limited UPnP capabilities. All it needs, is to open a port and do a port forwarding for a limited period of time closing it afterwards. Nowdays almost every Residential Gateway(Router) / ( Customer Premises

[fpc-pascal] paszlib problem: integer overflow

2013-11-13 Thread Dennis Poon
I downloaded the Paszlib-sg from http://sagsehome.net/oss/paszlib-sg.php (as suggested by Paszlib freepascal.org wiki). I works fine on my Delphi 5 until I try to compress a file with size of 70M and it raises the exception of integer flow error. Does anyone have this problem? I initially th

Re: [fpc-pascal] paszlib problem: integer overflow

2013-11-14 Thread Dennis Poon
Dennis Poon wrote: I downloaded the Paszlib-sg from http://sagsehome.net/oss/paszlib-sg.php (as suggested by Paszlib freepascal.org wiki). I works fine on my Delphi 5 until I try to compress a file with size of 70M and it raises the exception of integer flow error. Does anyone have this

[fpc-pascal] any good data compression library for Free Pascal?

2013-11-14 Thread Dennis Poon
the paszlib has bug for large file sizes so I need another one. Thanks. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] paszlib problem: integer overflow

2013-11-14 Thread Dennis Poon
I works fine on my Delphi 5 until I try to compress a file with size of 70M and it raises the exception of integer flow error. That means you enabled that somehow. Integer under/overflow is generally not enabled by default, and it is somewhat unlogical to use it with converted C code.

[fpc-pascal] CRITICAL Bug in Lnet DNSLookup failure problem

2013-11-27 Thread Dennis Poon
when using lnet to connect to a remote server at DomainName : Port e.g. yahoo.com : 80 in file lCommon.pp line 492: function StrToNetAddr(const IP : String) : Sockets.in_addr;inline; begin result := Sockets.StrToNetAddr(IP); end; The above function did not raise exception when the IP parame

[fpc-pascal] cannot read /sys/class/net/eth1/address even as root user on linux

2013-12-05 Thread Dennis Poon
I tried to read the mac address in the captioned file path. In terminal, I can simply 'cat' and display the mac address. In FPC, when I tried to use TFileStream to read it, FS := TFileStream.Create('/sys/class/net/eth1/address', fmOpenRead+fmShareDenyWrite); it raised "stream read error" I

Re: [fpc-pascal] cannot read /sys/class/net/eth1/address even as root user on linux

2013-12-05 Thread Dennis Poon
While your method should work if that file actually exists, you probably want to use libudev for enumerating and getting device information from sysfs. libudev will also enable you to get hotplug notification. For your your reply. The fact is: 1) my linux distro starts with eth1 not eth0

[fpc-pascal] how to load openssl 32bit library in Lnet on centos 64 bit?

2013-12-06 Thread Dennis Poon
My ssl server program (using Lnet) was written and tested on Linux 32 bit. The VPS I rented unfortunately is running CentOS 64 bit. Although I have already installed the following 32 bit libs yum install glibc.i686 yum install libstdc++.i686 yum install openssl.i686 However, when I run my ssl

[fpc-pascal] how to install sqlite server side library on CentOS

2013-12-06 Thread Dennis Poon
My server program written in fpc uses sqlite3 and in ubuntu, I just need to apt-get install libsqlite3-dev but in centos, the libsqlite3-dev does not exist and the client lib after yum install sqlite was not enough. The server program still complained: libsqlite3.so is missing. Please help

Re: [fpc-pascal] how to install sqlite server side library on CentOS

2013-12-06 Thread Dennis Poon
Jonas Maebe wrote: On 06 Dec 2013, at 18:45, Dennis Poon wrote: My server program written in fpc uses sqlite3 and in ubuntu, I just need to apt-get install libsqlite3-dev but in centos, the libsqlite3-dev does not exist and the client lib after yum install sqlite was not enough. The

[fpc-pascal] how to define a generic subclass inheriting from another generic class?

2013-12-10 Thread Dennis Poon
What is the syntax. I could not find it in google. e.g. in unit fgl, generic TFPGMap=class(TFPSMap) end; How do I define a subclass TMyMap inheriting from TFPGMap without first specializing it? I assumed generic TMyMap = class(generic TFPGMap) ... end but fpc 2.6.2 did not accept t

[fpc-pascal] when will Free Pascal have a stable release of 2.7.2?

2013-12-10 Thread Dennis Poon
There are quite some features I want to use there but I would wait until they are released a stable version. Any idea? Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] when will Free Pascal have a stable release of 2.7.2?

2013-12-11 Thread Dennis Poon
>2.7.1 will become 2.8 sooner or later (*) and what's in trunk at that time will also be in 2.8.0 (and normally we don't deliberately remove things... ^^ ). what is the timeframe of 'sooner or later'? May I assume Q1 of 2014? Dennis ___ fpc-pascal m

[fpc-pascal] FPC2.6 failed to raise compiler error "Argument can't be assigned to' for Generic class' Record property in "With" clause

2013-12-13 Thread Dennis Poon
I think I found a bug in FPC 2.6.2. In a method of a derived specialized class, the compiler does not raise error (which it should) With "record property" do "record property's field" := NewValue //it should raise error since it is a record property and should not be allowed to modify just

[fpc-pascal] how to simplify try try except end finally end?

2013-12-26 Thread Dennis Poon
Is there a way to further simplify the following? I need to make the exception message more indicative of the context of the error and I hope to combine the 2 try blocks into one. It seems possible in Java and C# but not in FPC. Is there a way to combine them like try except finally

Re: [fpc-pascal] Re: how to simplify try try except end finally end?

2013-12-27 Thread Dennis Poon
For what it's worth, I'm ambivalent. Not because I feel that try stacks couldn't or shouldn't be simplified, but because I feel that whoever overloaded try for two different structures should be shot. I don't know enough about compiler. Could you kindly elaborate on the above please? D

Re: [fpc-pascal] cannot read /sys/class/net/eth1/address even as root user on linux

2014-01-02 Thread Dennis Poon
Michael Van Canneyt wrote: On Thu, 5 Dec 2013, Dennis Poon wrote: I tried to read the mac address in the captioned file path. In terminal, I can simply 'cat' and display the mac address. In FPC, when I tried to use TFileStream to read it, FS := TFileStream.Create('/sys

[fpc-pascal] Does TBufDataSet support Blob or memo field?

2014-01-13 Thread Dennis Poon
I created a TMemoField in TBufDataSet but no matter I do: 1) Field.asString := 'some value' or 2) Field.LoadFromStream(someStream). Afterwards, this F.AsString always returns '' and F.LoadFromStream(someStream) always has a 0 BlobSize afterwards. Anyone has similar experience? Dennis ___

Re: [fpc-pascal] Does TBufDataSet support Blob or memo field?

2014-01-13 Thread Dennis Poon
All the other usual types (e.g. integer, string, datetime) work except ftMemo and ftblob. Yes, I have used POST Dennis LacaK wrote: AFAIR this is so. (we can call it bug ;-)) Data are not there until you Post record. After Post you will see data there, right? -Laco. ___

Re: [fpc-pascal] Does TBufDataSet support Blob or memo field?

2014-01-16 Thread Dennis Poon
Dennis Poon wrote: All the other usual types (e.g. integer, string, datetime) work except ftMemo and ftblob. Yes, I have used POST Dennis LacaK wrote: AFAIR this is so. (we can call it bug ;-)) Data are not there until you Post record. After Post you will see data there, right? -Laco

[fpc-pascal] TSQLQuery.ApplyUpdates problem with UTF-8

2014-03-14 Thread Dennis Poon
Is TSQLQuery.AppleUpdate works with UTF8 string field content? I fetched a web page and extracted part of its content and appended it into TSQLQuery record's string field. The web page content is Chinese in UTF-8 encoding. I 'writeln' the content before appending it and it appeared normal in

  1   2   >