[Lazarus] Debug string variant

2015-03-11 Thread aradeonas
Hi,

I have string variant and while debugging I want to get its value but if
I add a watch for it and copy value from Watch list it copy only first
255 character,How can I get full value?

Regards,
Ara

-- 
http://www.fastmail.com - A fast, anti-spam email service.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Debug string variant

2015-03-11 Thread Martin Frb

On 11/03/2015 16:01, aradeonas wrote:

Hi,

I have string variant and while debugging I want to get its value but if
I add a watch for it and copy value from Watch list it copy only first
255 character,How can I get full value?



Looks  like a bug (I get the same problem here, and it is not about 
settnigs.  (There is a settng cetting at 2500 chars, in Tools, Options , 
debugger  look through the property grid.)


Please report on the bugtracker.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Add a MenuItem to a menu dynamically - OnClick: wrong number parameters

2015-03-11 Thread Binho Biatheski
Hello,

Wrong number parameters specified for call to MyPopup

This example works in Delphi but not in Lazarus, what are parameters ?

procedure TForm1.Button1Click(Sender: TObject);
var
  MyItem,MySubItem1: TMenuItem;
  Num: Integer;
begin
  Inc(Num);
  MyItem:=TMenuItem.Create(Self);
  MySubItem1:=TMenuItem.Create(Self);

  MyItem.Caption:='Hello'+IntToStr(Num);
  MySubItem1.Caption:='Good Bye'+IntToStr(Num);

  MainMenu1.Items.Add(MyItem);
  MainMenu1.Items[0].Insert(num-1,MySubItem1);

  MyItem.OnClick:=MyPopUp;
  MySubItem1.OnClick:=MyPopUp;
end;

procedure TForm1.MyPopup(Sender: TObject);
begin
  with Sender as TMenuItem do ShowMessage(Caption);
end;


-- 
Binho
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


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

2015-03-11 Thread Lukasz Sokol
On 11/03/15 11:57, Mehmet Erol Sanliturk wrote:
 
 
[...]
 
 
 When there is NO license information in your repositories , this means that
 
 NO one can use them .
 
 with respect to copy right laws or conventions .
 

Pointer/Keyword/URL please? I presume for when it matters, one would ask the 
author first...?

 
 Thank you very much .
 
 Mehmet Erol Sanliturk
 

el es


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Debug string variant

2015-03-11 Thread Martin Frb

On 11/03/2015 16:33, Martin Frb wrote:

On 11/03/2015 16:01, aradeonas wrote:

Hi,

I have string variant and while debugging I want to get its value but if
I add a watch for it and copy value from Watch list it copy only first
255 character,How can I get full value?



Looks  like a bug (I get the same problem here, and it is not about 
settnigs.  (There is a settng cetting at 2500 chars, in Tools, Options 
, debugger  look through the property grid.)


Please report on the bugtracker.



Just checked. Use the evaluate/modify dialog.

It shows the full length.

If needed increase the 2500 in the options.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Add a MenuItem to a menu dynamically - OnClick: wrong number parameters

2015-03-11 Thread Felipe Monteiro de Carvalho
Add @ to procedure names:

   MyItem.OnClick:=@MyPopUp;
   MySubItem1.OnClick:=@MyPopUp;


-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread leledumbo
 But why they aren't in one mode?I mean all the good stuff in one mode? 

Because some of them are intersecting:
- Generics syntax in ObjFPC and Delphi mode are different
- Integer = SmallInt in TP/FPC mode, but LongInt in ObjFPC/Delphi mode

continue the list yourself by reading the docs



--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Choose-compiler-mode-tp4041075p4041094.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Add a MenuItem to a menu dynamically - OnClick: wrong number parameters

2015-03-11 Thread Graeme Geldenhuys
On 2015-03-11 16:39, Felipe Monteiro de Carvalho wrote:
MyItem.OnClick:=@MyPopUp;
MySubItem1.OnClick:=@MyPopUp;

More specifically... it depends of the compiler mode. Is the source code
shared between Lazarus and Delphi? If so you probably want to use the
delphi mode at the top of the unit. Then no @ prefix is required.
  {$mode delphi}

If the code is Lazarus only, then you probably want the objfpc mode - at
which point you need to add the @ prefix to the event handler as quoted
above.
  {$mode objfpc}


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Add a MenuItem to a menu dynamically - OnClick: wrong number parameters

2015-03-11 Thread Binho Biatheski
Thank you !!!

2015-03-11 13:39 GMT-03:00 Felipe Monteiro de Carvalho 
felipemonteiro.carva...@gmail.com:

 Add @ to procedure names:

MyItem.OnClick:=@MyPopUp;
MySubItem1.OnClick:=@MyPopUp;


 --
 Felipe Monteiro de Carvalho

 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




-- 
Binho
http://www.biatheski.com
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


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

2015-03-11 Thread leledumbo
 When there is NO license information in your repositories , this means that 
 
 NO one can use them .
 
 with respect to copy right laws or conventions .

No idea with what's default by law or convention, but when I give no
license, consider it public domain.



--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-to-write-an-eficient-lexical-scanner-parser-tp4041002p4041093.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread aradeonas
Ok,Thank you.

Ara

On Wed, Mar 11, 2015, at 08:21 AM, leledumbo wrote:
  But why they aren't in one mode?I mean all the good stuff in one mode? 
 
 Because some of them are intersecting:
 - Generics syntax in ObjFPC and Delphi mode are different
 - Integer = SmallInt in TP/FPC mode, but LongInt in ObjFPC/Delphi mode
 
 continue the list yourself by reading the docs
 
 
 
 --
 View this message in context:
 http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Choose-compiler-mode-tp4041075p4041094.html
 Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-- 
http://www.fastmail.com - Faster than the air-speed velocity of an
  unladen european swallow


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread Michael Van Canneyt



On Wed, 11 Mar 2015, Marco van de Voort wrote:


On Wed, Mar 11, 2015 at 10:55:07AM +0100, Michael Van Canneyt wrote:

ModeSwitch is interesting.
But why they aren't in one mode?I mean all the good stuff in one mode?


What is 'good stuff' ? That depends on the person.

Also: you may want to control compatibility. If we added stuff that we think is 
fun,
someone uses it in e.g. delphi mode without realizing Delphi doesn't support it,
and suddenly his code no longer compiles in Delphi...


Mode Delphi doesn't even try to enforce delphi compatibility, so IMHO that
is a stretch.


Please elaborate ?

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


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

2015-03-11 Thread Mehmet Erol Sanliturk
On Wed, Mar 11, 2015 at 12:13 PM, Virgo Pärna virgo.pa...@mail.ee wrote:

 On Wed, 11 Mar 2015 08:18:35 -0700 (MST), leledumbo 
 leledumbo_c...@yahoo.co.id wrote:
 
  No idea with what's default by law or convention, but when I give no
  license, consider it public domain.
 

 By default author has copyright and sole right to redistribute. And
 that's what applies, when nothing else is declared.

 --
 Virgo Pärna
 virgo.pa...@mail.ee


 --
 ___




Yes , the correct understanding is the above sentence . Without explicit
declaration , nothing can be assumed implicitly that is permitted , i.e.
, permission requires to be explicit .


Mehmet Erol Sanliturk
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread Marco van de Voort
On Wed, Mar 11, 2015 at 10:55:07AM +0100, Michael Van Canneyt wrote:
  ModeSwitch is interesting.
  But why they aren't in one mode?I mean all the good stuff in one mode?
 
 What is 'good stuff' ? That depends on the person.
 
 Also: you may want to control compatibility. If we added stuff that we think 
 is fun,
 someone uses it in e.g. delphi mode without realizing Delphi doesn't support 
 it, 
 and suddenly his code no longer compiles in Delphi...

Mode Delphi doesn't even try to enforce delphi compatibility, so IMHO that
is a stretch.

I would welcome a setting to generate $mode delphi units by default.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


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

2015-03-11 Thread Mehmet Erol Sanliturk
On Wed, Mar 11, 2015 at 7:58 AM, Lukasz Sokol el.es...@gmail.com wrote:

 On 11/03/15 11:57, Mehmet Erol Sanliturk wrote:
 
 
 [...]
 
 
  When there is NO license information in your repositories , this means
 that
 
  NO one can use them .
 
  with respect to copy right laws or conventions .
 

 Pointer/Keyword/URL please? I presume for when it matters, one would ask
 the author first...?

 
  Thank you very much .
 
  Mehmet Erol Sanliturk
 

 el es


 --
 ___




http://en.wikipedia.org/wiki/Copyright
http://en.wikipedia.org/wiki/Copyright_infringement
http://en.wikipedia.org/wiki/Public_domain


http://en.wikipedia.org/wiki/Software_license
http://en.wikipedia.org/wiki/Public_domain_software
http://en.wikipedia.org/wiki/Software_copyright
http://en.wikipedia.org/wiki/License-free_software


Personal use is a different concept , because no one may know that a copy
is used whether usage is permitted or not for a copyrighted work .

Problem arises when Redistribution or ( Derivative works are
Published ) .

One is the following :

http://www.acm.org/publications/policies/softwarecrnotice


Some of these collected software published before a year in US , is in
Public Domain in the US with respect to a law  ( I do not remember the
year exactly but it is around 1970 ) .
ACM has denied this Public Domain concept by countering it with
Copyright Law :

More restrictive rules are effective even they ( restrictive and permissive
) are in the laws for the copyright holder .

In summary , with respect to copyright laws ( there are minor differences
in countries as related to Bern Convention agreement exceptions adopted )
anything is not explicitly mentioned is assumed to be not permitted .


Mehmet Erol Sanliturk
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


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

2015-03-11 Thread Virgo Pärna
On Wed, 11 Mar 2015 08:18:35 -0700 (MST), leledumbo 
leledumbo_c...@yahoo.co.id wrote:

 No idea with what's default by law or convention, but when I give no
 license, consider it public domain.


By default author has copyright and sole right to redistribute. And
that's what applies, when nothing else is declared.

-- 
Virgo Pärna 
virgo.pa...@mail.ee


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


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

2015-03-11 Thread Mark Morgan Lloyd

leledumbo wrote:
When there is NO license information in your repositories , this means that 


NO one can use them .

with respect to copy right laws or conventions .


No idea with what's default by law or convention, but when I give no
license, consider it public domain.


I'd imagine that application of the law would vary depending on 
jurisdiction, and it might be unintentionally affected by the stated 
policy of wherever the files are posted.


However the /correct/ thing to do would be to look at the import list 
and to adopt whatever license is implied by the libraries and 
documentation sources that are referenced. If a body of code imports 
(only) libraries which conform to any of the recognised free (as in 
speech) licenses, then an unqualified no one can use them is not a 
reasonable conclusion.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Debug string variant

2015-03-11 Thread aradeonas
Thanks I found it.
Debugging is what I miss from Delphi,With Delphi its just piece of cake.
You can use lens button (left of properties button in watch list form)
but it doesn't support Ctrl-A.

Thank you for your help,
Ara

On Wed, Mar 11, 2015, at 09:40 AM, Martin Frb wrote:
 On 11/03/2015 16:33, Martin Frb wrote:
  On 11/03/2015 16:01, aradeonas wrote:
  Hi,
 
  I have string variant and while debugging I want to get its value but if
  I add a watch for it and copy value from Watch list it copy only first
  255 character,How can I get full value?
 
 
  Looks  like a bug (I get the same problem here, and it is not about 
  settnigs.  (There is a settng cetting at 2500 chars, in Tools, Options 
  , debugger  look through the property grid.)
 
  Please report on the bugtracker.
 
 
 Just checked. Use the evaluate/modify dialog.
 
 It shows the full length.
 
 If needed increase the 2500 in the options.
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-- 
http://www.fastmail.com - A no graphics, no pop-ups email service


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] HTML on clipboard

2015-03-11 Thread Michael Thompson
G'day,

Just found this code on the wiki...
http://wiki.lazarus.freepascal.org/Office_Automation#Copy_HTML_to_the_clipboard

On Windows with Microsoft products at least, this doesn't work...  What's
required is more complex:
https://msdn.microsoft.com/en-us/library/aa767917%28v=vs.85%29.aspx

However, I can't see that code being posted onto the wiki without testing,
so before I correct the wiki, I'd like to know under what conditions the
wiki code is good for...

I think it was Mattias that submitted that code to the wiki...

Mattias: Do you know or remember which platforms and applications that code
worked with?

I'm thinking that the code on the wiki is probably good for Linux and
possibly Mac, and am just looking for confirmation before I update the
wiki...

Cheers

Mike
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread Mattias Gaertner
On Wed, 11 Mar 2015 21:32:51 +0100
Marco van de Voort mar...@stack.nl wrote:

[...]
 I would welcome a setting to generate $mode delphi units by default.

If you mean in Lazarus:
Project Options / Compiler Options / Parsing Syntax Mode

Set this to Delphi. When you create a new unit it creates {$mode
delphi}.


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] HTML on clipboard

2015-03-11 Thread Michael Thompson
Mattias Gaertner nc-gaert...@netcologne.de wrote:
 Michael Thompson mike.cornfl...@gmail.com wrote:
  Mattias: Do you know or remember which platforms and applications that
code
  worked with?

 AFAIR an example is Linux, OpenOffice.
 I don't know if OO still supports this.

Sweet. I've left the original code in as a quick google shows at least
several python libraries out there that use the the 'text/html' mime on the
clipboard as well, so there's possibly more targets than just OO.

Thanks for the quick reply.

Mike
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] HTML on clipboard

