Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread aradeonas
Interesting,Thank you. I'm not familiar with COM interfaces. Just using {$interfaces com} do the job? Regards, Ara -- http://www.fastmail.com - A no graphics, no pop-ups email service -- ___ Lazarus mailing list

Re: [Lazarus] How to write an eficient lexical scanner/parser?

2015-03-13 Thread silvioprog
On Wed, Mar 11, 2015 at 6:38 AM, leledumbo leledumbo_c...@yahoo.co.id wrote: However, I have a question: is there any article about 'how to write lexical parsers' using Object Pascal? First, you need to differentiate them correctly. Lexical scanner (or simply lexer) and parser, not lexical

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Graeme Geldenhuys
On 2015-03-13 16:50, aradeonas wrote: Graeme I tested your way but you cant get property values with this way See my slightly modified test.pas program from earlier. It seems that using COM and 'as' is the preferred way when you want an object instance from an interface reference. I never

Re: [Lazarus] Do you lessen to music?When?What?How?

2015-03-13 Thread Mattias Gaertner
On Fri, 13 Mar 2015 23:25:28 +0330 Xirax Xirax xiraxxirax...@gmail.com wrote: For my own research I need to ask some personal question from developers to know their music habits,I hope you help me : Do you lessen to music Or radio? When you lessen?While working? What genre or channels?

[Lazarus] Do you lessen to music?When?What?How?

2015-03-13 Thread Xirax Xirax
For my own research I need to ask some personal question from developers to know their music habits,I hope you help me : Do you lessen to music Or radio? When you lessen?While working? What genre or channels? How?Shuffle or a custom play list or by album or artist? How?What player do you use?PC

Re: [Lazarus] Do you lessen to music?When?What?How?

2015-03-13 Thread Xirax Xirax
Thank you.I didn't know there is a one. On Fri, Mar 13, 2015 at 11:42 PM, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Fri, 13 Mar 2015 23:25:28 +0330 Xirax Xirax xiraxxirax...@gmail.com wrote: For my own research I need to ask some personal question from developers to know

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Graeme Geldenhuys
On 2015-03-13 17:47, aradeonas wrote: Just using {$interfaces com} do the job? Yes, and COM interfaces are reference counted by default. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ --

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread aradeonas
Excuse me Michael, I didn't know what top-posting mean until now[1].(Why is it impolite,I ask because really I don't know and thank you for mention it). About question: What you suggest for this need: We have types of file that have some shared properties like name and size but have more like

Re: [Lazarus] How to cast a Interface to a Object in Lazarus

2015-03-13 Thread aradeonas
OK,So in the end how can I cast a Interface to a Object in Lazarus? Regards, Ara -- http://www.fastmail.com - The way an email service should be -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Michael Van Canneyt
On Fri, 13 Mar 2015, Martin Schreiber wrote: On Friday 13 March 2015 10:49:43 aradeonas wrote: OK,So in the end how can I cast a Interface to a Object in Lazarus? I usually add a function getinstance(): theBaseImplemetationClass to the interface definition. Which goes completely against

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Graeme Geldenhuys
On 2015-03-13 10:06, Michael Van Canneyt wrote: Which goes completely against the very purpose of interfaces. +1 I've used interface for many projects over the years, and never needed to do that. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

Re: [Lazarus] [OT] Re: How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Graeme Geldenhuys
On 2015-03-13 10:03, Lukasz Sokol wrote: OOPS :) Apologies for that... No worries. Most email clients allow you to select some text, then click the Reply button, automatically trimming all non-selected text for the reply email. Hence I say it takes one second to trim replies. If your email

[Lazarus] [OT] Re: How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Lukasz Sokol
On 12/03/15 17:12, Graeme Geldenhuys wrote: On 2015-03-12 16:26, Lukasz Sokol wrote: Please avoid top-posting unless you have a grave reason for it (like screen reader requirement). And the old one that NOBODY adheres too Please trim unnecessary quotes - it takes all of ONE SECOND.

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Michael Van Canneyt
On Fri, 13 Mar 2015, aradeonas wrote: OK,So in the end how can I cast a Interface to a Object in Lazarus? You can not. You are not even supposed to be able to do that. You can only query other interfaces from an existing interface. See my first mail: define N interfaces. When you receive

