Re: [fpc-pascal] how to make a type private to the unit but not defining it in the implementation section?

2019-03-07 Thread Dennis Poon
Anthony Walter wrote: type   _PrivateData = class     private type THidden = record Name: string; end;   end; ... and later in the implementation section of the same unit ... var H: _PrivateData.THidden; begin H.Name := 'Hello'; end; But that will have the same problem of extra long

Re: [fpc-pascal] Announcement GLPT

2018-09-26 Thread Dennis Poon
Darius Blaszyk wrote: On Tue, Sep 25, 2018 at 5:21 PM Dennis > wrote: I tried it but found that drawing text in OpenGL seems to be problematic. Is there anyway to draw text using windows' existing font? Or is there a library for nicer vector

Re: [fpc-pascal] why can't we define class operator for old fashion object type, but ok for 'advanced record' type?

2018-08-16 Thread Dennis Poon
Sven Barth via fpc-pascal wrote: Am 15.08.2018 um 10:59 schrieb Dennis: Why class operator is accepted for advanced records but not old fashion object??? Because objects are not records. Internally they are handled more closely to classes than records. Would it be too hard to also

Re: [fpc-pascal] Will moving from due core CPU to 6 Core CPU of the same clock speed improve the speed of FPC compiling?

2018-08-07 Thread Dennis Poon
Martin wrote: Out of interest, how long does it take you to compile your project? Only 20 seconds. But sometimes, when I modify some units used by other units which are in turn used by other units, FPC throws the following exception when I compile (not build) uspdata.pas(228,50) Error:

Re: [fpc-pascal] No type info available for this type (Enumerated type with constant assignment)

2018-07-24 Thread Dennis Poon
Sven Barth via fpc-pascal wrote: Dennis mailto:de...@avidsoft.com.hk>> schrieb am Mo., 23. Juli 2018, 12:24: Is this kind of enumerated type with constant assignment not supported by FPC 3.0.4?    TMonthType = (January=1, February, May=5,June, July); The enumeration type

Re: [fpc-pascal] Is there a smart way to save/restore NotifyEvents and objects?

2018-02-02 Thread Dennis Poon
Sven Barth via fpc-pascal wrote: Am 02.02.2018 17:53 schrieb "Dennis" >: I have list of objects which contains references to other objects. I need to save all these objects to harddisk to be restored on a latter day. I

Re: [fpc-pascal] any existing units/libraries for sorting?

2018-01-03 Thread Dennis Poon
Santiago A. wrote: El 03/01/2018 a las 16:09, Dennis escribió: I have a list of records (each with a few fields). What do you mean with list? A TList? You can use sort method Thanks for the reminder. I forgot about it. Dennis ___ fpc-pascal

Re: [fpc-pascal] Cannot find entry point of a routine inside a windows 64 dll

2017-12-13 Thread Dennis Poon
Sven Barth via fpc-pascal wrote: Am 13.12.2017 03:04 schrieb "Dennis" >: I am converting my windows 32 program to 64 bit. It compiled with lazarus without any problem.(fpc 3.0.2) I also compile the dll that is used, into a 64

Re: [fpc-pascal] Is there any pascal interface to TensorFlow or other neural network tools?

2017-12-07 Thread Dennis Poon
schuler wrote: "> or even neural network libraries written in Pascal? Try contacting schuler in Lazarus forum. " Hello, this is schuler!!! You can find the most recent project update here: https://forum.lazarus.freepascal.org/index.php/topic,39049.0.html There are many neural network layers

Re: [fpc-pascal] Is there any pascal interface to TensorFlow or other neural network tools?

2017-10-29 Thread Dennis Poon
Michael Van Canneyt wrote: On Sat, 28 Oct 2017, Dennis wrote: or even neural network libraries written in Pascal? I know there are many python interfaces/libraries but I hope to use Pascal entirely so that I don't have to run a python server along side my Free Pascal program. Or, is

Re: [fpc-pascal] How to call C++ function with Vector

2017-09-26 Thread Dennis Poon
Marco van de Voort wrote: I myself generally solve this with a wrapper DLL, by crafting a DLL in C++ that exports a C (not C++) interface, and then use that. The same method as QT is used from Lazarus (via wrapper dll/.so qtpas) ___ Thanks. I

Re: [fpc-pascal] why the 0.5 in the Unix Epoch (for UnixToDateTime function)

2017-08-01 Thread Dennis Poon
Vojtěch Čihák wrote: Hi, wiki https://en.wikipedia.org/wiki/Julian_day says that "... Julian day number 0 assigned to the day starting at noon on January 1, 4713 BC, ..." The noon means 0,5. Thanks, that is a weird definition though IMHO. Dennis

Re: [fpc-pascal] Why casting interface as Tobject will result in a different reference?

2017-05-27 Thread Dennis Poon
Sven Barth via fpc-pascal wrote: The idea itself is valid, cause "(IMyInterfaceVar as TObject) as IMyInterface = IMyInterfaceVar" is true if and only if IMyInterface is a COM interface. If IMyInterface really is a CORBA interface as Dennis wrote then the compiler should already have complained

Re: [fpc-pascal] Run Time Type Info - are the type names of all classes defined in a unit stored in the RTTI?

2017-03-01 Thread Dennis Poon
Sven Barth wrote: Am 01.03.2017 11:53 schrieb "Dennis" >: > > Programmatically, I want to make a list of all Classes defined in the unit. > Is this info stored in the RTTI or anywhere else? This info is not yet available, but will be

Re: [fpc-pascal] how to use Default to replace this ' FillChar(aRecord, sizeof(aRecord), 0);

2016-12-05 Thread Dennis Poon
Lars wrote: Do you know about this feature: var SomeRec: TSomeRecord = (); This is good for global variable. But I wonder whether it has effect in procedure's local variable since it requires the compiler to clear the record on the stack (which is at different location every time).

Re: [fpc-pascal] how to use Default to replace this " FillChar(aRecord, sizeof(aRecord), 0);

2016-12-05 Thread Dennis Poon
Sven Barth wrote: Am 05.12.2016 08:24 schrieb "Dennis" >: > > In this old statement, I don't need to know the type of aRecord > but if I want to use Default, I have to know the exact type of the varaible aRecord and pass it to

Re: [fpc-pascal] what is the possible cause of EPrivilege Privileged instruction ?

2016-10-26 Thread Dennis Poon
Snorkl e wrote: Your not using teventobject in your threads are you? There is a bug in the RTL which could cause weird issues with threads if you are using teventobject.create. I don't use TEventObject (because I don't know how to use it). I have my internal task queue that my worker

Re: [fpc-pascal] Resource strings, passwords etc.

2016-07-13 Thread Dennis Poon
Graeme Geldenhuys wrote: On 2016-07-13 08:31, Mark Morgan Lloyd wrote: Sometimes it's difficult to avoid having to do that sort of thing, or obfuscating them in an external file. You could use something like DCPCrypt to help the cause. Or you could follow similar tactics to what OnGuard uses

Re: [fpc-pascal] Surprise. Comparison of method is only done on the routine address

2016-07-12 Thread Dennis Poon
Michael Van Canneyt wrote: On Tue, 12 Jul 2016, Dennis wrote: I always thought comparison of methods is done on both the data and the code part. TMethod = record Code : CodePointer; Data : Pointer; end; But the following proves it is NOT. What is the rationale

Re: [fpc-pascal] can the compiler zero any out parameter of procedure/function automatically?

2016-07-11 Thread Dennis Poon
Jonas Maebe wrote: Dennis wrote: I know it is my responsibility to initialize out parameters, but I think the compiler could help us by initializing all out parameters. The compiler will fill out-parameters with garbage if you use the -gt command line parameter, which can help you detect

Re: [fpc-pascal] what is the correct way to write {$IFDEF FPC Version > 3.0}

2016-07-08 Thread Dennis Poon
Bart wrote: On 7/8/16, Dennis wrote: what is the correct way to write {$IFDEF FPC Version > 3.0} See answers above. For your information: FPC_FULLVERSION construction: Major*1 + Minor*100 + Revision Thank you all for your answers. Dennis

Re: [fpc-pascal] Is there a reactive framework for Free Pascal?

2016-07-07 Thread Dennis Poon
Sven Barth wrote: Am 07.07.2016 10:13 schrieb "Graeme Geldenhuys" >: > > Hi Dennis, > > Would you mind explaining what is a “reactive framework”? http://reactivex.io/ Once we support helpers for interfaces and anonymous

Re: [fpc-pascal] Bls: Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-22 Thread Dennis Poon
I saw your document on for x in ListX loop and would like to reconfirm that it is always iterated in ascending order, right? can we do it in descending order without a user defined enumerator? i.e. for simple enumerated type, is there a construct to iterate through it in descending order?

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-21 Thread Dennis Poon
2) use of ClassType function for cloning objects I added two things: - A section about TPersistent.Assign. This is the "basic approach to cloning" that should probably be shown first. See it here:

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-19 Thread Dennis Poon
May I suggest the addition of : 1) user defined operator? 2) use of ClassType function for cloning objects Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-19 Thread Dennis Poon
Michalis Kamburelis wrote: Hi, So, I wrote a document describing (quickly!) many features of the modern Object Pascal:) Read on: http://michalis.ii.uni.wroc.pl/~michalis/modern_pascal_introduction/modern_pascal_introduction.html

Re: [fpc-pascal] Error: Internal error 2014052302 on changing some common units

2016-04-15 Thread Dennis Poon
Sven Barth wrote: Am 15.04.2016 13:40 schrieb "Dennis" >: > > whenever I change the source of a common unit (that is used by many other units), when I compile with lazarus 1.7 +FPC 3.1.1, this error will appear in the messages >

Re: [fpc-pascal] compile Link Smart option, is it -XX or -CX?

2016-03-03 Thread Dennis Poon
Sven Barth wrote: Am 03.03.2016 09:26 schrieb "Dennis" >: > > According to http://www.freepascal.org/docs-html/prog/progse30.html > > the smartlink option on the command line is -CX > but in Lazarus ver 1.42, >Compilation and Linking

Re: [fpc-pascal] Assign() vs AssignTo()

2016-02-11 Thread Dennis Poon
Martin Schreiber wrote: On Friday 12 February 2016 03:17:57 Dennis wrote: Is there any sample codes to copy published properties (via RTTI) ? e.g. psuedo code below for i := 0 to properties.count -1 do begin case properties[i].type of vtInteger : properties[i].AsInteger

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-02-01 Thread Dennis Poon
Jürgen Hestermann wrote: Am 2016-02-01 um 19:45 schrieb Dmitry Boyarintsev: No matter what the language is, developers still want to write C... for the shortness of script Such people should simply use C. Pascal <> C and I am glad that this is true. In my humble opinion, the importance of

Re: [fpc-pascal] Problem with objects

2015-12-23 Thread Dennis Poon
Santiago A. wrote: El 23/12/2015 a las 12:13, Dennis Poon escribió: Did you call A.Create before calling TestDerived? Maybe A.List was not initialized (which is done in constructor Create) and contains an invalid pointer (to dynamic array of string). When you call SetLength, it decrements

Re: [fpc-pascal] Problem with objects

2015-12-23 Thread Dennis Poon
I think for both Record or Object, you need to initialize any dynamic array or strings fields before using them. If you don't use any constructor , you need to initialize the fields yourself. Being an object, just gives you the added automatic zeroing of its content. Advanced Record does

Re: [fpc-pascal] Problem with objects

2015-12-23 Thread Dennis Poon
Santiago Amposta wrote: Hello: I use fpc 2.6.4 and I have a problem of memory leaks, strange errors, etc. Finally I have tracked it to this: TSimpleArrayString=object List:array of String; end; TDerivedArrayString=object(TSimpleArrayString) other_field:integer; end; procedure

Re: [fpc-pascal] Does SetLength clear its elements to zeros?

2015-12-11 Thread Dennis Poon
Jonas Maebe wrote: Dennis wrote on Fri, 11 Dec 2015: I just tested, SetLength a string does not zero its elements (the chars). However, SetLength a dynamic array seems to zero its elements. Dynamic arrays are indeed zeroed when changing the length, while strings are not. For dynamic

[fpc-pascal] how do I play mp3 files with Free Pascal?

2014-10-27 Thread Dennis Poon
I can use the windows MMSystem unit but it only plays .wav file. How do I play .mp3 file? Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] any generic List class other than those in fgl unit?

2014-10-24 Thread Dennis Poon
The TFPGMap in fgl unit has serious bug in the Find method. I tried but cannot fix it. I am hoping to find a well tested replacement class? Please kindly let me know. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] any generic List class other than those in fgl unit?

2014-10-24 Thread Dennis Poon
Reinier Olislagers wrote: On 24/10/2014 13:32, Dennis Poon wrote: The TFPGMap in fgl unit has serious bug in the Find method. I tried but cannot fix it. Why don't you raise a bug in the bugtracker with an example test program so developers can look into it? Can you give me a link to report

Re: [fpc-pascal] Is TFPList thread safe?

2014-10-06 Thread Dennis Poon
Michael Schnell wrote: On 10/02/2014 03:59 PM, Xiangrong Fang wrote: , not replace TFPList with TThreadList, for simplicity and performance reason... I don't suppose it will be possible to beat TThreadList performance by any home-brew Pascal code, which is same is not insecure. But I

[fpc-pascal] fgl unit bug in generic class TFPGMap

2014-10-03 Thread Dennis Poon
I think I found a bug in TFPGMap. Hope some of you can verify it. The bug seems to relate to the binary search used in the method FIND but it does not occur for all string key values or at all capacity of the map. Seems only occur at the second item added and when it is certain string values.

Re: [fpc-pascal] Windows type library files

2014-10-03 Thread Dennis Poon
thanks a lot. Adriaan van Os wrote: In case someone is interested, I put the .zip archives below for download at my website http://adriaan.biz/windows-com/pas-from-sdk.zip http://adriaan.biz/windows-com/pas-from-system32.zip Regards, Adriaan van Os

Re: [fpc-pascal] how do I get Run Time info from a published method?

2014-10-02 Thread Dennis Poon
Flávio Thanks so much. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] how do I get Run Time info from a published method?

2014-09-29 Thread Dennis Poon
say for example: type TmyClass = class published procedure Something (sender : Tobject);virtual; end; var myClass : TmyClass; then somewhere AddMethodToQueue(@myclass.Something); Is it possible within AddMethodToQueue, I can query the Run Time Type Info of

Re: [fpc-pascal] is it possible to kill a thread from within fpc?

2014-09-26 Thread Dennis Poon
Mark Morgan Lloyd wrote: Dennis Poon wrote: I want to kill a thread created by my fpc program (not killing the entire process). I have to use an external win32 dll. I am already calling it from a separate thread but still, that dll something goes into an infinite loop which made my thread

[fpc-pascal] is it possible to kill a thread from within fpc?

2014-09-25 Thread Dennis Poon
I want to kill a thread created by my fpc program (not killing the entire process). I have to use an external win32 dll. I am already calling it from a separate thread but still, that dll something goes into an infinite loop which made my thread freezes. How do I kill this particular thread?

Re: [fpc-pascal] Is is impossible to extend a generic class in fpc 2..6.4?

2014-09-22 Thread Dennis Poon
Sven Barth wrote: generic TMyMapTKey, TData = class(specialize TFPGMapTKey, TData) end; Thanks a lot for your help. Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] Is is impossible to extend a generic class in fpc 2..6.4?

2014-09-21 Thread Dennis Poon
Is it impossible to extend a generic class? I tried to extend a generic class TFPGMap in fpl unit. its original definition is: generic TFPGMapTKey, TData = class(TFPSMap) I want to extend it by: generic TMyMapTKey, TData=class(TFPGMap ) end; I got this error: Generics without

[fpc-pascal] how to implement a RTD server (COM Server) for windows

2014-09-17 Thread Dennis Poon
Window's DDE protocol is too old and the new one is called RTD. I want to implement such an RTD server for Excel client to connect to. Is there any examples of implementing COM server with fpc? Where do I start? Many thanks in advance. Dennis ___

[fpc-pascal] return 8 byte of return as function result via register

2014-09-12 Thread Dennis Poon
I am trying to use an external C++ dll and also privide call back functions to this dll to call back. However, the dll requires my functions to return 8 byte of 'struct' via register and the dll author said it is not possible with Delphi. Is that possible with fpc? Dennis

Re: [fpc-pascal] where to find documentation on fgl unit?

2014-09-11 Thread Dennis Poon
Michael Van Canneyt wrote: On Thu, 11 Sep 2014, Dennis Poon wrote: I googled and people said there isn't any. Anyone knows? That is because there really isn't any. It is on my todo list. Michael. ___ Michael, Are you the original author

Re: [fpc-pascal] where to find documentation on fgl unit?

2014-09-11 Thread Dennis Poon
Michael Van Canneyt wrote: On Thu, 11 Sep 2014, Dennis Poon wrote: Michael Van Canneyt wrote: On Thu, 11 Sep 2014, Dennis Poon wrote: I googled and people said there isn't any. Anyone knows? That is because there really isn't any. It is on my todo list. Michael

[fpc-pascal] where to find documentation on fgl unit?

2014-09-10 Thread Dennis Poon
I googled and people said there isn't any. Anyone knows? Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Unhandled Exception

2014-09-08 Thread Dennis Poon
Steve Gatenby wrote: I have an intermittant exception in my Lazarus app (Access violation) My app also uses a freepascal library - I think the problem is within it Can anybody suggest the best way to narrow this down to a unit / function / line ? I believe I have the Frame stack captured,

Re: [fpc-pascal] Improved array initialization in Delphi XE7

2014-09-03 Thread Dennis Poon
Sven Barth wrote: Hello together! Just today I've read that Delphi XE7 has introduced an improved array initialization and even in a way that I already planned to introduce it myself in FPC. That Embarcadero introduced this in Delphi is now of course a legitimate (:P) reason to introduce

[fpc-pascal] how to convert C++ header to fpc

2014-08-14 Thread Dennis Poon
I don't know much about c++ and but I got this dll with the following header that I need to use its dll. #define SPDLLCALL __stdcall typedef void (SPDLLCALL *LoginReplyAddr)(long ret_code, char *ret_msg); typedef void (SPDLLCALL *p_SPAPI_RegisterLoginReply)(LoginReplyAddr addr); #endif

Re: [fpc-pascal] how to convert C++ header to fpc

2014-08-14 Thread Dennis Poon
Victor Matuzenko wrote: 14.08.2014 19:31, Dennis Poon пишет: I don't know much about c++ and but I got this dll with the following header that I need to use its dll. #define SPDLLCALL __stdcall typedef void (SPDLLCALL *LoginReplyAddr)(long ret_code, char *ret_msg); typedef void

[fpc-pascal] why dynamic array created in constructor not automatically free in destructor

2014-08-07 Thread Dennis Poon
I have a class like; TMyClass=class public ar : array of integer; constructor Create; destructor destroy;override; end; TMyClass.Create; begin inherited; SetLength(ar, 100); end; TMyClass.Destroy; begin ar := nil;//--- this is needed otherwise a memory leak is

[fpc-pascal] TImage : how to avoid flickering when changing image

2014-08-05 Thread Dennis Poon
every few seconds, I want the same TImage to load a different jpg file but now it flickers whenever TheImage.Picture.LoadFromFile('new.jpg'); How do I avoid the flickering? Dennis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] How to play H264 mp4 video using free pascal?

2014-07-23 Thread Dennis Poon
Graeme Geldenhuys wrote: On 2014-07-22 12:19, Dennis Poon wrote: what library (e.g. ffmpeg) should I call? Michael van Canneyt did some work for us where we implemented libVLC support (playing videos and sounds using the VLC backend). The code was added to the Free Pascal project as far as I

Re: [fpc-pascal] How to play H264 mp4 video using free pascal?

2014-07-23 Thread Dennis Poon
Fabio Luis Girardi wrote: Start omxplayer with tprocess and use pipes to do this Em 22/07/2014 08:30, Dennis Poon den...@avidsoft.com.hk mailto:den...@avidsoft.com.hk escreveu: what library (e.g. ffmpeg) should I call? any example e.g. of it? Actually, the target platform

[fpc-pascal] How to play H264 mp4 video using free pascal?

2014-07-22 Thread Dennis Poon
what library (e.g. ffmpeg) should I call? any example e.g. of it? Actually, the target platform is Raspberry Pi (raspbian OS). It comes with a video player that does it (omxplayer) but I don't know how to interface with it apart from launching it. After launch, I don't know how to pause it

Re: [fpc-pascal] Free pascal candidate for project of the month

2014-03-27 Thread Dennis Poon
Mark Morgan Lloyd wrote: Marco van de Voort wrote: FYI: Free Pascal is candidate for SF project of the month april, up against strong candidates as subversion for windows (the server, not tortoise) and smplayer. That's a pretty strong field, but with no clear winner. I guess we should

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

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

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

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?

[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

[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

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

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

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

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

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

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

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

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

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

  1   2   >