2015-03-11 Thread Mattias Gaertner
On Thu, 12 Mar 2015 11:11:55 +1300
Michael Thompson mike.cornfl...@gmail.com wrote:

 G'day,
 
 Just found this code on the wiki...
 http://wiki.lazarus.freepascal.org/Office_Automation#Copy_HTML_to_the_clipboard
 
 On Windows with Microsoft products at least, this doesn't work...  What's
 required is more complex:
 https://msdn.microsoft.com/en-us/library/aa767917%28v=vs.85%29.aspx
 
 However, I can't see that code being posted onto the wiki without testing,
 so before I correct the wiki, I'd like to know under what conditions the
 wiki code is good for...
 
 I think it was Mattias that submitted that code to the wiki...
 
 Mattias: Do you know or remember which platforms and applications that code
 worked with?

AFAIR an example is Linux, OpenOffice.
I don't know if OO still supports this.

 
 I'm thinking that the code on the wiki is probably good for Linux and
 possibly Mac, and am just looking for confirmation before I update the
 wiki...


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Compare record

2015-03-11 Thread Jürgen Hestermann

Am 2015-03-10 um 22:23 schrieb aradeonas:
 How can I compare two record?
 Like this :
 type
 TRec=record
 na:string;
 end;

 var
 R1,R2:TRec;
 Begin
 R1.na:='A';
 R2.na:='B';

 if R1R2 then
 Showmessage('Error')

In your example you would not need the record
if it consists of only one string component.
But you can write:

if R1.naR2.na then
   Showmessage('Error')

In general there cannot be a standard
compare function for records because
you can have a lot of different types
within a record. So you need to write
your own compare function.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Choose compiler mode

2015-03-11 Thread aradeonas
Hi,

After times I used Lazarus I still have a question about compiler mode.
Why there is 5 mode?What can I do when I want objfpc mode benefits that
is Lazarus default but for example I want advanced record syntax that
can used with Delphi mode?
Can any one explain it to me or  link me to a source?

Regards,
Ara

-- 
http://www.fastmail.com - IMAP accessible web-mail


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Compare record

2015-03-11 Thread aradeonas
Thank you Jürgen,That is just a example but Its good to know there is
now way.
Thank you Sven for examples.I didn't know about advanced record support.

Regards,
Ara

On Tue, Mar 10, 2015, at 11:43 PM, Sven Barth wrote:
 On 10.03.2015 22:23, aradeonas wrote:
  Hi,
  How can I compare two record?
  Like this :
 
  type
  TRec=record
  na:string;
  end;
 
  var
  R1,R2:TRec;
  Begin
  R1.na:='A';
  R2.na:='B';
  if R1R2 then
  Showmessage('Error')
 
 At the declaration of TRec add this:
 
 === code begin ===
 
 operator = (aLeft, aRight: TRec): Boolean;
 
 === code end ===
 
 and then implement it like this:
 
 === code begin ===
 
 operator = (aLeft, aRight: TRec): Boolean;
 begin