Re: [Lazarus] [OT] Re: How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Michael Van Canneyt
On Fri, 13 Mar 2015, aradeonas wrote: @Martin and @Graeme if it is a sarcasm it is a good one.(Im not good at finding out sarcasm). @Lukasz Im agree with Graeme,The best mail service I ever seen is FastMail (what im using) but its only commercial and I have this account from OperaMail time

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Michael Schnell
On 03/12/2015 06:39 PM, aradeonas wrote: still my problem doesn't solve. Do you really need multiple inheritance (this seems to be the cause why you decided to go with Interfaces instead of pure classes) ? This adds some complexity that in most cases can be avoided. -Michael --

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread aradeonas
Yes I need and I just need casting. Ara On Fri, Mar 13, 2015, at 01:36 AM, Michael Schnell wrote: On 03/12/2015 06:39 PM, aradeonas wrote: still my problem doesn't solve. Do you really need multiple inheritance (this seems to be the cause why you decided to go with Interfaces instead

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread aradeonas
OK,So in the end how can I cast a Interface to a Object in Lazarus? Regards, Ara -- http://www.fastmail.com - Choose from over 50 domains or use your own -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] [OT] Re: How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread aradeonas
@Martin and @Graeme if it is a sarcasm it is a good one.(Im not good at finding out sarcasm). @Lukasz Im agree with Graeme,The best mail service I ever seen is FastMail (what im using) but its only commercial and I have this account from OperaMail time (Really good browser that I still use its

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Michael Schnell
On 03/13/2015 09:46 AM, aradeonas wrote: Yes I need In fact I doubt this. (And don't do top-posing.This is very impolite.) -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Martin Schreiber
On Friday 13 March 2015 10:49:43 aradeonas wrote: OK,So in the end how can I cast a Interface to a Object in Lazarus? I usually add a function getinstance(): theBaseImplemetationClass to the interface definition. BTW, your patience is admirable. :-) Martin --

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Graeme Geldenhuys
On 2015-03-13 10:05, Martin Schreiber wrote: BTW, your patience is admirable. :-) :-D Very true! Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Martin Schreiber
On Friday 13 March 2015 11:06:19 Michael Van Canneyt wrote: On Fri, 13 Mar 2015, Martin Schreiber wrote: On Friday 13 March 2015 10:49:43 aradeonas wrote: OK,So in the end how can I cast a Interface to a Object in Lazarus? I usually add a function getinstance(): theBaseImplemetationClass

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Michael Van Canneyt
On Fri, 13 Mar 2015, aradeonas wrote: Excuse me Michael,   I didn't know what top-posting mean until now.(Why is it impolite,I ask because really I don't know and thank you for mention it). Forums are used for conversations. People sometimes must jump in the conversation without reading

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Michael Van Canneyt
On Fri, 13 Mar 2015, aradeonas wrote: Thank you for explaining,My email serves close all quotes and for this I didn't understand this problem until you said.Thank you.   About question you mean make a File class with name,size,artist,width and all others in one place?If this I didn't like

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Michael Van Canneyt
On Fri, 13 Mar 2015, Martin Schreiber wrote: On Friday 13 March 2015 11:06:19 Michael Van Canneyt wrote: On Fri, 13 Mar 2015, Martin Schreiber wrote: On Friday 13 March 2015 10:49:43 aradeonas wrote: OK,So in the end how can I cast a Interface to a Object in Lazarus? I usually add a

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread aradeonas
Thank you for explaining,My email serves close all quotes and for this I didn't understand this problem until you said.Thank you. About question you mean make a File class with name,size,artist,width and all others in one place?If this I didn't like it,It seem messy,I want to get file,cast it to

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Graeme Geldenhuys
On 2015-03-13 09:39, aradeonas wrote: About question you mean make a File class with name,size,artist,width and all others in one place?If this I didn't like it,It seem messy, I agree, I wouldn't do it that way either. I would have subclasses which gives more specific details of each media

Re: [Lazarus] How to cast a Interface to a Object in Lazarus

2015-03-13 Thread Michael Schnell
On 03/13/2015 10:49 AM, aradeonas wrote: So in the end how can I cast a Interface to a Object in Lazarus? You can't. An interface contains one or more object(s), so you can't cast it to same. -Michael -- ___ Lazarus mailing list

[Lazarus] Does the Lazarus IDE check for the fpc.cfg in the default places on first run?

2015-03-13 Thread vfclists .
Does the Lazarus IDE check for the fpc.cfg in the default places on first run? I built a few instances of Lazarus from source, and although I set the fpc binary to a shell script which had its own fpc.cfg passed to it via the @ parameter, they complained about the missing fpc.cfg until I copied

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Anthony Walter
I'm not sure if this point has been made already, but interface cast (or querying as defined by COM), only works if the interface has a GUID assigned. When this is the case, in delphi and I believe in {$mode delphi} you can cast between object and interfaces like so: procedure Test(Sender:

[Lazarus] Unable to find file staticpackages.inc

2015-03-13 Thread Norbert Crettol
Hello Lazarus community, This is my first post to this mailing-list. Let me first introduce myself: my name is Norbert Crettol, from Switzerland. I'm a former Turbo Pascal user. My first version was Turbo Pascal v.1.0 for CP/M (on Z80 processor). ;-) I've not been doing any Pascal development

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Dmitry Boyarintsev
On Fri, Mar 13, 2015 at 10:21 AM, Graeme Geldenhuys mailingli...@geldenhuys.co.uk wrote: Sorry, but that is a false statement. It works for both COM and CORBA interfaces. Simply don't use the 'as' syntax - just cast it. Wait, how can a syntax work, if not used? :) Don't forget that Pascal

Re: [Lazarus] [OT] Re: How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Martin Schreiber
On Friday 13 March 2015 11:41:53 aradeonas wrote: @Martin and @Graeme if it is a sarcasm it is a good one.(Im not good at finding out sarcasm). No, it is no sarcasm from my side. In Free Pascal community sometimes one needs much patience if one does not comply with the main stream and I think

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Marcos Douglas
On Fri, Mar 13, 2015 at 7:06 AM, Michael Van Canneyt mich...@freepascal.org wrote: On Fri, 13 Mar 2015, Martin Schreiber wrote: On Friday 13 March 2015 10:49:43 aradeonas wrote: OK,So in the end how can I cast a Interface to a Object in Lazarus? I usually add a function getinstance():

Re: [Lazarus] Someone help built qt4pas.dll for win64

2015-03-13 Thread FreeMan
On 12.03.2015 20:57, zeljko wrote: QMAKE_CXXFLAGS += -fpermissive should be added to the Qt4Pas.pro zeljko Thank you, I can compile now. And I added message in forum How to build QT4pas5.dll win64 http://forum.lazarus.freepascal.org/index.php/topic,27706.0.html --

Re: [Lazarus] Unable to find file staticpackages.inc

2015-03-13 Thread Mattias Gaertner
On Fri, 13 Mar 2015 15:48:16 +0100 Norbert Crettol norbert.cret...@gmail.com wrote: [...] This is my first post to this mailing-list. Let me first introduce myself: my name is Norbert Crettol, from Switzerland. I'm a former Turbo Pascal user. My first version was Turbo Pascal v.1.0 for CP/M

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Graeme Geldenhuys
On 2015-03-13 14:52, Dmitry Boyarintsev wrote: Don't forget that Pascal is safe-type language. So as has also intent of checking an interface for being castable to an object instance. As far as I know, that is just one of the differences between COM and CORBA interfaces. I don't presume to

Re: [Lazarus] Does the Lazarus IDE check for the fpc.cfg in the default places on first run?

2015-03-13 Thread Mattias Gaertner
On Fri, 13 Mar 2015 14:46:38 + vfclists . vfcli...@gmail.com wrote: Does the Lazarus IDE check for the fpc.cfg in the default places on first run? For the IDE the first run is when there are no config files in the users config directory. Do you mean that? When the user sets a new compiler

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Dmitry Boyarintsev
On Fri, Mar 13, 2015 at 5:49 AM, aradeonas aradeo...@operamail.com wrote: OK,So in the end how can I cast a Interface to a Object in Lazarus? The syntax show here: http://docwiki.embarcadero.com/RADStudio/XE7/en/Interface_References#Casting_Interface_References_to_Objects works in FPC as well.

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread Graeme Geldenhuys
On 2015-03-13 13:35, Dmitry Boyarintsev wrote: BUT, it would only work, if you're using COM interfaces (wont work corba). Sorry, but that is a false statement. It works for both COM and CORBA interfaces. Simply don't use the 'as' syntax - just cast it. Attached is an example project showing

Re: [Lazarus] Unable to find file staticpackages.inc

2015-03-13 Thread Norbert Crettol
On 13/03/15 16:50, Mattias Gaertner wrote: On Fri, 13 Mar 2015 15:48:16 +0100 Norbert Crettol norbert.cret...@gmail.com wrote: [...] I'm lost. Is that an purely Debian error? That might be. You can try our debian packages from http://sourceforge.net/projects/lazarus/?source=directory

Re: [Lazarus] How to cast a Interface to a Object in Lazaeus

2015-03-13 Thread aradeonas
Thanks Martin. Graeme I tested your way but you cant get property values with this way,if you test code that I sent before showmessage will show nothing. but writeln will work. { IFile } IFile = interface function GetName: string; procedure SetName(AValue: string); property Name: string read

Re: [Lazarus] Someone help built qt4pas.dll for win64

2015-03-13 Thread zeljko
On 03/13/2015 01:38 PM, FreeMan wrote: On 12.03.2015 20:57, zeljko wrote: QMAKE_CXXFLAGS += -fpermissive should be added to the Qt4Pas.pro zeljko Thank you, I can compile now. And I added message in forum How to build QT4pas5.dll win64