Re: [fpc-pascal] Userfriendly editor

2011-06-08 Thread Graeme Geldenhuys
On 7 June 2011 16:00, reynolight  wrote:
> If you prefer syntax hilites etc., completely customizable to your
> requirements, go and get EditPlus, www.editplus.com. Even on Wine.

How do you call a FPC 64-bit Linux compiler from a 32-bit WINE editor?
That's where such solutions fall over.

Another good alternative, and extremely fast editor is jEdit.  Or even
MSEide is a good choice. I use the latter quite often these days, yet
I don't develop MSEgui based applications.

-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] When the variable freed in Optimize compile

2011-06-08 Thread Zaher Dirkey
Hi, I know when compile the project with optimize in Delphi the variable
freed/allocated after the last line used.
How can i make same in FPC, O3 not worked for me.
I used FPC 2.4.4

var
  c: Currency;
begin
   c := 10;
   writeln(c);
<___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] When the variable freed in Optimize compile

2011-06-08 Thread Jonas Maebe


On 08 Jun 2011, at 10:57, Zaher Dirkey wrote:

Hi, I know when compile the project with optimize in Delphi the  
variable

freed/allocated after the last line used.
How can i make same in FPC, O3 not worked for me.


FPC only reuses stack slots allocated for temporary expressions. It  
does not reuse stack slots used by variables.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] When the variable freed in Optimize compile

2011-06-08 Thread michael . vancanneyt



On Wed, 8 Jun 2011, Zaher Dirkey wrote:


Hi, I know when compile the project with optimize in Delphi the variable
freed/allocated after the last line used.
How can i make same in FPC, O3 not worked for me.
I used FPC 2.4.4

var
 c: Currency;
begin
  c := 10;
  writeln(c);
<

C (as a currency) is never 'freed'. It is declared throughout the whole 
procedure.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Userfriendly editor

2011-06-08 Thread Schindler Karl-Michael
> Message: 4
> Date: Tue, 7 Jun 2011 20:02:20 +0200
> From: Graeme Geldenhuys 
> Subject: Re: [fpc-pascal] Userfriendly editor
> To: FPC-Pascal users discussions 
> Message-ID: 
> Content-Type: text/plain; charset=UTF-8
> 
> How do you call a FPC 64-bit Linux compiler from a 32-bit WINE editor?
> That's where such solutions fall over.
> 
> Another good alternative, and extremely fast editor is jEdit.  Or even
> MSEide is a good choice. I use the latter quite often these days, yet
> I don't develop MSEgui based applications.

My prime topic in editors is dealing with line endings, because to
my surprise some editors still fail. The behavior I expect is:

1) Save in the same format as opened. Definitely no automatic conversion.
(Think of editing files on a samba share)
2) Ability of convert in "Save As" or similar.
3) Ability to fix files with mixed line endings.
(Hard to believe, but there are some win32 editors, which set the line endings 
of new lines to windows style but leave the other lines as they are in files 
with 
unix style.)

Just my 2 cents - MiSchi (admits to still use AlphaX on Mac OS X)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Userfriendly editor

2011-06-08 Thread reynolight
Am 07.06.2011 20:02, schrieb Graeme Geldenhuys:
> On 7 June 2011 16:00, reynolight  wrote:
>> If you prefer syntax hilites etc., completely customizable to your
>> requirements, go and get EditPlus, www.editplus.com. Even on Wine.
> How do you call a FPC 64-bit Linux compiler from a 32-bit WINE editor?
> That's where such solutions fall over.
Yes. My recommendation for EditPlus is valid only for 32 bit Windows or
Linux/Wine. But there, nothing compares to it.

> Another good alternative, and extremely fast editor is jEdit.  Or even
> MSEide is a good choice. I use the latter quite often these days, yet
> I don't develop MSEgui based applications.
When I am using a plain editor for Pascal development, everything comes
down to real customization of syntax hilites and keyboard shortcuts,
powerful search & replace, integrated console window, jumping on the
source line by doubleclick etc. That's where EP shines, and, from my
point of view, no other editor compares.

An IDE is a different category. Lazarus or MSE.

To be honest, I would love it to see just one option, _the_ FreePascal IDE.

With my first 64-bit machine these days, I am going to switch to
Lazarus. Thought, you already did so, years ago? :)


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Userfriendly editor