Result := aLeft.na = aRight.na;
 end;
 
 === code end ===
 
 Alternatively you can declare the operator inside TRec if you enable 
 modeswitch advancedrecords:
 
 === code begin ===
 type
TRec = record
  na: String;
  class operator = (aLeft, aRight: TRec): Boolean;
end;
 
 === code end ===
 
 Implementation:
 
 === code begin ===
 
 class operator TRec.=(aLeft, aRight: TRec): Boolean;
 begin
Result := aLeft,na = aRight.na;
 end;
 
 === code end ===
 
 This /should/ work though I did not test it by compilation.
 
 Regards,
 Sven
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-- 
http://www.fastmail.com - Choose from over 50 domains or use your own


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Compare record

2015-03-11 Thread Sven Barth

On 10.03.2015 22:23, aradeonas wrote:

Hi,
How can I compare two record?
Like this :

type
TRec=record
na:string;
end;

var
R1,R2:TRec;
Begin
R1.na:='A';
R2.na:='B';
if R1R2 then
Showmessage('Error')


At the declaration of TRec add this:

=== code begin ===

operator = (aLeft, aRight: TRec): Boolean;

=== code end ===

and then implement it like this:

=== code begin ===

operator = (aLeft, aRight: TRec): Boolean;
begin
  Result := aLeft.na = aRight.na;
end;

=== code end ===

Alternatively you can declare the operator inside TRec if you enable 
modeswitch advancedrecords:


=== code begin ===
type
  TRec = record
na: String;
class operator = (aLeft, aRight: TRec): Boolean;
  end;

=== code end ===

Implementation:

=== code begin ===

class operator TRec.=(aLeft, aRight: TRec): Boolean;
begin
  Result := aLeft,na = aRight.na;
end;

=== code end ===

This /should/ work though I did not test it by compilation.

Regards,
Sven

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Compare record

2015-03-11 Thread Mattias Gaertner
On Wed, 11 Mar 2015 10:02:36 +0100
Michael Schnell mschn...@lumino.de wrote:

 On 03/11/2015 08:57 AM, aradeonas wrote:
 
 
  operator = (aLeft, aRight: TRec): Boolean;
 
 I get Logical Operator not supported.

As Sven wrote:
Alternatively you can declare the operator inside TRec if you enable 
modeswitch advancedrecords

It means:
{$modeswitch advancedrecords}

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Compare record

2015-03-11 Thread Michael Schnell

On 03/11/2015 08:57 AM, aradeonas wrote:

operator = (aLeft, aRight: TRec): Boolean;
Seemingly with operator =,  operator  is automatically overloaded. 
Nonetheless it is possible to do your own (contradicting) operator  
if you like :-) .


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Compare record

2015-03-11 Thread Michael Schnell

On 03/11/2015 08:57 AM, aradeonas wrote:



operator = (aLeft, aRight: TRec): Boolean;


I get Logical Operator not supported.

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread leledumbo
 Can any one explain it to me or  link me to a source? 

http://www.freepascal.org/docs-html/user/userse33.html
http://www.freepascal.org/docs-html/prog/progap4.html
http://www.freepascal.org/docs-html/prog/progsu106.html



--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Choose-compiler-mode-tp4041075p4041079.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread aradeonas
ModeSwitch is interesting.
But why they aren't in one mode?I mean all the good stuff in one mode?

Regards,
Ara

On Wed, Mar 11, 2015, at 02:35 AM, Mattias Gaertner wrote:
 On Wed, 11 Mar 2015 10:20:54 +0100
 Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:
 
  On Wed, Mar 11, 2015 at 9:02 AM, aradeonas aradeo...@operamail.com wrote:
   What can I do when I want objfpc mode benefits that
   is Lazarus default but for example I want advanced record syntax that
   can used with Delphi mode?
  
  Split your unit in 2: one in objfpc mode and another in delphi mode.
 
 Or use {$ModeSwitch advancedrecords}.
 
 
 Mattias
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-- 
http://www.fastmail.com - Does exactly what it says on the tin


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread Felipe Monteiro de Carvalho
On Wed, Mar 11, 2015 at 9:02 AM, aradeonas aradeo...@operamail.com wrote:
 What can I do when I want objfpc mode benefits that
 is Lazarus default but for example I want advanced record syntax that
 can used with Delphi mode?

Split your unit in 2: one in objfpc mode and another in delphi mode.

-- 
Felipe Monteiro de Carvalho

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread Mattias Gaertner
On Wed, 11 Mar 2015 10:20:54 +0100
Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:

 On Wed, Mar 11, 2015 at 9:02 AM, aradeonas aradeo...@operamail.com wrote:
  What can I do when I want objfpc mode benefits that
  is Lazarus default but for example I want advanced record syntax that
  can used with Delphi mode?
 
 Split your unit in 2: one in objfpc mode and another in delphi mode.

Or use {$ModeSwitch advancedrecords}.


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread Michael Van Canneyt



On Wed, 11 Mar 2015, aradeonas wrote:


ModeSwitch is interesting.
But why they aren't in one mode?I mean all the good stuff in one mode?


What is 'good stuff' ? That depends on the person.

Also: you may want to control compatibility. If we added stuff that we think is 
fun,
someone uses it in e.g. delphi mode without realizing Delphi doesn't support it, 
and suddenly his code no longer compiles in Delphi...


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Compare record

2015-03-11 Thread Michael Schnell

On 03/11/2015 10:02 AM, Michael Schnell wrote:


I get Logical Operator not supported.


I do have:

{$mode objfpc}{$H+}


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Compare record

2015-03-11 Thread Michael Schnell

On 03/11/2015 10:02 AM, Michael Schnell wrote:

I get Logical Operator not supported.


I found that seemingly overloading an operator is not allowed within a 
procedure, while defining a type is allowed.


Is this a bug or a feature ?

Anyway, the error message is a bit misleading

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


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

2015-03-11 Thread leledumbo
 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 parser :)

I've written some simple languages, generating GraphViz, LLVM or C code,
using both self learning reference from the almighty Prof. Niklaus Wirth's
articles, Jack Crenshaw's, the legendary dragon book and many others plus my
compiler course in college.

I really really suggest Prof. Niklaus Wirth's one
(http://www.inf.ethz.ch/personal/wirth/, click the Compiler Construction
link) as it's concise, simple, doesn't use stupid generator (i.e.: easy to
implement by hand) while covering most important parts of the subject. While
he didn't use or stress or even discourage the usage of abstract syntax
tree, he did explain it that's good enough to understand.

Here's what I've written in the past and is publicly available:
- https://bitbucket.org/leledumbo/erd-maker (generates GraphViz code for ERD
visualization)
- https://bitbucket.org/leledumbo/linguc (generates LLVM code that can be
compiled as a library for a mathematically provable language focusing in
database driven application)

I don't use the direct code generation approach anymore as I found the
abstract syntax tree to be usable for more than just code generation.



