[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

[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

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

2013-06-01 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

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.

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

2013-06-05 Thread Dennis Poon
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 net

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

2013-06-08 Thread Dennis Poon
)? 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.6.3). In this case

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

2013-06-08 Thread Dennis Poon
. 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 which I believe is the latest version of fpc source code then I followed

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

2013-06-08 Thread Dennis Poon
] 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 Step 2 Cross-compiler only shows

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

2013-06-08 Thread Dennis Poon
anything. No crosstools files see to be generated when I install 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

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,

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

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

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

2013-06-09 Thread Dennis Poon
. Thanks. Dennis In our previous episode, Dennis Poon said: make all CPU_TARGET=mips OS_TARGET=linux make crossinstall INSTALL_PREFIX=/home/dennis/fpc What should I do next? Pass the same arguments to crossinstall as you did to all

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 CompilerFilename Value=/usr/bin/fpc to CompilerFilename Value=/home/dennis/fpc ? Frankly, I don't understand why I

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

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

2013-06-12 Thread Dennis Poon
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 decently (which I do suppose), you need different files

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 ld -v

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

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 - fpc-pascal

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 I only followed

[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.

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: Since 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
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 Dennis Poon Envoyé

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

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
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 on my MIPS

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

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

2013-06-16 Thread Dennis Poon
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 found this page which talked about downloading a special toolchain

[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

[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 -

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),

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:

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
-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 afraid the bcm2835

[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

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 not fix

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 should

[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

[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

[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
I will create a bug report. Basically, after removing block by block and test again, the cause seems to be : -in a unit -define a class with a method with inline directive -in that method implementation, create a try except end block and in the except section, do some assignment involving the

[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

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
Frankly, I don't like Apple. They have become arrogant and stubborn like Microsoft and old Sony and (the old IBM). Remember Sony used to have this special type of SD card (Called Memory stick ) which are so different from other SD, MMC and they forced you to buy them (at much higher priced than

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

[fpc-pascal] Generic TFPGListRecord Type 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 TFPGListRScene; 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 TFPGListRecord Type 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;

[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,

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

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 =

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

[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 -

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 still way

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 fpc/lazarus

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, '' for strings, 0

[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 TMyMapTKey, TData =class( generic TFPGMapTKey, TData) destructor Destroy; override; constructor Create; end; I want to override some methods and destructor before my class is specialized later. Is

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

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

[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

[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

[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

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 coding

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

[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

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

[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] 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 If

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

[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

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

[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 TFPGMapTKey, TData=class(TFPSMap) end; How do I define a subclass TMyMap inheriting from TFPGMap without first specializing it? I assumed generic TMyMap TKey, TData = class(generic TFPGMapTKey, TData) ...

[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

[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?

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/class/net/eth1

[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

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

2014-03-14 Thread Dennis Poon
Michael Van Canneyt wrote: On Fri, 14 Mar 2014, Dennis Poon wrote: the content appeared as garbage. I already specified the CHARSET=utf8 in the Create Table SQL. Did you set the TSQLConnection.Charset property to UTF8 as well ? I set it to utf8 (UTF-8 will raise exception

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

2014-03-17 Thread Dennis Poon
Dennis Poon wrote: Michael Van Canneyt wrote: On Fri, 14 Mar 2014, Dennis Poon wrote: the content appeared as garbage. I already specified the CHARSET=utf8 in the Create Table SQL. Did you set the TSQLConnection.Charset property to UTF8 as well ? I set it to utf8 (UTF-8

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

2014-03-18 Thread Dennis Poon
LacaK wrote: Dennis Poon wrote / napísal(a): Dennis Poon wrote: Michael Van Canneyt wrote: On Fri, 14 Mar 2014, Dennis Poon wrote: the content appeared as garbage. I already specified the CHARSET=utf8 in the Create Table SQL. Did you set the TSQLConnection.Charset property

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

2014-03-20 Thread Dennis Poon
I tried, the results are: @@character_set_client : utf8 @@character_set_connection : latin1 @@character_set_database : latin1 Dennis, do you received my reply?: IMO @@character_set_connection is wrong and must be utf8. I will try fix it, but first can you try as workaround this: -

Re: [fpc-pascal] Lazarus better than delphi

2014-03-20 Thread Dennis Poon
m...@rpzdesign.com wrote: I have been using Delphi 7 forever. I evaluated Delphi xe5 Update 2. Today, I use Lazarus 1.2 and FPC 2.6.2. Lazarus/FPC is just better than Delphi. All development on Mac/Windows is now with Lazarus. You FPC/Lazarus guys ROCK. Best wishes for 2014. md I would

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

2014-03-24 Thread Dennis Poon
LacaK wrote: Dennis Poon wrote / napísal(a): I tried, the results are: @@character_set_client : utf8 @@character_set_connection : latin1 @@character_set_database : latin1 Dennis, do you received my reply?: IMO @@character_set_connection is wrong and must be utf8. I will try

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

2014-03-25 Thread Dennis Poon
By the way, why isn't a semicolon required at the end of SET NAMES 'utf8' command? I tried both with and without semicolon and neither raise an error. Seems, that MySQL is tolerant to this. MySQL supports MULTI_STATEMENTS, which enables client to pass multiple statements separated by ; in

  1   2   >