2011-06-08 Thread reynolight
Am 08.06.2011 12:03, schrieb Schindler Karl-Michael:
> My prime topic in editors is dealing with line endings, because to
> my surprise some editors still fail. The behavior I expect is:
>
> 1) Save in the same format as opened. Definitely no automatic conversion.
> (Think of editing files on a samba share)
> 2) Ability of convert in "Save As" or similar.
> 3) Ability to fix files with mixed line endings.
> (Hard to believe, but there are some win32 editors, which set the line 
> endings 
> of new lines to windows style but leave the other lines as they are in files 
> with 
> unix style.)

Yes. Plus easy handling of UTF-8 vs. other encodings, with or without BOM.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Userfriendly editor

2011-06-08 Thread Rainer Stratmann
Am Tuesday 07 June 2011 16:00:35 schrieb reynolight:
> Am 06.06.2011 22:02, schrieb Rainer Stratmann:
> > http://www.geany.org/
> > Screenshots:
> > http://www.geany.org/uploads/Gallery/geany_main.png
> > http://www.geany.org/uploads/Gallery/geany_build.png
> >
> > http://www.geany.org/uploads/Gallery/geany_plugins.png
> > ___
> > fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
> Ever tried to use it with FreePascal?

No, but it seems very userfriendly and if you look in the description you see 
that the soucecode can be written in pascal also.

> If you prefer syntax hilites etc., completely customizable to your
> requirements, go and get EditPlus, www.editplus.com. Even on Wine.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Userfriendly editor

2011-06-08 Thread Rainer Stratmann
Am Wednesday 08 June 2011 12:03:12 schrieb Schindler Karl-Michael:
> My prime topic in editors is dealing with line endings, because to
> my surprise some editors still fail. The behavior I expect is:

Why I not use MSEgui is because the cursor does not go behind a line ending.
This is a constraint when editing code.

> 1) Save in the same format as opened. Definitely no automatic conversion.
> (Think of editing files on a samba share)
> 2) Ability of convert in "Save As" or similar.
> 3) Ability to fix files with mixed line endings.
> (Hard to believe, but there are some win32 editors, which set the line
> endings of new lines to windows style but leave the other lines as they are
> in files with unix style.)

There should be a solution for that...

> Just my 2 cents - MiSchi (admits to still use AlphaX on Mac OS X)
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Userfriendly editor

2011-06-08 Thread Rainer Stratmann
Am Wednesday 08 June 2011 12:07:32 schrieb reynolight:
> To be honest, I would love it to see just one option, _the_ FreePascal IDE.

And IDE and visual development are two different things.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] When the variable freed in Optimize compile

2011-06-08 Thread Zaher Dirkey
On Wed, Jun 8, 2011 at 11:22 AM,  wrote:

>
>
> On Wed, 8 Jun 2011, Zaher Dirkey wrote:
>
>  Hi, I know when compile the project with optimize in Delphi the variable
>> freed/allocated after the last line used.
>> How can i make same in FPC, O3 not worked for me.
>> I used FPC 2.4.4
>>
>> var
>>  c: Currency;
>> begin
>>  c := 10;
>>  writeln(c);
>> <>  some code here
>> end;
>>
>
> C (as a currency) is never 'freed'. It is declared throughout the whole
> procedure.
>

What if C is string or Interface of TInterfacedObject?

Thanks

-- 
Zaher Dirkey
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

off topic [Re: [fpc-pascal] Userfriendly editor]

2011-06-08 Thread Martin

preface:
Since this is afaik all off-topic, I did set a reply-to to fpc-other. If 
anyone feels the need to reply to this (my) mail, then please honour it.


On 08/06/2011 11:07, reynolight wrote:

Yes. My recommendation for EditPlus is valid only for 32 bit Windows or
Linux/Wine. But there, nothing compares to it.


I find that very hard to believe:
there are plenty of free good editors available (free). Some of them 
surely must be as good as.


There is valuable software out there, which is well worth the money and 
price the author asks for.
But an editor to me does not fall into this category. Price/value is not 
solely determined by features/quality of a single product (editor); it 
depends on the price of competing products. And with editors all the 
competition comes for free (only talking about those which are 
officially/legally free)


Anyway, that said, I had little need myself, to edit entire pascal 
projects outside an IDE. So i haven't spent to much time in comparison, 
and I am not planning on going to.
Neither am I looking to find a new editor for my personal usage. Just 
thought I add my 2 cents here.


Martin


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] When the variable freed in Optimize compile

2011-06-08 Thread Martin