--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-to-write-an-eficient-lexical-scanner-parser-tp4041002p4041083.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Compare record

2015-03-11 Thread Michael Schnell

On 03/11/2015 10:31 AM, Mattias Gaertner wrote:
Alternatively you can declare the operator inside TRec if you enable 
modeswitch advancedrecords It means: {$modeswitch advancedrecords} 

Nice ! (I tested this but forgot the mode switch ;) )

Why is this mode not the default ?

-Michael



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Choose compiler mode

2015-03-11 Thread aradeonas
Like advancedrecords,
For many developers like me that Lazarus is going to be his/her main IDE
and dont care code compatible with Delphi these are boring.
For example Im using Delphi for 10 years and from the time Im using
Lazarus I never need comparability.
I mean while Lazarus and FPC are going to be bigger its good to have a
mode with all good stuff (again like advancedrecords in one place).
But what I know! Im new here.

Regards,
Ara

On Wed, Mar 11, 2015, at 02:49 AM, aradeonas wrote:
 ModeSwitch is interesting.
 But why they aren't in one mode?I mean all the good stuff in one mode?
 
 Regards,
 Ara
 
 On Wed, Mar 11, 2015, at 02:35 AM, Mattias Gaertner wrote:
  On Wed, 11 Mar 2015 10:20:54 +0100
  Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:
  
   On Wed, Mar 11, 2015 at 9:02 AM, aradeonas aradeo...@operamail.com 
   wrote:
What can I do when I want objfpc mode benefits that
is Lazarus default but for example I want advanced record syntax that
can used with Delphi mode?
   
   Split your unit in 2: one in objfpc mode and another in delphi mode.
  
  Or use {$ModeSwitch advancedrecords}.
  
  
  Mattias
  
  --
  ___
  Lazarus mailing list
  Lazarus@lists.lazarus.freepascal.org
  http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
 
 -- 
 http://www.fastmail.com - Does exactly what it says on the tin
 
 
 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-- 
http://www.fastmail.com - Faster than the air-speed velocity of an
  unladen european swallow


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


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

2015-03-11 Thread Mehmet Erol Sanliturk
On Wed, Mar 11, 2015 at 2: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 parser :)

 I've written some simple languages, generating GraphViz, LLVM or C code,
 using both self learning reference from the almighty Prof. Niklaus Wirth's
 articles, Jack Crenshaw's, the legendary dragon book and many others plus
 my
 compiler course in college.

 I really really suggest Prof. Niklaus Wirth's one
 (http://www.inf.ethz.ch/personal/wirth/, click the Compiler Construction
 link) as it's concise, simple, doesn't use stupid generator (i.e.: easy to
 implement by hand) while covering most important parts of the subject.
 While
 he didn't use or stress or even discourage the usage of abstract syntax
 tree, he did explain it that's good enough to understand.

 Here's what I've written in the past and is publicly available:
 - https://bitbucket.org/leledumbo/erd-maker (generates GraphViz code for
 ERD
 visualization)
 - https://bitbucket.org/leledumbo/linguc (generates LLVM code that can be
 compiled as a library for a mathematically provable language focusing in
 database driven application)

 I don't use the direct code generation approach anymore as I found the
 abstract syntax tree to be usable for more than just code generation.



 --
 View this message in context:
 http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-to-write-an-eficient-lexical-scanner-parser-tp4041002p4041083.html
 Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

 --
 ___




When there is NO license information in your repositories , this means that

NO one can use them .

with respect to copy right laws or conventions .


Thank you very much .

Mehmet Erol Sanliturk
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Someone help built qt4pas.dll for win64

2015-03-11 Thread FreeMan

I attached, all errors outputs. system is win8 x64
can some one help what is wrong or how to do build qt4pas5.dll x64?
Thank you.

qt 4.8.6 binary files from: 
http://sourceforge.net/projects/qtx64/files/?source=navbar

mingw64 files from:  http://www.drangon.org/mingw/
qt4pas5 source from 
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html
how to from: 
http://wiki.freepascal.org/Qt_Interface#Quick_start_guide_for_Windows


these are my results:

d:\Qt\qt4pas-V2.5_Qt4.5.3qmake -query
QT_INSTALL_PREFIX:d:\Qt\4.8.6-w64
QT_INSTALL_DATA:d:\Qt\4.8.6-w64
QT_INSTALL_DOCS:d:\Qt\4.8.6-w64\doc
QT_INSTALL_HEADERS:d:\Qt\4.8.6-w64\include
QT_INSTALL_LIBS:d:\Qt\4.8.6-w64\lib
QT_INSTALL_BINS:d:\Qt\4.8.6-w64\bin
QT_INSTALL_PLUGINS:d:\Qt\4.8.6-w64\plugins
QT_INSTALL_IMPORTS:d:\Qt\4.8.6-w64\imports
QT_INSTALL_TRANSLATIONS:d:\Qt\4.8.6-w64\translations
QT_INSTALL_CONFIGURATION:d:/Qt/4.8.6-w64
QT_INSTALL_EXAMPLES:d:\Qt\4.8.6-w64\examples
QT_INSTALL_DEMOS:d:\Qt\4.8.6-w64\demos
QMAKE_MKSPECS:d:\Qt\4.8.6-w64\mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.8.6

d:\Qt\qt4pas-V2.5_Qt4.5.3qmake Qt4Pas.pro
Project MESSAGE: Note: This binding version was generated for Qt 4.5.3. 
Current

Qt is 4.8.6
Project MESSAGE: Qt documents binary compatibility in each Version 
Change Note:

http://qt.nokia.com/developer/changes
Project MESSAGE: Pascal Qt Interface for binding platform: MSWINDOWS
Project MESSAGE: Install location: d:\Qt\4.8.6-w64\bin

d:\Qt\qt4pas-V2.5_Qt4.5.3make
g++ -c -pipe -fno-keep-inline-dllexport -O2 -w -frtti -fexceptions 
-mthreads -DU
NICODE -DMSWINDOWS -DQT_DLL -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB 
-DQT_NETW
ORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT 
-DQT_HAVE_SSE
2 -DQT_THREAD_SUPPORT -I..\4.8.6-w64\include\QtCore 
-I..\4.8.6-w64\include\Qt
Network -I..\4.8.6-w64\include\QtGui 
-I..\4.8.6-w64\include\QtWebKit -I..\
4.8.6-w64\include -I..\4.8.6-w64\include\ActiveQt -Itmp 
-I..\4.8.6-w64\mks

pecs\win32-g++-4.6 -o tmp\qt4pas.o src\qt4pas.cpp
In file included from src\qt4pas.cpp:59:0:
src\qwidget_c.cpp: In function 'unsigned int QWidget_winId(QWidgetH)':
src\qwidget_c.cpp:29:51: error: cast from 'WId {aka HWND__*}' to 
'unsigned int'

loses precision [-fpermissive]
  return (unsigned int) ((QWidget *)handle)-winId();
   ^
...
...
make: *** [tmp/qt4pas.o] Error 1


d:\Qt\qt4pas-V2.5_Qt4.5.3qmake -query
QT_INSTALL_PREFIX:d:\Qt\4.8.6-w64
QT_INSTALL_DATA:d:\Qt\4.8.6-w64
QT_INSTALL_DOCS:d:\Qt\4.8.6-w64\doc
QT_INSTALL_HEADERS:d:\Qt\4.8.6-w64\include
QT_INSTALL_LIBS:d:\Qt\4.8.6-w64\lib
QT_INSTALL_BINS:d:\Qt\4.8.6-w64\bin
QT_INSTALL_PLUGINS:d:\Qt\4.8.6-w64\plugins
QT_INSTALL_IMPORTS:d:\Qt\4.8.6-w64\imports
QT_INSTALL_TRANSLATIONS:d:\Qt\4.8.6-w64\translations
QT_INSTALL_CONFIGURATION:d:/Qt/4.8.6-w64
QT_INSTALL_EXAMPLES:d:\Qt\4.8.6-w64\examples
QT_INSTALL_DEMOS:d:\Qt\4.8.6-w64\demos
QMAKE_MKSPECS:d:\Qt\4.8.6-w64\mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.8.6



d:\Qt\qt4pas-V2.5_Qt4.5.3qmake Qt4Pas.pro
Project MESSAGE: Note: This binding version was generated for Qt 4.5.3. Current
Qt is 4.8.6
Project MESSAGE: Qt documents binary compatibility in each Version Change Note:
http://qt.nokia.com/developer/changes
Project MESSAGE: Pascal Qt Interface for binding platform: MSWINDOWS
Project MESSAGE: Install location: d:\Qt\4.8.6-w64\bin




d:\Qt\qt4pas-V2.5_Qt4.5.3make
g++ -c -pipe -fno-keep-inline-dllexport -O2 -w -frtti -fexceptions -mthreads -DU
NICODE -DMSWINDOWS -DQT_DLL -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETW
ORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE
2 -DQT_THREAD_SUPPORT -I..\4.8.6-w64\include\QtCore -I..\4.8.6-w64\include\Qt
Network -I..\4.8.6-w64\include\QtGui -I..\4.8.6-w64\include\QtWebKit -I..\
4.8.6-w64\include -I..\4.8.6-w64\include\ActiveQt -Itmp -I..\4.8.6-w64\mks
pecs\win32-g++-4.6 -o tmp\qt4pas.o src\qt4pas.cpp
In file included from src\qt4pas.cpp:59:0:
src\qwidget_c.cpp: In function 'unsigned int QWidget_winId(QWidgetH)':
src\qwidget_c.cpp:29:51: error: cast from 'WId {aka HWND__*}' to 'unsigned int'
loses precision [-fpermissive]
  return (unsigned int) ((QWidget *)handle)-winId();
   ^
src\qwidget_c.cpp: In function 'unsigned int QWidget_internalWinId(QWidgetH)':
src\qwidget_c.cpp:39:59: error: cast from 'WId {aka HWND__*}' to 'unsigned int'
loses precision [-fpermissive]
  return (unsigned int) ((QWidget *)handle)-internalWinId();
   ^
src\qwidget_c.cpp: In function 'unsigned int QWidget_effectiveWinId(QWidgetH)':
src\qwidget_c.cpp:44:60: error: cast from 'WId {aka HWND__*}' to 'unsigned int'
loses precision [-fpermissive]
  return (unsigned int) ((QWidget *)handle)-effectiveWinId();
^
In file included from src\qt4pas.cpp:14:0:
src\pascalbind.h: In instantiation of 'void 

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

2015-03-11 Thread zeljko

On 03/11/2015 12:44 PM, FreeMan wrote:

I attached, all errors outputs. system is win8 x64
can some one help what is wrong or how to do build qt4pas5.dll x64?
Thank you.


Add -fpermissive to gcc so it should compile then. In that case such 
errors will become warnings (something like range check on/off in fpc).


z.



qt 4.8.6 binary files from:
http://sourceforge.net/projects/qtx64/files/?source=navbar
mingw64 files from: http://www.drangon.org/mingw/
qt4pas5 source from
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html
how to from:
http://wiki.freepascal.org/Qt_Interface#Quick_start_guide_for_Windows

these are my results:

d:\Qt\qt4pas-V2.5_Qt4.5.3qmake -query
QT_INSTALL_PREFIX:d:\Qt\4.8.6-w64
QT_INSTALL_DATA:d:\Qt\4.8.6-w64
QT_INSTALL_DOCS:d:\Qt\4.8.6-w64\doc
QT_INSTALL_HEADERS:d:\Qt\4.8.6-w64\include
QT_INSTALL_LIBS:d:\Qt\4.8.6-w64\lib
QT_INSTALL_BINS:d:\Qt\4.8.6-w64\bin
QT_INSTALL_PLUGINS:d:\Qt\4.8.6-w64\plugins
QT_INSTALL_IMPORTS:d:\Qt\4.8.6-w64\imports
QT_INSTALL_TRANSLATIONS:d:\Qt\4.8.6-w64\translations
QT_INSTALL_CONFIGURATION:d:/Qt/4.8.6-w64
QT_INSTALL_EXAMPLES:d:\Qt\4.8.6-w64\examples
QT_INSTALL_DEMOS:d:\Qt\4.8.6-w64\demos
QMAKE_MKSPECS:d:\Qt\4.8.6-w64\mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.8.6

d:\Qt\qt4pas-V2.5_Qt4.5.3qmake Qt4Pas.pro
Project MESSAGE: Note: This binding version was generated for Qt 4.5.3.
Current
Qt is 4.8.6
Project MESSAGE: Qt documents binary compatibility in each Version
Change Note:
http://qt.nokia.com/developer/changes
Project MESSAGE: Pascal Qt Interface for binding platform: MSWINDOWS
Project MESSAGE: Install location: d:\Qt\4.8.6-w64\bin

d:\Qt\qt4pas-V2.5_Qt4.5.3make
g++ -c -pipe -fno-keep-inline-dllexport -O2 -w -frtti -fexceptions
-mthreads -DU
NICODE -DMSWINDOWS -DQT_DLL -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB
-DQT_NETW
ORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT
-DQT_HAVE_SSE
2 -DQT_THREAD_SUPPORT -I..\4.8.6-w64\include\QtCore
-I..\4.8.6-w64\include\Qt
Network -I..\4.8.6-w64\include\QtGui
-I..\4.8.6-w64\include\QtWebKit -I..\
4.8.6-w64\include -I..\4.8.6-w64\include\ActiveQt -Itmp
-I..\4.8.6-w64\mks
pecs\win32-g++-4.6 -o tmp\qt4pas.o src\qt4pas.cpp
In file included from src\qt4pas.cpp:59:0:
src\qwidget_c.cpp: In function 'unsigned int QWidget_winId(QWidgetH)':
src\qwidget_c.cpp:29:51: error: cast from 'WId {aka HWND__*}' to
'unsigned int'
loses precision [-fpermissive]
   return (unsigned int) ((QWidget *)handle)-winId();
^
...
...
make: *** [tmp/qt4pas.o] Error 1



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus