Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Marco van de Voort
On Fri, Nov 06, 2015 at 07:25:01PM +0100, Mattias Gaertner wrote:
> > width and height of the trect are assigned instead of the component's ?
> 
> Thanks for the hint.
> 
> Does Delphi alter some other records too, e.g. TPoint and TSize?
> 
> Hint:
> Cody has a tool 'Explode a "With" block':
> http://wiki.lazarus.freepascal.org/Cody#Explode_a_.22With.22_block

Would have been nice to run that on the code that I replied to Michael.
(with the local procedure)

Anyway, I hunted down one case by raise tobject.create, and running in the
debugger, and I committed a fix. The Win32 lazarus now seems to function
normally at first glance.

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Sven Barth
Am 06.11.2015 17:59 schrieb "Marco van de Voort" :
>
> On Fri, Nov 06, 2015 at 05:42:39PM +0100, Michael Van Canneyt wrote:
> > > by Delphi compatibility...
> >
> > Ehm. How can "with" ever be safe ?
>
> Btw the case that I fixed was like this
>
> procedure TSomeForm.Getwind...
>
> procedure setwidthheight(const r : TRect); inline;
> begin
>  with R do
>begin
> width:=right-left;
> height:=bottom-top;
>   end;
> end;
>
> begin
>  ...
>   setwidtheight(r);
> end
>
> In such case fixing with SELF doesn't work, because self isn't allowed in
> the nested function. I had to strip the WITH.

Self really isn't allowed in nested functions? O.o

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


[Lazarus] Debian Packager released

2015-11-06 Thread Anthony Walter
I've put up a release for Debian Packager, a tool which hopefully makes it
easy for developers to create their own deb packages to deploy their
applications. Usage should be self explanatory and help is provided. Debian
Packager can build both 32 and 64 bit deb packages.

http://www.getlazarus.org/apps/makedeb/

To install a package: dpkg -i packagename.deb
To uninstall a package: dpkg -r packagename

Note: apt-file is no longer required to build your app dependency list.

Source code for the project is also available on github under the copyleft
license.

http://github.com/sysrpl/lazarus.apps.makedeb
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] StringGrid1.LoadFromCSVFile problem

2015-11-06 Thread fecske fecske
I use CodeTyphon (ver 5.60 revision 005512) with Lazarus SVN Rev 50211
I changed it here in the lcsvutils.pas line 193
(System.Move(leadPtr^,W[1],length(W)*2);) and I compiled in the my
project.

You fixed a month ago is in the Lazarus Revision 50146

On Fri, Nov 6, 2015 at 3:15 PM, Mattias Gaertner
 wrote:
> On Fri, 6 Nov 2015 14:55:14 +0100
> fecske fecske  wrote:
>
>> I was fixed this line in my lcsvutils.pas and the problem with lines
>> It has been okay.
>> System.Move(leadPtr^,W[1],length(W)*2);
>>
>> And the last line of strange characters It is still not ok...
>> https://youtu.be/5US9mdUxSm4
>
> Are you using trunk?
>
> It works here and your error looks exactly like the bug I fixed a month
> ago.
>
> Mattias
>
> --
> ___
> 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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Ondrej Pokorny

On 06.11.2015 22:45, Mark Morgan Lloyd wrote:

Luca Olivetti wrote:

 with a=somerecord, b=someotherrecord do
 begin
   a.x:=b.x;
 end;


Just because something is 20+ years old doesn't necessarily make it 
bad. That syntax looks OK to me (i.e. make a and b look like consts) 
but I also find myself wondering what the type rules are, i.e.


with pod: TTabSheet= Pages.Objects[deleteAt] do

vs

with pod= TTabSheet(Pages.Objects[deleteAt]) do


Do not forget that you can overload operators! In particular you can 
overload the comparison operator to return a record, so your

"with a=somerecord do" can already be a valid pascal code now:

*type**
**  TMyRec = record**
**I: Integer;**
**  end;**
**
**  TMyResult = record**
**Res: Integer;**
**  end;**
**
**operator = (z1: TMyRec; z2 : TMyRec) b : TMyResult;**
**begin**
**  Result.Res := z1.I+z2.I;**
**end;**
**
**var**
**  m1, m2: TMyRec;**
**begin**
**  m1.I := 10;**
**  m2.I := 1;**
**  with m1=m2 do**
**writeln(Res);**
**  readln;**
**end.*

The assignment operator would be better, since it doesn't return a value 
(in pascal, of course) and thus cannot be used in a with statement now:


*with a:=somerecord, b:=someotherrecord do**
**begin**
**  a.x:=b.x;**
**end; **
*
IMO there is no need to set a type of a/b on the left side of the with 
assignment - the left side should always gain the type from the the 
right side. In this case you can decide whether the "AS" or the direct 
re-type should be used:


*with pod := Pages.Objects[deleteAt] as TTabSheet do **
**with pod := TTabSheet(Pages.Objects[deleteAt]) do **
*
-> both are valid and the syntax is already in pascal - why not to use it.

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Alexander Klenin
On Sat, Nov 7, 2015 at 5:58 AM, Florian Klaempfl  wrote:
> Am 06.11.2015 um 20:22 schrieb Luca Olivetti:
>> El 06/11/15 a les 18:10, Martin Schreiber ha escrit:
>>
>>> You are joking, no? It has been discussed on fpc-pascal/fpc-devel several
>>> times. An IIRC Italian community member then usually shows a syntax
>>> description of a safe "with" statement from a maybe more than 20 year old
>>> pascal dialect.
Here is one "recent" discussion:
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-with-is-evil-isn-t-it-td3219144.html

> It is similiar to the proc. var code which is also one of the places
> only very brave people look at ;)
One nice thing about FPC/Lazarus is that I may disappear for a few years,
then look back and see same topics discussed by the same people with
the same conclusions ;-)

-- 
Alexander S. Klenin

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


[Lazarus] How to find out the public IP in code?

2015-11-06 Thread Bo Berglund
I would like to be able to find out the public IP address of the Pi in
a Lazarus program.
How can this be accomplished?
It is either connected to a wired or WiFi network router.
in my browser I can go to http://checkip.dyndns.com/ and it will print
a message with my IP address.
But how is this done in code?

-- 
Bo Berglund
Developer in Sweden


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


Re: [Lazarus] Deployment tool: make deb

2015-11-06 Thread JuuS


On 11/05/2015 11:02 PM, Anthony Walter wrote:
> JuuS, right. I knew about apt-file builing of user database on first run. 
> 

Super, thanks for the info, I see now where I had some confusion.

I will definitely use this, please keep us apprised of deb packager
updates (for instance the umlaut ö problem)?

But you are right that it is ready to use now, though I'm still at a
loss as to why my program does not show up in Kub's utilities menu, your
deb packager shows up fine in development menu. Any ideas?


> Here's how it will work:
> 
> On start of makedeb it checks if apt-file is installed. 
>   If apt-file is not installed the program will ask to install it for
> you or close.
> If you say okay to install, it'll popup the gksudo prompt and
> install apt-file.
> Else makedeb will terminate
> 
> Once apt-file is detected it'll check that you have the cache has been built
>   If not it will run apt-file update without sudo, to build the local
> apt-file user cache 

I was reading about this and I, personally, prefer the manual sudo
method simply because the user permission terminal window for the
"apt-file update" hangs and never returns to a prompt. Maybe that's not
a real issue but I am reassured when I run it under sudo that the
terminal window returns to normal. The downside (if it is one), as
discussed on the sites I've read, is that once this decision is made
then the use of sudo must be consistent.