On 08/06/2011 11:37, Zaher Dirkey wrote:
On Wed, Jun 8, 2011 at 11:22 AM, > wrote:




On Wed, 8 Jun 2011, Zaher Dirkey wrote:

Hi, I know when compile the project with optimize in Delphi
the variable
freed/allocated after the last line used.
How can i make same in FPC, O3 not worked for me.
I used FPC 2.4.4

var
 c: Currency;
begin
 c := 10;
 writeln(c);
<


Read the following threads, it has been lengthly discussed before:

http://lists.freepascal.org/lists/fpc-devel/2010-November/022806.html
http://lists.freepascal.org/lists/fpc-devel/2010-November/022867.html

there may be more threads by the same subject

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] check if process ID is running under BSD

2011-06-08 Thread Marco van de Voort
In our previous episode, Mattias Gaertner said:
> > I don't know if it exist a FPC function for that.
> > 
> > i'll do an external commad like " ps -ef | grep bash | grep -v grep | awk 
> > '{print $8}'".
> 
> Thanks, I knew that.
> I prefer a more direct way - for example via a sysctl.
> 
> I need to check under BSD if a PID is running and what name it has.
> Is there already a function for that?

2.5.1 since r17692 try this:

uses freebsd,baseunix,sysutils;

var pid : pid_t;
s: ansistring;
begin
  pid:=strtointdef(paramstr(1),-1);
  writeln('pid (-1 for current):',pid);
  // loads name of process + args with #0's inbetween.
  if kernproc_getargs(pid,s)<>-1 then // does not work with -1
writeln('arguments:',s)
  else
writeln('error fetching arguments:',fpgeterrno);

  // loads full path of running binary
  if kernproc_getpath(pid,s)<>-1 then   // -1 means own process
writeln('arguments:',s)
  else
writeln('error fetching path:',fpgeterrno);
end.

See the implementation of the above procedures in freebsd.pas for more info,
note that the kern_proc_* values were also updated in sysctl.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] When the variable freed in Optimize compile

2011-06-08 Thread michael . vancanneyt



On Wed, 8 Jun 2011, Zaher Dirkey wrote:


On Wed, Jun 8, 2011 at 11:22 AM,  wrote:




On Wed, 8 Jun 2011, Zaher Dirkey wrote:

 Hi, I know when compile the project with optimize in Delphi the variable

freed/allocated after the last line used.
How can i make same in FPC, O3 not worked for me.
I used FPC 2.4.4

var
 c: Currency;
begin
 c := 10;
 writeln(c);
<

C (as a currency) is never 'freed'. It is declared throughout the whole
procedure.



What if C is string or Interface of TInterfacedObject?


It is the same logic. It's freed only at the end.

For compiler-generated temporary variables, you should not make any assumptions.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Userfriendly editor

2011-06-08 Thread Felipe Monteiro de Carvalho
Does anyone know something similar to Notepad++ written in FPC/Lazarus?

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] When the variable freed in Optimize compile

2011-06-08 Thread Flávio Etrusco
On Wed, Jun 8, 2011 at 6:17 AM, Jonas Maebe  wrote:
>
> On 08 Jun 2011, at 10:57, Zaher Dirkey wrote:
>
>> Hi, I know when compile the project with optimize in Delphi the variable
>> freed/allocated after the last line used.
>> How can i make same in FPC, O3 not worked for me.
>
> FPC only reuses stack slots allocated for temporary expressions. It does not
> reuse stack slots used by variables.
>
>
> Jonas
>

While we are at it, is this a limitation or by design?

> >   What if C is string or Interface of TInterfacedObject?
> It is the same logic. It's freed only at the end.

I recently noticed that this is also true for ansistrings. I see this
can avoid lots of errors, but also makes it very ackward to
intentionally avoid copies when modifying strings in-place if they are
obtained from a function...

-Flávio
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Userfriendly editor

2011-06-08 Thread Zaher Dirkey
On Wed, Jun 8, 2011 at 3:03 PM, Felipe Monteiro de Carvalho <
felipemonteiro.carva...@gmail.com> wrote:

> Does anyone know something similar to Notepad++ written in FPC/Lazarus?
>
>
I am working on my MiniEdit, it is not for PHP only, but still need to more
of times.

http://www.parmaja.com/pages/63
https://github.com/parmaja/miniedit


> --
> Felipe Monteiro de Carvalho
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



-- 
Zaher Dirkey
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal