Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2012-08-30 Thread tcoq
Thank you but I am a professional trainer for C++, Java, Ada and other languages including Lisp. I am "used to" those languages. I consistently see young professionals stumble upon those constructs they are "used to". Furthermore, all the professional users of the developed software are not "use

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2012-08-30 Thread tcoq
0:18:31 Objet: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal tcoq wrote > > a laziness to software design: what you can't name you actually don't > design... > Guess you meant "don't want to" instead of "can't" And You mean a

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2012-08-30 Thread tcoq
I beg to differ. Read Niklaus' work on why he created Pascal: two objectives stand out : readability and ease-of-compiling. He wrote explicitly he wanted a language he could easily write his compiler in... Sorry rigidity is not part of the original Pascal mandate. Look at Modula and the more re

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2012-08-30 Thread tcoq
+1 - anonymous functions demonstrate a laziness to software design: what you can't name you actually don't design... - Mail original - De: "Ralf A. Quint" À: "FPC-Pascal users discussions" Envoyé: Jeudi 30 Août 2012 09:26:27 Objet: Re: [fpc-pascal] Re: Delphi's anonymous functions in Fr

Re: [fpc-pascal] How to poll for a byte in Input?

2011-12-15 Thread tcoq
reiber" À: fpc-pascal@lists.freepascal.org Envoyé: Samedi 10 Décembre 2011 18h50:09 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [fpc-pascal] How to poll for a byte in Input? On 12/10/2011 02:58 PM, tcoq wrote: > Chad, > Thank you very much. I will try

Re: [fpc-pascal] How to poll for a byte in Input?

2011-12-10 Thread tcoq
ad Berchek" À: "FPC-Pascal users discussions" Envoyé: Samedi 10 Décembre 2011 04h37:51 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [fpc-pascal] How to poll for a byte in Input? On 12/9/2011 9:44 AM, tcoq wrote: > Hello, > I'm trying to

Re: [fpc-pascal] How to poll for a byte in Input?

2011-12-10 Thread tcoq
Thanks Michael, I also tried with a 20 ms delay. No success. Still investigating. - Mail Original - De: "Michael Van Canneyt" À: "FPC-Pascal users discussions" Envoyé: Vendredi 9 Décembre 2011 22h51:01 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [fpc-pas

Re: [fpc-pascal] How to poll for a byte in Input?

2011-12-09 Thread tcoq
; However, WaitForSingleObject always gives back 0, meaning there should be information. My logging tells me that information arrives at least 500ms afterwards and that ReadByte waits for it. Something is not working. Thierry - Mail Original - De: "tcoq" À: "FPC-Pascal us

Re: [fpc-pascal] How to poll for a byte in Input?

2011-12-09 Thread tcoq
On windows, I did not find WaitForSingleObject, which is actually going to wait for the file. However I found ReadFileEx in the Windows API, which is an asynchronous read on the file. I'll try using that. - Mail Original - De: "Michael Van Canneyt" À: "FPC-Pascal users discussions" Env

Re: [fpc-pascal] How to poll for a byte in Input?

2011-12-09 Thread tcoq
Thanks Michael, I'll try that! Thierry - Mail Original - De: "Michael Van Canneyt" À: "FPC-Pascal users discussions" Envoyé: Vendredi 9 Décembre 2011 16h57:47 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [fpc-pascal] How to poll for a byte in Input? ... Y

[fpc-pascal] How to poll for a byte in Input?

2011-12-09 Thread tcoq
Hello, I'm trying to poll the input stream to see whether there is a new character available, without blocking my software. I've tried "Read" and "THandleStream.ReadByte" but with no success: when the input is empty, the program just waits. Is there a way to ask whether the input stream is not e

Re: [fpc-pascal] How to document fpcunit test cases, so that they appear in the XML

2011-11-11 Thread tcoq
Michael, Thank you very much, I'll do that. I was hoping somebody else had already had the same needs as myself. Best regards, Thierry - Mail Original - De: "Michael Van Canneyt" À: "FPC-Pascal users discussions" Envoyé: Vendredi 11 Novembre 2011 13h48:42 GMT +01:00 Amsterdam / Berlin /

[fpc-pascal] How to document fpcunit test cases, so that they appear in the XML

2011-11-11 Thread tcoq
Hello, I would like to add additional information to the test cases. I'm using FPCUnit. Is there a way to document the test cases? For example, to describe the test case, to link to the verified requirement, to link to a (Mantis) defect, to link to a test management system (such as Salome: https

Re: [fpc-pascal] The best approaching for templating

2011-11-09 Thread tcoq
Dear Luciano. I would suggest using the StringReplace function (Sysutiles) in combination with a TStringList. Easy to do and quite powerful. You can also use a second string list to store the values and patterns to replace, using the Names and Values properties, so that you can do multiple succe

Re: [fpc-pascal] Generics vs TCollection

2011-11-09 Thread tcoq
It's also possible to create a generic descendent of TCollection, where the only duplicated code is the property override. This is probably the best of both worlds: reusing the TCollection while moving to generics. Best regards Thierry - Mail Original - De: "michael vancanneyt" À: "FPC-P

Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-25 Thread tcoq
+1 - Mail Original - De: "Graeme Geldenhuys" À: "FPC-Pascal users discussions" Envoyé: Vendredi 21 Octobre 2011 10h03:27 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal On 2011-10-20 22:55, Florian

Re: [fpc-pascal] How are Assigned, Free, Nil and Destroy related?

2011-10-22 Thread tcoq
Hello, Instead of .Free in your FreeVars routine, you should use FreeAndNil( theobject). The correct lifecycle for class objects is : var anObject : TMyObject; begin anObject := nil; //not needed for class attributes. Required for local function or global unit variables. anObject := TMyObj

Re: Re: [fpc-pascal] PPUMove usage, follow-up: it works on Linux.

2010-08-15 Thread tcoq
Hello, Thanks for the quick answer. ... >In general, creating a (non-DDL-style) shared library with FPC is currently >not supported on any platform. There are still some patches in the bug >tracker that I have to apply to fix the Linux support >(http://bugs.freepascal.org/view.php?id=12492), but

[fpc-pascal] PPUMove usage, follow-up: it works on Linux.

2010-08-15 Thread tcoq
Hello all, This is a follow-up message on yesterday's about making shared libraries with units, using the ppumove tool. Trying the ppumove procedure on an Ubuntu platform works perfectly. I used the same test.pp code. It compiled with "fpc -Cg" and produced test.o and a test.ppu files. the "ppumo

[fpc-pascal] how to use ppumove to create a shared library from units?

2010-08-14 Thread tcoq
Hello, I'm trying to use ppumove as described in the documentation to create a shared library from a set of FPC units. This is different from creating a DLL by specifying the symbols specially in an export section. However ppumove fails with a message 'cannot export symbol. symbol not found'. I

Re: [fpc-pascal] pointer to anything

2010-04-23 Thread tcoq
1° Using the root class TObject might be a good alternative? Storing any object within the structure is easy. Getting the object back will need a type overwrite. 2° Concerning standard structures, you might want to look at TList, TObjectList, TInterfacedList, TComponentList, TStringList which prov