> 
> After apt-file and its cache is working, you can then fill out the form
> with the information in you deb package:
> 
> http://cache.getlazarus.org/images/makedeb-file.png
> 
> Fields Explained
> 
> Icon: Click the icon to pick a graphics file. Icons should support
> transparency, so select either a png, xpm, ico, or svg image file. They
> will all be resized as 64x64 pngs and packed into your deb, then
> deployed to /usr/local/share/icons/.png.
> 
> Application: The path to your executable. The binary format must be
> either i386 or amd64 architecture. Any other format will be rejected.
> The binary will be stripped before being placed in the deb.
> 
> Caption: The name of your application as seen when searching in the
> Ubuntu dash or other graphical application launcher. Will appear in the
> Name field of the generated desktop file deployed to
> /user/local/share/applications/.desktop.
> 
> Package name: The name of the package as seen by apt-get, dpkg,
> aptitude, apt-file, and other command line package tools. I force you to
> use an identifier name, i.e. following the same rules at variables. No
> spaces, no punctuation, letters, numbers, and underscore. Must start
> with a letter or underscore.
> 
> Package version: Should be app major version dot minor version dash
> package version. e.g. 1.0-1
> 
> Category: Used by some systems to group applications by functionality.
> Will be inserted into the desktop file and the DEBIAN control file.
> 
> Author: You name and email in to form of "John Doe  >" without the quotes.
> 
> Website: The url where people can download the deb from or read about
> the program.
> 
> Short description: Will appear in under next to the package name as the
> description in your package manager (apt-get, aptitude, Ubuntu Software
> Center).
> 
> Long description: Will appear in Ubuntu Software Center after the fold.
> 
> When you press build, make deb does the following:
> 
> Validates the fields are filled in correctly.
> Checks that the application file is a valid amd64 or i386 executable binary.
> Your previous deb file for that architecture is deleted if it already
> exists.
> The deb folder structure is created, if it doesn't exists in the same
> directory at the application file.
> You applicate is copied to app-folder/packagename_version/usr/local/bin.
> Makedeb then locates the shared object files (.so) linked in the elf
> header of your application.
> It checks if the .so has already been cached and associated with a
> package name and version..
>   If the .so hasn't been cached, apt-file is used to lookup the package
> and version (this can take a while).
>   The .so package name and version is then cached in your
> $HOME/.config/makedeb folder.
> It copies your icon file to app-folder/packagename_version/usr/share/icons.
> It builds a desktop file and copies it to
> app-folder/packagename_version/usr/share/applications.
> It builds the app-folder/packagename_version/DEBIAN/control file.
> It builds the deb packagename_version-architecture.deb. e.g.
> my_awesome_app_1.0-1-amd64.deb
> 
> And finally your project information is saved to the same name as your
> application file with the .mkdeb extension added. The next time you open
> the file with makedeb (using the button next to the Application field).
> It will reuse your last settings.
> 
> You can then increment the application or package versions numbers,
> build again, and uploads the new deb file to your website. The user can
> download the new 

Re: [Lazarus] Deployment tool: make deb

2015-11-06 Thread JuuS
Ahhh, your cpugraph doesn't show up either, utilities is misspelled.

On 11/06/2015 10:15 AM, Anthony Walter wrote:
> I'm not sure why it's not showing up. Do an "ls -l
> /usr/share/applications" and see if there is a package.desktop file
> there related to your application. You can "cat
> /usr/share/applications/yourapp.desktop" and check that the contents are
> correct. Maybe I am using the wrong category string. You should be eable
> to find it by Caption in the dash or whatever spotlight type tool you
> desktop provides.
> 
> I'll be posting another version of makedeb (final perhaps) this weekend.
> 
> 
> --
> ___
> 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


Re: [Lazarus] Test This Please

2015-11-06 Thread JuuS

On 11/06/2015 09:55 AM, Anthony Walter wrote:
> To Debian based Lazarus users, if you have the inclination can you test
> this out, or provide some feedback:
> 

40 minutes in, works great and looks pretty, needs the utilities thing
fixed.

If you're looking for suggestions? Scrubbing with arrow keys would be
nice, fast scrubbing with shift or control.

Just for the fun of it, it would be interesting to be able to click on a
processor color(s) and isolate those graphs.


> http://www.getlazarus.org/apps/cpugraph/
> 
> Here is a video of the program if you want a better idea of what it does
> before you try it:
> 
> http://cache.getlazarus.org/video/cpugraph-scrub.mp4
> 
> * Note to testers *
> 
> I've written code to enabled system wide hotkey detection which may not
> work in environments toolkits where Gtk doesn't own the root window. 
> 
> If Super + U (super is the Windows key) doesn't toggle the graphing
> window visibility,  please let me know what "echo $XDG_CURRENT_DESKTOP"
> returns in a terminal.
> 
> 
> 
> --
> ___
> 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


Re: [Lazarus] Test This Please

2015-11-06 Thread Anthony Walter
Good feedback. Regarding arrows keys, the window is actually a popup and as
such I'm not sure it can receive input focus. I'll investigate. The cpu
graph isolation suggestion is a really good idea.

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


Re: [Lazarus] Using event driven components in console application

2015-11-06 Thread JuuS

> Having to have that library is unfortunate, but is a fundamental
> requirement since Qt exposes a C++ API which is not directly usable by
> FPC. If you start looking too closely at that point, you have to
> question the wisdom of using non-mainstream tools... I really don't want
> to go there.

Let's make L mainstream then...it certainly deserves to be IMO.

> 
> In practice, it's also worth installing database -dev packages e.g.
> libpq-dev on user-level machines, since it is these that typically set
> up a fixed-name symlink that avoids an app having to search for various
> possibilities. So on one of the older machines around here I've got
> 
> /usr/lib/libpq.a
> /usr/lib/libpq.so -> libpq.so.5.1
> /usr/lib/libpq.so.5 -> libpq.so.5.1
> /usr/lib/libpq.so.5.1
> 
> while on a newer one:
> 
> /usr/lib/libpq.a
> /usr/lib/libpq.so -> libpq.so.5.4
> /usr/lib/libpq.so.5 -> libpq.so.5.4
> /usr/lib/libpq.so.5.4
> 
> That's a distro problem, not an FPC or Lazarus one.
> 

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Luca Olivetti

El 06/11/15 a les 09:55, Anthony Walter ha escrit:

To Debian based Lazarus users, if you have the inclination can you test
this out, or provide some feedback:


On kde (kubuntu 15.10) with compositing disabled the window never 
disappears (when I click on the checkbox it just stays there without the 
graph moving) and it has black corners, as well a a black background in 
the slider.
Everything is fine with compositing enabled, but I usually leave it 
disabled.

The hotkey works, $XDG_CURRENT_DESKTOP is KDE.


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

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


Re: [Lazarus] Test This Please

2015-11-06 Thread JuuS


On 11/06/2015 11:22 AM, Luca Olivetti wrote:
> El 06/11/15 a les 09:55, Anthony Walter ha escrit:
>> To Debian based Lazarus users, if you have the inclination can you test
>> this out, or provide some feedback:
> 
> On kde (kubuntu 15.10) with compositing disabled the window never
> disappears (when I click on the checkbox it just stays there without the
> graph moving) and it has black corners, as well a a black background in
> the slider.

This could very well be the exact same problem I had with my program and
15.10. GTK is broken in some manner, using the libqt4pas5 (and compiling
for qt with the dev library) fixed it. My problem was also the black
corners and black back/fore ground.

> Everything is fine with compositing enabled, but I usually leave it
> disabled.
> The hotkey works, $XDG_CURRENT_DESKTOP is KDE.
> 
> 
> Bye

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Paul Michell

Anthony

Testing on Kubuntu 64 15.04, I can't find it on the KDE menu, but 
running from the command line works.  The utility looks good and is 
responsive, but I'm not getting a tray icon.  Also there is a GTK 
warning message when it starts.


Some suggestions:

* I instinctively tried the right mouse button for a pop-up menu to look 
for a configure or exit command.  It might be useful to have one?


* An option to make it sit behind active windows would be useful.

Kind regards,

Paul Michell


On 06/11/15 08:55, Anthony Walter wrote:
To Debian based Lazarus users, if you have the inclination can you 
test this out, or provide some feedback:


http://www.getlazarus.org/apps/cpugraph/

Here is a video of the program if you want a better idea of what it 
does before you try it:


http://cache.getlazarus.org/video/cpugraph-scrub.mp4

* Note to testers *

I've written code to enabled system wide hotkey detection which may 
not work in environments toolkits where Gtk doesn't own the root window.


If Super + U (super is the Windows key) doesn't toggle the graphing 
window visibility,  please let me know what "echo 
$XDG_CURRENT_DESKTOP" returns in a terminal.




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


Re: [Lazarus] Test This Please

2015-11-06 Thread Michael Van Canneyt



On Fri, 6 Nov 2015, Anthony Walter wrote:


To Debian based Lazarus users, if you have the inclination can you test
this out, or provide some feedback:

http://www.getlazarus.org/apps/cpugraph/

Here is a video of the program if you want a better idea of what it does
before you try it:

http://cache.getlazarus.org/video/cpugraph-scrub.mp4

* Note to testers *

I've written code to enabled system wide hotkey detection which may not
work in environments toolkits where Gtk doesn't own the root window.


I use KDE.



If Super + U (super is the Windows key) doesn't toggle the graphing window
visibility,  please let me know what "echo $XDG_CURRENT_DESKTOP" returns in
a terminal.


It doesn't toggle, and the value of XDG_CURRENT_DESKTOP is KDE.

Please enable sizing/moving (or at least moving) and hiding of the window; 
it is the first thing I tried to do but it doesn't work.


I also suggest adding a legend to the slider at the bottom.
I had no idea what it was supposed to do.

And lastly, consider adding a context menu on the window, 
where I can choose 'Quit' or so. It took me some time to 
realize I had to do this through the toolbar.


The toolbar menu has 'Show the CPU usage graph'. 
At first sight it didn't do anything, so I thought 
it would open/close the window. It does not.

Only later I realized it stops the animated graph.

Other than that, nifty tool.

Michael.

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Michael Van Canneyt



On Fri, 6 Nov 2015, Paul Michell wrote:


Anthony

Testing on Kubuntu 64 15.04, I can't find it on the KDE menu, but running 
from the command line works.  The utility looks good and is responsive, but 
I'm not getting a tray icon.  Also there is a GTK warning message when it 
starts.


Some suggestions:

* I instinctively tried the right mouse button for a pop-up menu to look for 
a configure or exit command.  It might be useful to have one?


* An option to make it sit behind active windows would be useful.


+1

Michael.

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Anthony Walter
Luca, thanks for that very observational point. I actually do a basic check
for a compositing window manage which will result in the problem you
described. There is a command line switch to force it off in the program.

cpugraph -flat

Unfortunately I didn't tie it to the opacity/visibility, which I will do in
the next revision. The short of it is setting opacity with compositing off
does not hide the window while setting visible to false does. I'll fix it
by making the "-flat" switch assume the compositor is off.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Test This Please

2015-11-06 Thread Anthony Walter
To Debian based Lazarus users, if you have the inclination can you test
this out, or provide some feedback:

http://www.getlazarus.org/apps/cpugraph/

Here is a video of the program if you want a better idea of what it does
before you try it:

http://cache.getlazarus.org/video/cpugraph-scrub.mp4

* Note to testers *

I've written code to enabled system wide hotkey detection which may not
work in environments toolkits where Gtk doesn't own the root window.

If Super + U (super is the Windows key) doesn't toggle the graphing window
visibility,  please let me know what "echo $XDG_CURRENT_DESKTOP" returns in
a terminal.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Deployment tool: make deb

2015-11-06 Thread Anthony Walter
I'm not sure why it's not showing up. Do an "ls -l /usr/share/applications"
and see if there is a package.desktop file there related to your
application. You can "cat /usr/share/applications/yourapp.desktop" and
check that the contents are correct. Maybe I am using the wrong category
string. You should be eable to find it by Caption in the dash or whatever
spotlight type tool you desktop provides.

I'll be posting another version of makedeb (final perhaps) this weekend.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Using event driven components in console application

2015-11-06 Thread Mark Morgan Lloyd

JuuS wrote:

On 11/05/2015 07:05 PM, JuuS wrote:


On 11/04/2015 12:30 PM, Mark Morgan Lloyd wrote:

JuuS wrote:

On 11/04/2015 09:48 AM, Mark Morgan Lloyd wrote:

When building the IDE you'd normally use  make bigide  or similar which
would use the platform defaults, but depending on what libraries etc.
were available you could also use e.g.  make LCL_PLATFORM=qt bigide


Hi,

This question / discussion is also very interesting to me (warning
possible dumb questions ahead).

I am still very vague on the widget type/set in my gnu/linux education.
I'm kub14.04, the ide then uses gtk2, all automatic.

If that's Kububtu, I'd expect it to be using KDE which implies you've
already got Qt. Assuming that you have- or can add- libqt4pas-dev then
you can build the Lazarus IDE etc. for Qt.


A. Thank you for the insight! Yes, I can now compile qt as well as
gtk2.

So simple!!...when you know what is needed...



Just FYI for others that may be in my position:

This insight (using a qt version) just solved the problem I was having
with a later install version of kub 14.04 and kub 15.04 and 15.10 where
a simple progress bar from the comp. palette showed fine in my
development computer (earlier install v. of 14.04) but would NOT show in
those other two versions. Ouch.

Thanks again, you just solved a headache for me (but one needs to
install the libqt4pas5 library on the destination machines, even so
problem solved).


Having to have that library is unfortunate, but is a fundamental 
requirement since Qt exposes a C++ API which is not directly usable by 
FPC. If you start looking too closely at that point, you have to 
question the wisdom of using non-mainstream tools... I really don't want 
to go there.


In practice, it's also worth installing database -dev packages e.g. 
libpq-dev on user-level machines, since it is these that typically set 
up a fixed-name symlink that avoids an app having to search for various 
possibilities. So on one of the older machines around here I've got


/usr/lib/libpq.a
/usr/lib/libpq.so -> libpq.so.5.1
/usr/lib/libpq.so.5 -> libpq.so.5.1
/usr/lib/libpq.so.5.1

while on a newer one:

/usr/lib/libpq.a
/usr/lib/libpq.so -> libpq.so.5.4
/usr/lib/libpq.so.5 -> libpq.so.5.4
/usr/lib/libpq.so.5.4

That's a distro problem, not an FPC or Lazarus one.

--
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] Test This Please

2015-11-06 Thread Anthony Walter
Paul, there is a misspelling in my makedeb program that results in
Utilities not appearing in dash/spotlight searches. I'll fix it in the next
revision (soon). Regarding clicking on the window, most of the window is
transparent to mouse events, save for the slider. I'll look into putting a
context menu in that area. By the way, there should be a tray icon with an
Exit option.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Test This Please

2015-11-06 Thread Anthony Walter
Thanks for the feedback Michael. The problem is the compositing opacity
setting. I'll do a new build right now to fix this issue.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Another widget

2015-11-06 Thread Aradeonas
Anthony! Very good. You made what I dreamed about, this transparent
widget system is very good,I like it so much and I have just one problem
and that is big form painting,for more info open hilite example and
focus on grid and resize the form and make it big.

Thank you, 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


[Lazarus] Trim quoted text please!

2015-11-06 Thread Graeme Geldenhuys

[I'm not the admin, just a concerned citizen]

See attached screenshot - 95% of that message was quoted text. And in
recent days I've seen stacks of posts like that by various people. It is
a real pain to read any messages like that, having to scroll two or
three page lengths before I actually get to a reply. Also think about
visually impaired users with screen reader.

Come on people, use some Netiquette!  Trim those quotes to only relevant
text.

All email clients these days are message thread based, so if we wanted
the full discussion or context, we can read it ourselves easily - you
DON'T have to quote everything!.

Regards,
  - Graeme -

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


Re: [Lazarus] A big thank you!

2015-11-06 Thread Aradeonas
Thank you Ondrej.

Ara


-- 
http://www.fastmail.com - Email service worth paying for. Try it for free

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


Re: [Lazarus] Test This Please

2015-11-06 Thread JuuS


On 11/06/2015 11:15 AM, Anthony Walter wrote:
> Good feedback. Regarding arrows keys, the window is actually a popup and
> as such I'm not sure it can receive input focus. I'll investigate. The
> cpu graph isolation suggestion is a really good idea.
> 
> Thanks.

My pleasure, thank you for the work.

If capturing keystrokes is problematic then maybe slo/quick buttons on
both sides...

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Paul Michell

On 06/11/15 10:40, Anthony Walter wrote:

By the way, there should be a tray icon with an Exit option.


I don't get a tray icon at all. Is that because I've started it from the 
command line? (Please excuse the quality of the screen-shot, I had to 
squish it pretty hard to get under the 100K bounce limit!)




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


Re: [Lazarus] Test This Please

2015-11-06 Thread Aradeonas
Is there a way to I compile it for windows?
I want it too! ;)

Regards,
Ara


-- 
http://www.fastmail.com - Same, same, but different...


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


Re: [Lazarus] Test This Please

2015-11-06 Thread Anthony Walter
Okay I put up new debs (cpugraph_1.0.1-1) which if you get and run will
just overwrite the previous version, assuming the program isn't running.

* Fixed the proper spelling Utility category to the desktop file.
* Removed some known compositors (Mutter, KWin)
  * Without the compositing the window should just appear/disappear and not
fadein/fadeout
  * This should fix issues where the graph won't hide
* The -flat switch now disables all opacity, window transparencies, and
rounded corners.

In retrospect I'll add both the -compositing and -flat flags so the user
can set those values to override what I am guessing their window manager is
configured to support.

Regarding resizing and moving the window, those are on the TODO list along
with toggling the graphing of individual CPU cores. I'll probably make a
"mini" mode where the window is much smaller and unobtrusive with the
ability to drag it around. The same toggle keys would apply to show and
hide the mini window.

My original need for the app was to track CPU usage while video encoding
with differing configurations. I didn't intend to keep the graph open all
the time. I jsut wanted a way to quickly peek at the history. I figured a
hotkey was quick enough.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Test This Please

2015-11-06 Thread micsch
Am Friday 06 November 2015 09:55:06 schrieb Anthony Walter:
> To Debian based Lazarus users, if you have the inclination can you test
> this out, or provide some feedback:
works fine on opensuse 13.2 with KDE3 (yes 3)
Tray icon works too

for your deb tool you can take some inspiration form here:

http://prof7bit.github.io/LazPackager/

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


Re: [Lazarus] StringGrid1.LoadFromCSVFile problem

2015-11-06 Thread Mattias Gaertner
On Fri, 6 Nov 2015 14:55:14 +0100
fecske fecske  wrote:

> I was fixed this line in my lcsvutils.pas and the problem with lines
> It has been okay.
> System.Move(leadPtr^,W[1],length(W)*2);
> 
> And the last line of strange characters It is still not ok...
> https://youtu.be/5US9mdUxSm4

Are you using trunk?

It works here and your error looks exactly like the bug I fixed a month
ago.

Mattias

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Luca Olivetti

El 06/11/15 a les 18:10, Martin Schreiber ha escrit:


You are joking, no? It has been discussed on fpc-pascal/fpc-devel several
times. An IIRC Italian community member then usually shows a syntax
description of a safe "with" statement from a maybe more than 20 year old
pascal dialect.


I don't know if that's me, but, yes, I used a variant of pascal (by 
texas instruments) that allowed to declare aliases with "with", e.g


 with a=somerecord, b=someotherrecord do
 begin
   a.x:=b.x;
 end;


I even found the (scanned) reference manual to confirm the syntax but 
now I cannot find it.

It is definitely more than 20 years old (and more than 30 ;-):

http://www.computinghistory.org.uk/det/11554/TI-990-System/


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Dmitry Boyarintsev
On Fri, Nov 6, 2015 at 1:25 PM, Mattias Gaertner 
wrote:

>
> Does Delphi alter some other records too, e.g. TPoint and TSize?
>
> It does
http://docwiki.embarcadero.com/Libraries/Seattle/en/System.Types.TPoint
http://docwiki.embarcadero.com/Libraries/Seattle/en/System.Types.TSize

so it's just a matter of time when FPC RTL replicates them.

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


Re: [Lazarus] StringGrid1.LoadFromCSVFile problem

2015-11-06 Thread fecske fecske
On Fri, Nov 6, 2015 at 9:15 AM, fecske fecske  wrote:
> On Thu, Oct 22, 2015 at 11:37 PM, Mattias Gaertner
>  wrote:
>> The UTF16 conversion was wrong. It was missing the ending #0 wide char.
>> I fixed that in revision 50146.
>> Mattias

Sorry this is so correct:
 I did a test, I wrote a Delphi code in a delphi IDE with unique
 function and stringgrid, and  are not these characters and as lines
displayed correctly


> Zsolt.

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Michael Van Canneyt



On Fri, 6 Nov 2015, Anthony Walter wrote:


Okay I put up new debs (cpugraph_1.0.1-1) which if you get and run will
just overwrite the previous version, assuming the program isn't running.


Nice job.

I tested the new version on another machine (also KDE), there the shortcut 
does work. I do suggest switching window type, because right-click now shows 
context from the application below the graph window.


Michael.

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Anthony Walter
Paul, a little later I'll do a rebuild with my alternate tray icon code and
we'll see if that fix the issue. There should definitively be a tray icon,
otherwise you need to use "kill " from the terminal to ask it to close
gracefully, and "kill -KILL " to force anything to close ungracefully.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] D7 compatibility in component definition concerning TPage

2015-11-06 Thread Martin Grajcar
I've tried to unify some Lazarus and D7 sources and succeeded except for
one thing:

TYPE TMyForm = CLASS(TForm)
{$IFDEF FPC}
 SomePage: TPage;
{$ENDIF}
END;

Delphi parses it wrongly and always offers to remove the declaration.

I don't need the declaration in L, but removing it led to a class not found
error.

While in LFM the form looks like

object SomeBook: TNotebook
object SomePage: TPage
end;
end;

there's just

object SomeBook: TNotebook
object TPage
end;
end;

in Delphi. I modified it to look like L, but it changed nothing.

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Martin Schreiber
On Friday 06 November 2015 18:19:14 Michael Van Canneyt wrote:
>
> But presumably you mean some construct as
>
> With QMyVeryLongQueyObjectName as Q do
>try
>  // Do things with Q
>finally
>  Q.Close;
>end;
>
> ?
>
Correct. There have been some more notations suggested.

Martin

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Graeme Geldenhuys
On 2015-11-06 17:19, Michael Van Canneyt wrote:
> With QMyVeryLongQueyObjectName as Q do
>try
>  // Do things with Q
>finally
>  Q.Close;
>end;

var
  Q: TQuery absolute QMyVeryLongQueyObjectName;
begin
  with Q do
try
  // Do things with Q
finally
  Q.Close;
end;


problem solved! ;-)

And because Q is such a short name, I wouldn't even both with the WITH
statement above.  It would make for easier debugging too. eg: debug
tooltips evaluation etc.


Regards,
  - Graeme -

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

My public PGP key:  http://tinyurl.com/graeme-pgp

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Anthony Walter
Michael, I am going to release my makedeb application and then come back to
fixing/modifying this app. I'll work on z-order per your suggestion, but
also add the ability to move/resize the default position. I also plan to
add a options screen where you can redefine the colors, the animation
interval (10, 5, 2 times a second), as well as the option to smooth out
data point (drawing curves between nodes rather than lines). I also will
add the ability to turn off/on compositing and flat from the options screen.

With regards to moving/sizing, i think I will change the layout based on
they way it's resized. The way I imagin it iff you make the window thin and
tall it will stack each cpu graph its own rows. If you resize wide and not
very high, then cpu graphs will be displayed in consecutive columns. And if
size it big it will look as it is now.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Michael Van Canneyt



On Fri, 6 Nov 2015, Martin Schreiber wrote:


On Friday 06 November 2015 17:42:39 Michael Van Canneyt wrote:

On Fri, 6 Nov 2015, Martin Schreiber wrote:

On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:

Nevertheless I am of the opinion that WITH is evil and should be removed
from the IDE/LCL code (unless only identifiers from within the with
scope are used; but even then they could be removed...).


Or implement a safe "with" in Free Pascal without waiting until it is
enforced by Delphi compatibility...


Ehm. How can "with" ever be safe ?


You are joking, no? It has been discussed on fpc-pascal/fpc-devel several
times.


Erm... I am not joking.

Do you really think I recall every discussion or braindead proposal from 
these mailing lists over the last 20 years ?


I appreciate your high esteem of my memory, but alas, age takes it's toll... ;-)

But presumably you mean some construct as

With QMyVeryLongQueyObjectName as Q do
  try
// Do things with Q
  finally
Q.Close;
  end;

?

That is a modification of the current "with". 
I assumed you meant to make an unchanged "with" safe.


That said, a construct such as "With QMyVeryLongQueyObjectName as Q do" has my 
support...

Michael.

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


Re: [Lazarus] Test This Please

2015-11-06 Thread zeljko

On 11/06/2015 12:11 PM, Anthony Walter wrote:

Okay I put up new debs (cpugraph_1.0.1-1) which if you get and run will
just overwrite the previous version, assuming the program isn't running.

* Fixed the proper spelling Utility category to the desktop file.
* Removed some known compositors (Mutter, KWin)
   * Without the compositing the window should just appear/disappear and
not fadein/fadeout
   * This should fix issues where the graph won't hide
* The -flat switch now disables all opacity, window transparencies, and
rounded corners.

In retrospect I'll add both the -compositing and -flat flags so the user
can set those values to override what I am guessing their window manager
is configured to support.


AFAIR, there's IsCompositingEnabled (or similar name) in gtk2 and qt 
interface sources (both can recognize compositing wm), so you can check 
if compositing wm is running or not, and then you don't need such switches.


zeljko


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


Re: [Lazarus] StringGrid1.LoadFromCSVFile problem

2015-11-06 Thread fecske fecske
I was fixed this line in my lcsvutils.pas and the problem with lines
It has been okay.
System.Move(leadPtr^,W[1],length(W)*2);

And the last line of strange characters It is still not ok...
https://youtu.be/5US9mdUxSm4


On Fri, Nov 6, 2015 at 1:05 PM, Mattias Gaertner
 wrote:
> On Fri, 6 Nov 2015 09:15:31 +0100
> fecske fecske  wrote:
>
>>[...]
>> I could now test the Lazarus SVN Rev 50211
>> Unfortunately, I experience the same problem.
>> https://youtu.be/0OdBpKAwXGM
>>
>> I use it 'tab' delimiter #9.
>>
>> Here's the code:
>> procedure TForm1.FileListBox1Click(Sender: TObject);
>>   begin
>> StringGrid1.LoadFromCSVFile(FileListBox1.FileName, #9, TRUE, 3 ,TRUE);
>>   end;
>>
>> I did a test, I wrote a Delphi code in a delphi IDE with unique
>> function and stringgrid, and  are not these characters and some lines
>> not displayed correctly
>> I use the same csv files.
>> can be found in the attached zip file
>
> Fixed.
>
> Mattias
>
> --
> ___
> 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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Ondrej Pokorny

On 06.11.2015 17:42, Michael Van Canneyt wrote:

Ehm. How can "with" ever be safe ?


You can make sure that if some property is ADDED into the with scope, it 
doesn't break anything by explicitely using Self (or the unit name or 
whatever):


procedure TForm1.DoMySize;
begin
  //...
  with MyRect do
Self.Width := Right - Left;
end;

But you cannot do anything if a property is REMOVED (e.g. Right in this 
case)...


So yes, let's not use with :)

+ I don't use with in my code any more. I confess that in the beginning 
I did use it, but decided to ignore the with statement at all. There is 
no problem with long variable names at all. There are CodeTools :)


Ondrej

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Michael Van Canneyt



On Fri, 6 Nov 2015, Martin Schreiber wrote:


On Friday 06 November 2015 18:33:54 Graeme Geldenhuys wrote:

On 2015-11-06 17:19, Michael Van Canneyt wrote:

With QMyVeryLongQueyObjectName as Q do
   try
 // Do things with Q
   finally
 Q.Close;
   end;


var
  Q: TQuery absolute QMyVeryLongQueyObjectName;
begin
  with Q do
try
  // Do things with Q
finally
  Q.Close;
end;


problem solved! ;-)


Not a good idea IMHO, that hinders readability because one doesn't see the
real container at the "with" block start. Another important use of "with" is
to make complex address calculations only once at the "with" block start
without the need to define a pointer variable in "var" and to dereference in
every statement.


Indeed, and besides this:

a) it does not compile for properties. See below.
b) I did mention the requirement about non-trivial readable variable names...

Michael.

program Project1;

{$mode objfpc}

Type
  TMyType = class(TObject)
  private
FM: TMyType;
function GetM: TMyType;
procedure SetM(AValue: TMyType);
  Public
Procedure DoIt;
Property MyVeryLongObjectPropertyName : TMyType Read GetM Write SetM;
  end;

function TMyType.GetM: TMyType;
begin
  Result:=Nil;
end;

procedure TMyType.SetM(AValue: TMyType);
begin
  //
end;

procedure TMyType.DoIt;

Var
  Q : TMyType absolute MyVeryLongObjectPropertyName; // Error !!!

begin

end;

begin
end.

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Mattias Gaertner
On Fri, 6 Nov 2015 16:45:07 +0100
Marco van de Voort  wrote:

>[...]
> I yesterday tried to implement some of the TRect helper methods in 3.1.1
>[...]
> I haven't investigated deeper yet, but I suspect the heavy use of WITH in
> interfaces etc is the cause.  (if you assign width and height of a
> component in a component method in a WITH with a TRECT as argument, then now
> width and height of the trect are assigned instead of the component's ?

Thanks for the hint.

Does Delphi alter some other records too, e.g. TPoint and TSize?

Hint:
Cody has a tool 'Explode a "With" block':
http://wiki.lazarus.freepascal.org/Cody#Explode_a_.22With.22_block

Mattias

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Bart
@marcov: your patch for this issue in r50234 seems to have mangled
some utf8-codepoints in a comment about Bézier curves (line 2739 and
2749)?

Bart

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Martin Schreiber
On Friday 06 November 2015 18:33:54 Graeme Geldenhuys wrote:
> On 2015-11-06 17:19, Michael Van Canneyt wrote:
> > With QMyVeryLongQueyObjectName as Q do
> >try
> >  // Do things with Q
> >finally
> >  Q.Close;
> >end;
>
> var
>   Q: TQuery absolute QMyVeryLongQueyObjectName;
> begin
>   with Q do
> try
>   // Do things with Q
> finally
>   Q.Close;
> end;
>
>
> problem solved! ;-)
>
Not a good idea IMHO, that hinders readability because one doesn't see the 
real container at the "with" block start. Another important use of "with" is 
to make complex address calculations only once at the "with" block start 
without the need to define a pointer variable in "var" and to dereference in 
every statement.

Martin

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Florian Klaempfl
Am 06.11.2015 um 20:22 schrieb Luca Olivetti:
> El 06/11/15 a les 18:10, Martin Schreiber ha escrit:
> 
>> You are joking, no? It has been discussed on fpc-pascal/fpc-devel several
>> times. An IIRC Italian community member then usually shows a syntax
>> description of a safe "with" statement from a maybe more than 20 year old
>> pascal dialect.
> 
> I don't know if that's me, but, yes, I used a variant of pascal (by
> texas instruments) that allowed to declare aliases with "with", e.g
> 
>  with a=somerecord, b=someotherrecord do
>  begin
>a.x:=b.x;
>  end;
> 

While I think this is something were a patch would be accepted, my main
issue is that the with handling code in the compiler is somehow messy.
Not necessarily due to bad coding but simply the way how "with" works.
It is similiar to the proc. var code which is also one of the places
only very brave people look at ;)


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


Re: [Lazarus] Encoding with SDF dataset

2015-11-06 Thread Marc Santhoff
On Do, 2015-11-05 at 19:01 +0100, Marc Santhoff wrote:
> On Do, 2015-11-05 at 15:57 +0100, Michael Van Canneyt wrote:
> > 
> > On Thu, 5 Nov 2015, Marc Santhoff wrote:
> > 
> > > On Do, 2015-11-05 at 14:25 +0100, Marc Santhoff wrote:
> > >> On Mi, 2015-11-04 at 19:01 +0100, Marc Santhoff wrote:

> > >>> How can I fix it?
> 
> Got to ask some more questions ...

Forget about it. Too small budget, too much work. Stopped.

Marc

-- 
Marc Santhoff 


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


Re: [Lazarus] Test This Please

2015-11-06 Thread Anthony Walter
Paul, I think that's an issue with the Lazarus Gtk2 TTrayIcon component
just not showing up on Kde, and nothing to do with being launched from the
command line. A few weeks ago I added support to the component for Unity
app indicators and it was reported to have fixed the issue, but I removed
it after some concerns others had mentioned.

Mark, graphing isn't super cheap on the CPU. It's updating every 100ms. If
you keep it closed other than when you want to check and it uses will use <
%1. I compared my app when visible to the gnome-system-monitor (which takes
up a lot of the CPU even when not visible) and mine uses less. So I guess
if you want a graphic representation of CPU usage the best I can say is
cpugraph uses less resources than gnome-system-monitor, and almost no
resources when hidden.

Also, there are 32 and 64 bit versions:

http://cache.getlazarus.org/debs/cpugraph_1.0.1-1-i386.deb
http://cache.getlazarus.org/debs/cpugraph_1.0.1-1-amd64.deb
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] StringGrid1.LoadFromCSVFile problem

2015-11-06 Thread Mattias Gaertner
On Fri, 6 Nov 2015 09:15:31 +0100
fecske fecske  wrote:

>[...]
> I could now test the Lazarus SVN Rev 50211
> Unfortunately, I experience the same problem.
> https://youtu.be/0OdBpKAwXGM
> 
> I use it 'tab' delimiter #9.
> 
> Here's the code:
> procedure TForm1.FileListBox1Click(Sender: TObject);
>   begin
> StringGrid1.LoadFromCSVFile(FileListBox1.FileName, #9, TRUE, 3 ,TRUE);
>   end;
> 
> I did a test, I wrote a Delphi code in a delphi IDE with unique
> function and stringgrid, and  are not these characters and some lines
> not displayed correctly
> I use the same csv files.
> can be found in the attached zip file

Fixed.

Mattias

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Paul Michell


On 06/11/15 11:11, Anthony Walter wrote:
Okay I put up new debs (cpugraph_1.0.1-1) which if you get and run 
will just overwrite the previous version, assuming the program isn't 
running.


The menu is now fixed and I can run from there, but still no tray icon, 
so no way to close it?



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


[Lazarus] AnchorDockingDsgn with multi-monitor setup

2015-11-06 Thread Rik van Kekem
We've already discussed some of this on the forum. See topic for extra 
background:

http://forum.lazarus.freepascal.org/index.php/topic,30226.msg192660.html#msg192660

My left monitor is primary monitor but it's numbered 2 in Windows.
See image at 
http://forum.lazarus.freepascal.org/index.php/topic,30226.90.html

My monitor on the right is the extended one and is numbered 1.

Lazarus with AnchorDockingDsgn always opens up on monitor 1 (my monitor 
on the right).
I've already submitted a bug-track: 
http://mantis.freepascal.org/view.php?id=28803


My question is probably for Mattias (as assignee of the bug-report and 
author of anchordocking) or others who worked on this. In 
lazarus\components\anchordocking\anchordocking.pas there is some 
monitor-code in SetupSite() function and before that. There the WorkArea 
of Node.Monitor in Screen.Monitors is taken. But why is this WorkArea 
again calculated if it was already saved in environmentoptions.xml? The 
problem I'm having now is that Lazarus always restores to the monitor on 
the right (which is the extended monitor, not the primary one).


If I change the following it works for both monitors, regardless on 
which Lazarus was closed, it will open always at the same position. It 
just takes the WorkArea which is already saved and used for opening Lazarus.


--- 
C:/Users/Rik/AppData/Local/Temp/anchordocking.pas-revBASE.svn000.tmp.pas 
ma okt 26 22:34:11 2015
+++ C:/dev/lazarus/components/anchordocking/anchordocking.pasvr nov  
6 13:50:20 2015

@@ -1749,7 +1749,8 @@ var
 aMonitor:=Screen.Monitors[Node.Monitor]
   else
 aMonitor:=Site.Monitor;
-  WorkArea:=aMonitor.WorkareaRect;
+  //WorkArea:=aMonitor.WorkareaRect;
+  WorkArea:=SrcWorkArea;
   {$IFDEF VerboseAnchorDockRestore}
   debugln(['TAnchorDockMaster.RestoreLayout.SetupSite 
WorkArea=',dbgs(WorkArea)]);

   {$ENDIF}

I think all the monitor-stuff could be deleted because the WorkArea is 
already saved.

(or am I seeing this wrong?)

Grtz,
Rik (rvk on forum)


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


Re: [Lazarus] Using event driven components in console application

2015-11-06 Thread taazz

On 06/11/2015 11:25 πμ, Mark Morgan Lloyd wrote:

JuuS wrote:

On 11/05/2015 07:05 PM, JuuS wrote:


On 11/04/2015 12:30 PM, Mark Morgan Lloyd wrote:

JuuS wrote:

On 11/04/2015 09:48 AM, Mark Morgan Lloyd wrote:
When building the IDE you'd normally use  make bigide  or similar 
which
would use the platform defaults, but depending on what libraries 
etc.

were available you could also use e.g.  make LCL_PLATFORM=qt bigide


Hi,

This question / discussion is also very interesting to me (warning
possible dumb questions ahead).

I am still very vague on the widget type/set in my gnu/linux 
education.

I'm kub14.04, the ide then uses gtk2, all automatic.

If that's Kububtu, I'd expect it to be using KDE which implies you've
already got Qt. Assuming that you have- or can add- libqt4pas-dev then
you can build the Lazarus IDE etc. for Qt.


A. Thank you for the insight! Yes, I can now compile qt as well as
gtk2.

So simple!!...when you know what is needed...



Just FYI for others that may be in my position:

This insight (using a qt version) just solved the problem I was having
with a later install version of kub 14.04 and kub 15.04 and 15.10 where
a simple progress bar from the comp. palette showed fine in my
development computer (earlier install v. of 14.04) but would NOT show in
those other two versions. Ouch.

Thanks again, you just solved a headache for me (but one needs to
install the libqt4pas5 library on the destination machines, even so
problem solved).


Having to have that library is unfortunate, but is a fundamental 
requirement since Qt exposes a C++ API which is not directly usable by 
FPC.



I thought  that any C++ API is not directly usable outside the compiler 
that build it. Even an older version of the same compiler might not be 
able to use it or a newer one for that matter. Am I wrong?


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


Re: [Lazarus] fpcup on arm-linux

2015-11-06 Thread Koenraad Lelong

Op 05-11-15 om 20:34 schreef Koenraad Lelong:

Op 05-11-15 om 18:19 schreef Alfred:

Use a very big swap (file) !

For Lazarus, at least 1GB is needed.

On my RPi2, Lazarus installs (fpcup) and runs ok


Thanks,

But I have about 5G swap on a USB hard-disk.

Koenraad.


Hi,

I made a new SD-card, installed the requirements, added swap and mounted 
a USB-HD on the development directory.

Now I have a working lazarus on the Raspberry Pi 2.

Thanks.



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


[Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Marco van de Voort

FYI:

I yesterday tried to implement some of the TRect helper methods in 3.1.1 and
property and Lazarus(/win32) refused to start due to WMSIZE loops.

I haven't investigated deeper yet, but I suspect the heavy use of WITH in
interfaces etc is the cause.  (if you assign width and height of a
component in a component method in a WITH with a TRECT as argument, then now
width and height of the trect are assigned instead of the component's ?

Probably method calling (setwidth/setheight?) is dangerous too.

Request for TRect and patch that I used : 
http://bugs.freepascal.org/view.php?id=21041


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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Dmitry Boyarintsev
On Fri, Nov 6, 2015 at 10:45 AM, Marco van de Voort  wrote:

> I haven't investigated deeper yet, but I suspect the heavy use of WITH in
> interfaces etc is the cause.  (if you assign width and height of a
> component in a component method in a WITH with a TRECT as argument, then
> now
> width and height of the trect are assigned instead of the component's ?
>

This is odd. How adding  the method to TRect didn't break much for Delphi?
(or maybe it did, we just don't know it).
I'd think that Delphi /3d party components code also uses a lot of WITHs
with TRects

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Ondrej Pokorny

On 06.11.2015 17:08, Dmitry Boyarintsev wrote:

This is odd. How adding  the method to TRect didn't break much for Delphi?


It did break a lot of code for Delphi.

I'd think that Delphi /3d party components code also uses a lot of 
WITHs with TRects.


Yes, it did break a lot of code in 3rd party components as well.

---

Nevertheless I am of the opinion that WITH is evil and should be removed 
from the IDE/LCL code (unless only identifiers from within the with 
scope are used; but even then they could be removed...). The 
Width/Height (+ other useful functions) are a good TRect enhancement.


Ondrej

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Marco van de Voort
On Fri, Nov 06, 2015 at 11:08:29AM -0500, Dmitry Boyarintsev wrote:
> > I haven't investigated deeper yet, but I suspect the heavy use of WITH in
> > interfaces etc is the cause.  (if you assign width and height of a
> > component in a component method in a WITH with a TRECT as argument, then
> > now
> > width and height of the trect are assigned instead of the component's ?
> >
> 
> This is odd. How adding  the method to TRect didn't break much for Delphi?
> (or maybe it did, we just don't know it).

Maybe they were more careful with WITH or had problems and simply fixed
them, always used self. to qualify such cases. I don't routine look at
Delphi source, so I don't know which one.

> I'd think that Delphi /3d party components code also uses a lot of WITHs
> with TRects

Well, not anymore I guess :-) Or there is a flaw in my thinking, but if so,
then I don't see it. I'm currently building fpc with raise tobject.create in
the relevant methods to see if I can quickly identify some locations. 

Yup:

a#0  0x77055b68 in RaiseException () from C:\WINDOWS\SysWOW64\KernelBase.dll
#1  0x00416039 in fpc_raiseexception (OBJ=0xe11f3c8, ANADDR=0x0,
# AFRAME=0xe11f730) at seh32.inc:93
#2  0x00417cb6 in RECT__SETWIDTH (AVALUE=236058416, this=...) at
# c:/repo/fpc/rtl/win/wininc/func.inc:2414
#3  0x00531d0a in TWIN32WIDGETSET__GETWINDOWSIZE (HANDLE=986038,
# WIDTH=986038, HEIGHT=5,
this=) at
C:/repo/lazarus/lcl/interfaces/win32/win32winapi.inc:2395
#4  0x004f0c0e in GETWINDOWSIZE (HANDLE=986038, WIDTH=986038, HEIGHT=5) at
# C:/repo/lazarus/lcl/include/winapi.inc:564
#5  0x0052ad58 in TWINDOWPROCHELPER__DOMSGSIZE (this=)
at C:/repo/lazarus/lcl/interfaces/win32/win32callback.inc:1903
#6  0x0052be5b in TWINDOWPROCHELPER__DOWINDOWPROC (this=)
at C:/repo/lazarus/lcl/interfaces/win32/win32callback.inc:2358
#7  0x0052c767 in WINDOWPROC (WINDOW=986038, MSG=5, WPARAM=0, LPARAM=0)

Maybe for the 3rd party support it is smart to tag them with experimental or
so till this code is really release (as 3.2), so that people at least get
an hint that something is/could be wrong.

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Martin Schreiber
On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
>
> Nevertheless I am of the opinion that WITH is evil and should be removed
> from the IDE/LCL code (unless only identifiers from within the with
> scope are used; but even then they could be removed...).

Or implement a safe "with" in Free Pascal without waiting until it is enforced 
by Delphi compatibility...

Martin

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Graeme Geldenhuys
On 2015-11-06 16:20, Ondrej Pokorny wrote:
> Nevertheless I am of the opinion that WITH is evil 

+1

Especially if you mix more than one scope/variable in the with block.

Regards,
  - Graeme -


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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Michael Van Canneyt



On Fri, 6 Nov 2015, Martin Schreiber wrote:


On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:


Nevertheless I am of the opinion that WITH is evil and should be removed
from the IDE/LCL code (unless only identifiers from within the with
scope are used; but even then they could be removed...).


Or implement a safe "with" in Free Pascal without waiting until it is enforced
by Delphi compatibility...


Ehm. How can "with" ever be safe ?

Don't get me wrong:

I use it abundantly. If I have QMYQueryObjectWithAVeryLongName then being able 
to write

With QMYQueryObjectWithAVeryLongName do
  try
// Really nice code
  finally
Close;
  end;

is really good (tm).

NOT being able to use with would seriously impede on the readability of my code.

Add this to the observation that the lazarus team demands 'clear' variable 
names,
and does not like/accept i,m,f,p,q or whatever as variable names, and using "with" 
becomes very attractive indeed...


Michael.

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


[Lazarus] AnsiPropercase (aka Capitalize) with UTF-8 support

2015-11-06 Thread Krzysztof
Hi,

Is there any similar function for UTF-8? Can't find anything in LazUtf8 unit

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


Re: [Lazarus] Test This Please

2015-11-06 Thread Anthony Walter
Thanks mentioning LazPackager. I think I now have have a better way to find
dependencies. Are
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] AnsiPropercase (aka Capitalize) with UTF-8 support

2015-11-06 Thread Mattias Gaertner
On Fri, 6 Nov 2015 17:43:03 +0100
Krzysztof  wrote:

> Hi,
> 
> Is there any similar function for UTF-8? Can't find anything in LazUtf8 unit

No.
Feel free to provide one.

Mattias

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Marco van de Voort
On Fri, Nov 06, 2015 at 05:42:39PM +0100, Michael Van Canneyt wrote:
> > by Delphi compatibility...
> 
> Ehm. How can "with" ever be safe ?

Btw the case that I fixed was like this

procedure TSomeForm.Getwind...

procedure setwidthheight(const r : TRect); inline;
begin
 with R do
   begin
width:=right-left;
height:=bottom-top;
  end;
end;

begin
 ... 
  setwidtheight(r);
end

In such case fixing with SELF doesn't work, because self isn't allowed in
the nested function. I had to strip the WITH.

Luckily it wasn't as bad as expected, and only this one in the win32 widget
set.

> 
> Don't get me wrong:
> 
> I use it abundantly. If I have QMYQueryObjectWithAVeryLongName then being 
> able to write

Me too, but I like to qualify fieldnames with self when the they are short,
common words.
 


> With QMYQueryObjectWithAVeryLongName do
>try
>  // Really nice code
>finally
>  Close;
>end;
> 
> is really good (tm).
> 
> NOT being able to use with would seriously impede on the readability of my 
> code.
> 
> Add this to the observation that the lazarus team demands 'clear' variable 
> names,
> and does not like/accept i,m,f,p,q or whatever as variable names, and using 
> "with" 
> becomes very attractive indeed...
> 
> Michael.
> 
> --
> ___
> 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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Flávio Etrusco
On Fri, Nov 6, 2015 at 1:42 PM, Michael Van Canneyt
 wrote:
>
>
> On Fri, 6 Nov 2015, Martin Schreiber wrote:
>
>> On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
>>>
>>>
>>> Nevertheless I am of the opinion that WITH is evil and should be removed
>>> from the IDE/LCL code (unless only identifiers from within the with
>>> scope are used; but even then they could be removed...).
>>
>>
>> Or implement a safe "with" in Free Pascal without waiting until it is
>> enforced
>> by Delphi compatibility...
>
>
> Ehm. How can "with" ever be safe ?
>
> Don't get me wrong:
>
> I use it abundantly. If I have QMYQueryObjectWithAVeryLongName then being
> able to write
>
> With QMYQueryObjectWithAVeryLongName do
>   try
> // Really nice code
>   finally
> Close;
>   end;
>
> is really good (tm).
>
> NOT being able to use with would seriously impede on the readability of my
> code.
>
> Add this to the observation that the lazarus team demands 'clear' variable
> names,
> and does not like/accept i,m,f,p,q or whatever as variable names, and using
> "with" becomes very attractive indeed...
>
> Michael.

I hate "with" with passion because maintaining code written using it
(by other people ;-) ) is very often a living hell.
I, for one, always use local variables in that case, but I'd really
really love to be able to declare an alias for "with" expression, no
matter how many people say it's unpascalish...

WRT a "safe with", well, the compiler could continue the identifier
search as if it didn't find in the With expression and then generate
an error or warning...

-Flávio

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Graeme Geldenhuys
On 2015-11-06 16:42, Michael Van Canneyt wrote:
> I use it abundantly. If I have QMYQueryObjectWithAVeryLongName then being 
> able to write

Can't you simply use an "absolute" variable, or alias variable with a
shorter name - instead of WITH all together.

I hate WITH, but do use it on occasion - primarily in fpGUI's Form
Designer (auto generated code). But if I do have to use WITH, I always
only use one variable with it.

For me at least, WITH falls into the same category as GOTO. It has its
pitfalls, can easily be abused, but useful on occasions.  ;-)

Regards,
  - Graeme -

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

My public PGP key:  http://tinyurl.com/graeme-pgp

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Graeme Geldenhuys
On 2015-11-06 16:42, Michael Van Canneyt wrote:
> Ehm. How can "with" ever be safe ?

I forgot to add in my previous message... I also can't see how WITH can
ever be made safe.

Regards,
  - Graeme -

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

My public PGP key:  http://tinyurl.com/graeme-pgp

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Martin Schreiber
On Friday 06 November 2015 17:42:39 Michael Van Canneyt wrote:
> On Fri, 6 Nov 2015, Martin Schreiber wrote:
> > On Friday 06 November 2015 17:20:24 Ondrej Pokorny wrote:
> >> Nevertheless I am of the opinion that WITH is evil and should be removed
> >> from the IDE/LCL code (unless only identifiers from within the with
> >> scope are used; but even then they could be removed...).
> >
> > Or implement a safe "with" in Free Pascal without waiting until it is
> > enforced by Delphi compatibility...
>
> Ehm. How can "with" ever be safe ?
>
You are joking, no? It has been discussed on fpc-pascal/fpc-devel several 
times. An IIRC Italian community member then usually shows a syntax 
description of a safe "with" statement from a maybe more than 20 year old 
pascal dialect.
But probably such language additions are not sexy enough.

Martin

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


Re: [Lazarus] Extending TRect breaks Lazarus

2015-11-06 Thread Mark Morgan Lloyd

Luca Olivetti wrote:

El 06/11/15 a les 18:10, Martin Schreiber ha escrit:


You are joking, no? It has been discussed on fpc-pascal/fpc-devel several
times. An IIRC Italian community member then usually shows a syntax
description of a safe "with" statement from a maybe more than 20 year old
pascal dialect.


I don't know if that's me, but, yes, I used a variant of pascal (by 
texas instruments) that allowed to declare aliases with "with", e.g


 with a=somerecord, b=someotherrecord do
 begin
   a.x:=b.x;
 end;


Just because something is 20+ years old doesn't necessarily make it bad. 
That syntax looks OK to me (i.e. make a and b look like consts) but I 
also find myself wondering what the type rules are, i.e.


with pod: TTabSheet= Pages.Objects[deleteAt] do

vs

with pod= TTabSheet(Pages.Objects[deleteAt]) do

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