Re: [fpc-pascal] Best method to uninstall fpc and lazarus

2008-09-02 Thread Damien Gerard


Le Sep 2, 2008 à 12:12 PM, Paul a écrit :


The uninstall steps on the wiki at 
http://wiki.freepascal.org/OS_X_Programming_Tips#Uninstalling_Lazarus_and_Free_Pascal


rm -fv $bin/ppcppc  shows permission denied
Didn't test all subsequent items



sudo rm -f /usr/local/bin/ppcppc



--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Installing on Mac OS X

2008-09-01 Thread Damien Gerard


Le Sep 1, 2008 à 2:58 PM, Paul a écrit :


/usr/local/bin/ppc386
it'wasn't listed in the dropdown box.
I closed Lazarus (still open from yesterday) and now I can't find  
lazarus anymore.
I understood that I have to add the directories manually in a  
console application or terminal, a return to the DOS age.


You should not compare DOS and a Terminal :)




I need to get a book using OS X first, because this leads to nowhere.
It won't be before weekend though.
Anyway, while Lazarus was open, I saw bugs in the editor: the last  
character of each line was written over the previous character.

Form = class(TFor) instead of Form=class(TForm)
en; instead of end;
Looks like a bug ..

Paul


- Original Message - From: Jonas Maebe [EMAIL PROTECTED] 


To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Monday, September 01, 2008 11:02 AM
Subject: Re: [fpc-pascal] Installing on Mac OS X




On 31 Aug 2008, at 18:52, Paul wrote:

Now I get Free Pascal compiler not found when Lazarus starts   
although it exists.


Check the Compiler path in Environment-Environment Options. It   
should read something like /usr/local/bin/ppc386






--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] FPC 2.3.1 on Mac OS X?

2008-08-30 Thread Damien Gerard


Le Aug 30, 2008 à 1:25 PM, Paul a écrit :


Hi,

I've read that there are some issues with FPC 2.2.0 on Mac OSX.
Is it save to install version 2.3.1 already ?




I use FPC from the snapshots (http://snapshots.lazarus.shikami.org/lazarus/ 
) so it is fpc 2.2.2 and it really works fine for me (it is the latest  
stable version).
The last time I checked there were still issues with generics however  
it is not something absolutely needed



--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Mac OS X api cals

2008-08-29 Thread Damien Gerard


Le Aug 28, 2008 à 10:55 PM, Paul a écrit :

However, as a bank, they only trust on themselves. And they like  
to  reinvent a broken wheel :)


exactly :-)

they also like many custom features ..



Just in case you really really want to remake the world, here is a  
link which may help you :
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/QuartzDisplayServicesConceptual/Articles/MouseCursor.html#/ 
/apple_ref/doc/uid/TP40004269




--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Mac OS X api cals

2008-08-29 Thread Damien Gerard


Le Aug 29, 2008 à 10:55 PM, Damien Gerard a écrit :



Le Aug 28, 2008 à 10:55 PM, Paul a écrit :

However, as a bank, they only trust on themselves. And they like  
to  reinvent a broken wheel :)


exactly :-)

they also like many custom features ..



Just in case you really really want to remake the world, here is a  
link which may help you :
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/QuartzDisplayServicesConceptual/Articles/MouseCursor.html#/ 
/apple_ref/doc/uid/TP40004269


http://developer.apple.com/documentation/GraphicsImaging/Reference/Quartz_Services_Ref/Reference/reference.html#/ 
/apple_ref/c/func/CGDisplayModelNumber



--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Mac OS X api cals

2008-08-28 Thread Damien Gerard


Le Aug 28, 2008 à 9:29 AM, Jonas Maebe a écrit :



On 28 Aug 2008, at 08:11, Paul wrote:


http://developer.apple.com/documentation/Security/Conceptual/authorization_concepts


thanks for these links, wonder why this site was not listed the mac  
developer forums ..


A lot depends on who, how and where you asked. And  
developer.apple.com is the very first site you get when googling for  
mac programming or apple programming. To be honest, I also  
thought you already knew about that site, but simply did not know  
what exactly to look for there (e.g., authorization vs  
administrator rights)..


And he can of course also look at the source code of existing VNC   
servers, e.g. http://sourceforge.net/projects/osxvnc/

see my other reply


It does not mean that your client can't simply enable a local VNC  
server, open a https tunnel to the server and simply tunnel VNC over  
this connection. Of course, no one can stop you from reimplementing  
everything, but it's probably going to be quite a bit of work (as  
such low level things are quite platform specific).



Indeed


--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Mac OS X api cals

2008-08-28 Thread Damien Gerard


Le Aug 28, 2008 à 10:26 AM, Paul a écrit :





I was not suggesting to tunnel over your server, but to your  
server.  Your server already contains a control infrastructure. If  
you'd go  this route, your server would translate your proprietary  
protocol into  VNC commands and back. Depending on the complexity  
of your protocol,  this may be easier or harder than re- 
implementing and maintaining your  entire client (which, as far as  
I understand, is mostly equivalent to  a VNC server but using a  
different protocol) on the Mac side.


That would be almost impossible: a session is running with 8 https  
clients communicating to the server.
The server has to have certificate that can be checked continuously  
at the certificate authority.
It's a complete different model than all existing software and is  
mainly used by large enterprise clients.
Some need a very high secutity level (banks) and we even need to  
write special servers for them.

Believe me: they won't take VNC for an answer.


I don't see the problem if you use a good and strong VPN. If was the  
case in my last job and we worked for a bank.




Paul




--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Mac OS X api cals

2008-08-28 Thread Damien Gerard


Le Aug 28, 2008 à 8:09 PM, Jonas Maebe a écrit :



On 28 Aug 2008, at 09:26, Paul wrote:

That would be almost impossible: a session is running with 8 https  
clients communicating to the server.
The server has to have certificate that can be checked continuously  
at the certificate authority.
It's a complete different model than all existing software and is  
mainly used by large enterprise clients.
Some need a very high secutity level (banks) and we even need to  
write special servers for them.

Believe me: they won't take VNC for an answer.


I really don't see the problem. Your client software would obviously  
be doing all the certificate checking and the customers don't have  
to know whether it's vnc or your proprietary protocol underneath.  
There are simply two separate things:

a) software to let a remote user control a local computer
b) secure transmission and authentication of the commands etc  
between the server and the local computer


Now,
a) can be done with vnc
b) can be done by tunneling the vnc data stream over as many https  
connections as you want, which are authenticated as often and  
wherever you want, using your client software. I.e., the client  
software can simply be a secure proxy for a vnc data stream  
(breaking it up and sending different kinds of packets over  
different https connections or whatever).


Of course, if you need to be able to do things that the vnc protocol  
itself does not support, that would be another matter (but I haven't  
seen that being mentioned).



However, as a bank, they only trust on themselves. And they like to  
reinvent a broken wheel :)



--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Re: Socket library for Mac OS X

2008-08-28 Thread Damien Gerard


Le Aug 28, 2008 à 9:49 PM, Paul a écrit :


Ok thanks,

I'll try it also,

I'm still waiting for my Mac though, so for the moment I can't test  
anything at all :-(




In the worst case you can install Darwin in a VMWare on your win/nux  
distrib to make tests.
It will be exactly the same, however without the GUI and the DMG  
installer won't work, but you can easily do it without it.





Paul



- Original Message - From: Mattias Gaertner [EMAIL PROTECTED] 


To: fpc-pascal@lists.freepascal.org
Sent: Thursday, August 28, 2008 9:44 PM
Subject: Re: [fpc-pascal] Re: Socket library for Mac OS X



On Thu, 28 Aug 2008 20:57:22 +0200
Paul [EMAIL PROTECTED] wrote:


I've asked the Synapse list and since Lukas is answering on the list
but got no answer, I assumed it wouldn't work.


He has no Mac so he can not test it.



It's also listed on his website/l only Windows and Linux.


No one tested it yet carefully.
I only use some ftp and http things. So maybe some things don't work.



What has to changed to use it with Mac OS X then ?


Not much. It uses the FPC socket unit which exists on many platforms.
In my old version I had to replace the 'IFDEF Linux' with 'IFDEF  
Unix'

and to add a few 'libc' calls.
Maybe the new version has fixed that.


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




--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Socket library for Mac OS X

2008-08-27 Thread Damien Gerard


Le Aug 27, 2008 à 1:06 PM, Paul a écrit :


Are there any socket library's available for Mac OSX with FPC?

I need Https communication

TIA




lNet works very well on OS X, and I prefer it instead of Synapse  (http://lnet.wordpress.com/blog/ 
)



--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Mac OS X api cals

2008-08-27 Thread Damien Gerard


Le Aug 26, 2008 à 3:49 PM, Paul a écrit :


Hi,

i want to port one of my Delphi applications to Mac OS X.
Before I start (don't even have a Mac yet), I need to know if it's  
possible at all.

It's a client side part of a remote admin program.
For this program, I need to control the system and get info about  
the system like:

- check if user has admin rights


It is an UNIX env. So admin rights is nearly meaningless.
However the `id` command should help you


- get a list of available screenresolutions and change it
- inject keypresses and stuff like that ...


Instead of reinventing the wheel you should use the Apple Remote  
Desktop or a VNC client (I recommend you a SSH tunnel)


OS X Leopard provides a VNC Server
http://lifehacker.com/software/how-to/remote-control-leopard-with-tightvnc-319528.php

It is the *recommended* way



 I've asked in Mac-forums, but no one seems to be able to answer it.
When I mentioned FreePascal,  I've got no reply's at all anymore.
Talking about closed communities 

Does anyone knows where to get this information ?

TIA,

Paul




--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Translate C to Pascal

2008-07-30 Thread Damien Gerard


Le Jul 30, 2008 à 10:37 PM, Lourival Mendes a écrit :


I would do something like this:


C

struct product {
 int weight;
 float price;
} ;

product apple;
-

Pascal

Type
  product = record
 weight: Integer ;
 price: double;
   end;

Var
 apple: product ;


This is the reason that I do believe that is missing something on  
the code:


struct a;




A C-struct is merely a record. A struct with methods is a class.

struct Foo
{
Foo() : tag(0) {}
int tag;
void compute() {...}
};

would be

class Foo
private
  FTag: Integer;
public
  constructor Create;
  procedure compute;
  property tag: Integer read FTag write FTag;
end;

the property is not really needed of course.


--
Damien Gerard
[EMAIL PROTECTED]

Si ces robots s'humanisaient, inversement les êtres humains se  
robotiseraient-ils ?









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


Re: [fpc-pascal] Re: FPC 2.2.1 on Mac OS X

2008-06-05 Thread Damien Gerard


Le Jun 5, 2008 à 8:11 AM, Karl-Michael Schindler a écrit :


Hallo

Am 4. Jun 2008 um 09:56 schrieb Damien Gerard:


Le Jun 4, 2008 à 8:51 AM, Karl-Michael Schindler a écrit :

I only noticed now the discussion on the mailing list about fpc  
2.2.1 and lazarus on Mac OS X. As the maintainer of the .info  
files of fpc and lazarus I should probably lay out my ideas about  
the future.


The next step is fpc 2.2.2. It should resolve some of the issues  
in a clean way and enable to remove some workarounds as well as  
serve as a solid base for a lazarus installation.


When this is settled, I will extend lazarus in the following way:

1) create so-called splitoffs, so there will be separate packages  
for lazarus-gtk1, lazarus-aqua and when ready lazarus-gtk2.
Then the user can simply choose the best interface for his  
situation. This can be done, whatever the default setting of  
LCLPLATFORM will be.


2) create double clickable Lazarus applications with links in / 
Applications/Fink.




Please not Fink. Put only Lazarus.app as it already exists (Carbon  
widgetset) into /Applications/ (through an installer since it  
installs FPC too).


I do not really understand this. Fink is not suppossed to install  
anything anywhere else than in the /sw/... tree and /Applications/ 
Fink. Direct installations into /Applications are the matter of  
the .dmg based packages, which is a different way not related to fink.




How do you use fink for your work with freepascal and lazarus?


I don't use Fink. I use MacPort, which is far better from my point of  
view (actually more up-to-date than Fink, especially when there is a  
major system update).




--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Re: FPC 2.2.1 on Mac OS X

2008-06-05 Thread Damien Gerard


Le Jun 5, 2008 à 2:09 PM, Jonas Maebe a écrit :



On 05 Jun 2008, at 09:50, Damien Gerard wrote:


Le Jun 5, 2008 à 8:11 AM, Karl-Michael Schindler a écrit :


Hallo

Am 4. Jun 2008 um 09:56 schrieb Damien Gerard:

Please not Fink. Put only Lazarus.app as it already exists  
(Carbon widgetset) into /Applications/ (through an installer  
since it installs FPC too).


I do not really understand this. Fink is not suppossed to install  
anything anywhere else than in the /sw/... tree and /Applications/ 
Fink. Direct installations into /Applications are the matter of  
the .dmg based packages, which is a different way not related to  
fink.


How do you use fink for your work with freepascal and lazarus?


I don't use Fink. I use MacPort, which is far better from my point  
of view (actually more up-to-date than Fink, especially when there  
is a major system update).


Michael creates the fink info files for the FPC distribution via  
fink. If you don't use fink, it won't affect you.




So no problem at all :)
It seems I did not understand it was a Fink only package. Sorry for  
the disagreement




--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Re: FPC 2.2.1 on Mac OS X

2008-06-05 Thread Damien Gerard


Le Jun 5, 2008 à 3:32 PM, Vincent Snijders a écrit :


Felipe Monteiro de Carvalho schreef:

On Thu, Jun 5, 2008 at 3:11 AM, Karl-Michael Schindler
[EMAIL PROTECTED] wrote:

How do you use fink for your work with freepascal and lazarus?
I think that the question is that using fink shouldn't be necessary  
to

install the Carbon based Lazarus. It could be deployed like any other
native application, in a .dmg disk image with a .app application
bundle, which can be moved to /Applications
Most people would like to avoid fink if possible, but maybe you  
have a

compeling reason to use it instead of the standard install method for
native applications


Fink could be useful for the compiler. The compiler is not installed  
under /Applications.




Snapshots don't use Fink as far I know and it works well on my laptop.
That's why I was talking about an installer, mostly to install FPC.  
But I think it could be install in the same directory of Lazarus like  
it is done under Windows.


By the way, I don't know if it is a good idea, but the install dir may  
be /Developper/Applications/Lazarus instead of /Applications, like  
XCode and others dev tools.



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Re: FPC 2.2.1 on Mac OS X

2008-06-04 Thread Damien Gerard


Le Jun 4, 2008 à 8:51 AM, Karl-Michael Schindler a écrit :


Hi

I only noticed now the discussion on the mailing list about fpc  
2.2.1 and lazarus on Mac OS X. As the maintainer of the .info files  
of fpc and lazarus I should probably lay out my ideas about the  
future.


The next step is fpc 2.2.2. It should resolve some of the issues in  
a clean way and enable to remove some workarounds as well as serve  
as a solid base for a lazarus installation.


When this is settled, I will extend lazarus in the following way:

1) create so-called splitoffs, so there will be separate packages  
for lazarus-gtk1, lazarus-aqua and when ready lazarus-gtk2.
Then the user can simply choose the best interface for his  
situation. This can be done, whatever the default setting of  
LCLPLATFORM will be.


2) create double clickable Lazarus applications with links in / 
Applications/Fink.




Please not Fink. Put only Lazarus.app as it already exists (Carbon  
widgetset) into /Applications/ (through an installer since it installs  
FPC too).


A remaining question is about the code base I will use for lazarus.  
The best solution would clearly be that lazarus 0.9.26 comes out  
shortly before i am ready and so I could base in on that. If not, I  
would submit versions based on plain 0.9.24 as a first step.  
Depending on the conditions then, one could consider an intermediate  
0.9.25 version.


What is the status of the aqua version? Is 0.9.24 good enough at  
least as a start until 0.9.26 is ready or is it absolutely necessary  
to include the fixes since 0.9.24?


Best wishes - Michael.




--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Hash table with different kind of key

2008-06-02 Thread Damien Gerard


Le Jun 2, 2008 à 11:48 AM, Damien Gerard a écrit :



Le Jun 2, 2008 à 11:29 AM, Florian Klaempfl a écrit :


Damien Gerard schrieb:

Hi !
Is there somewhere hash tables with different kind of keys and if  
possible different kind of values ?

Like in C++ actually with a std::map.
May be it would be possible with fpc 2.2.2 and generics ?


fgl.TFPGMap


My hero ! Thanks :)




However it seems I have to wait for FPC 2.2


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


[fpc-pascal] Hash table with different kind of key

2008-06-02 Thread Damien Gerard


Hi !

Is there somewhere hash tables with different kind of keys and if  
possible different kind of values ?

Like in C++ actually with a std::map.

May be it would be possible with fpc 2.2.2 and generics ?



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Hash table with different kind of key

2008-06-02 Thread Damien Gerard


Le Jun 2, 2008 à 11:29 AM, Florian Klaempfl a écrit :


Damien Gerard schrieb:

Hi !
Is there somewhere hash tables with different kind of keys and if  
possible different kind of values ?

Like in C++ actually with a std::map.
May be it would be possible with fpc 2.2.2 and generics ?


fgl.TFPGMap


My hero ! Thanks :)


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] FPC scripting suport

2008-05-28 Thread Damien Gerard


Le May 28, 2008 à 12:00 PM, MihaiR a écrit :


Hello all,

Is there any component for FPS/Lazarus I can succesfully
use for scripting?


LUA is very powerfull.
I used it in my app for months and it works very well.



I'd like to build an application that
can be enhanced by some simple functions stored into an
external script file so that functions can be edited. There
are simple functions with few parameters and which return
the result to the main application.
It is something like VAT calculation: main (compiled
application send price to the script function and script
function returns the VAT value). Of course this is a
simplified example, on my situation there are many
functions and I want one function to have configurable
formula content.

Thank you very much.
Best regards,
Mihai



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] FPC scripting suport

2008-05-28 Thread Damien Gerard


Le May 28, 2008 à 12:30 PM, Henry Vermaak a écrit :


2008/5/28 Damien Gerard [EMAIL PROTECTED]:


Le May 28, 2008 à 12:08 PM, Michael Van Canneyt a écrit :



Remobjects PascalScript works with FPC.
(it used to be innerfuse pascal)



Just for my information does it work under Linux *and* OS X ?



i386 linux and win32.  powerpc-darwin also works.



Is i386-darwin planned ?


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] FPC scripting suport

2008-05-28 Thread Damien Gerard


Le May 28, 2008 à 12:08 PM, Michael Van Canneyt a écrit :




On Wed, 28 May 2008, MihaiR wrote:


Hello all,

Is there any component for FPS/Lazarus I can succesfully
use for scripting? I'd like to build an application that
can be enhanced by some simple functions stored into an
external script file so that functions can be edited. There
are simple functions with few parameters and which return
the result to the main application.
It is something like VAT calculation: main (compiled
application send price to the script function and script
function returns the VAT value). Of course this is a
simplified example, on my situation there are many
functions and I want one function to have configurable
formula content.


Remobjects PascalScript works with FPC.
(it used to be innerfuse pascal)



Just for my information does it work under Linux *and* OS X ?



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] FPC 2.2.0 / SegF in threads

2008-05-16 Thread Damien Gerard


Le May 15, 2008 à 11:55 PM, mm a écrit :


Damien Gerard a écrit :

Le May 15, 2008 à 8:46 PM, Luca Olivetti a écrit :
I don't know about gdb, but I know that you have to be extremely  
careful
with exceptions in a thread, since any uncaught exception will  
silently

terminate it.


It is actually the point of my problem.
Is there any way to avoid this behavior ? Because without GDB you  
are not aware that a thread has just exited.


Your program has to catch all the exceptions. I wrote a small demo for
NX (see on my web site) that is called nx_demo_thread. It is very
simplistic regarding thread management but it could help you to see
how this program catches the exceptions.



Oki I see you use a double try statement in the execute method.



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] FPC 2.2.0 / SegF in threads

2008-05-15 Thread Damien Gerard


Le May 15, 2008 à 8:46 PM, Luca Olivetti a écrit :


El Thu, 15 May 2008 10:45:43 +0200
Damien Gerard [EMAIL PROTECTED] escribió:



I have a program in lazarus with a thread .
When there is a SegF in this thread it exits without notifying GDB.
So the error is silent even with GDB (Windows/Linux/OSX)
I have to wrap it like this :

try
  ..
except
  RaiseGDBException(...)
end;

May I miss something like an option to enable, since the error is
caught by the try..except statement ?


I don't know about gdb, but I know that you have to be extremely  
careful
with exceptions in a thread, since any uncaught exception will  
silently

terminate it.



It is actually the point of my problem.
Is there any way to avoid this behavior ? Because without GDB you are  
not aware that a thread has just exited.





--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


[fpc-pascal] Pointer address into string

2008-05-05 Thread Damien Gerard


Hi !

I would like to display in a lazarus application the address of a  
pointer.

For this, I use :

var s: string;
   p:pointer;
[...]
s := IntToStr(PtrInt(p))


However, I've got a warning (hint) from the compiler :
Conversion between ordinals and pointers is not portable

What is the way to do this ?


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Pointer address into string

2008-05-05 Thread Damien Gerard


Le May 5, 2008 à 5:10 PM, ik a écrit :


Look at the Format function, you can tell it to display the address of
a pointer in a string.




Thanks !


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] pascal on macbook

2008-04-26 Thread Damien Gerard


Le Apr 25, 2008 à 4:10 PM, George R Smith a écrit :


Felipe,

Thank you for your reply.

Do you have a Intel or PowerPC machine? And what kind of software  
do you

wish to develop?


I have not purchased the machine yet, looking at the MacBook with 4  
meg of
memory. I do not want to buy a laptop that runs Microsoft, trying to  
get

away from them.

I am a developer and have two Solaris boxes and two windows boxes,  
this
machine is just for my own enjoyment. I would like to program  
personal

stuff while watching TV.

Just want to make sure I can use Java or Pascal (prefer Pascal)  
before I

spend the 2,000 plus dollars.


For java, this should be familiar to you :
http://developer.apple.com/java/

For Pascal, it seems that the terminal is already a closed friend and  
fpc works very well under Darwin.

Vim/Emacs are enough to make programs using fpc.
If you need an IDE, Lazarus (with the Carbon Interface) for OS X  
becomes to be good for working with it (and native Cocoa bindings are  
on the way)
Moreover, with a MacBook, you can use VMWare for emulating a Linux,  
SunOS (x86) or even Windows.


It is a delight for Cross-platform programs.





Thanks again and anything else you wish to add I do appreciate it.

George


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




--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Looking for a Firebird book?

2008-04-09 Thread Damien Gerard


Le Apr 9, 2008 à 9:02 AM, Graeme Geldenhuys a écrit :

Hi,

Anybody know of a Firebird book I can purchase? Language needs to be  
in English.


I'm looking for something that covers the SQL syntax, DB tuning and
importantly, security.

The latter is one major issue I have with Firebird. It's security
model is very different to MS SQL Server, and I'm struggling to find
information on how I should implement my applications with Firebird
security.



Does their documentation not suitable to you ?

From MSSQL To Firefird
http://www.firebirdsql.org/manual/migration-mssql.html
Books
http://www.ibphoenix.com/main.nfs?a=ibphoenixpage=ibp_publications


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


[fpc-pascal] Generics

2008-03-31 Thread Damien Gerard


I would like to make a generic class, like this :

{$mode objfpc}

generic TMCollection_T = class(TObject)
private
FDefaultItem: _T;  // line 35
public
constructor Create;
destructor Destroy;override;
[...]
end;


But I have got the following :
commons.pas(35,21) Error: Identifier not found _T
commons.pas(35,21) Error: Error in type definition
commons.pas(39,34) Error: Identifier not found _T
commons.pas(44,84) Error: Identifier not found _T

According to the documentation, I should use `var private`, but I have  
got :


Compiling ./commons.pas
commons.pas(33,3) Error: VAR and TYPE are allowed only in generics
commons.pas(35,21) Error: Identifier not found _T

Could someone tell me where I am wrong ?
Thanks !



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Generics

2008-03-31 Thread Damien Gerard


Le Mar 31, 2008 à 3:20 PM, ik a écrit :

After you define the generic you must first create a type for it:

type
TMyMcollection = specialize TMCollectionString;



Sorry but it did not change anything.
Additionally, I would prefer to define the specialization in another  
unit.



And use the TMyMcollection.
It seems like hard work, but it is much better then the way it look on
a bad C++ and Java code :)



:)



Ido

On Mon, Mar 31, 2008 at 4:00 PM, Damien Gerard  
[EMAIL PROTECTED] wrote:


I would like to make a generic class, like this :

{$mode objfpc}

generic TMCollection_T = class(TObject)
private
FDefaultItem: _T;  // line 35
public
constructor Create;
destructor Destroy;override;
[...]
end;


But I have got the following :
commons.pas(35,21) Error: Identifier not found _T
commons.pas(35,21) Error: Error in type definition
commons.pas(39,34) Error: Identifier not found _T
commons.pas(44,84) Error: Identifier not found _T

According to the documentation, I should use `var private`, but I  
have

got :

Compiling ./commons.pas
commons.pas(33,3) Error: VAR and TYPE are allowed only in generics
commons.pas(35,21) Error: Identifier not found _T

Could someone tell me where I am wrong ?
Thanks !



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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





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




--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Generics

2008-03-31 Thread Damien Gerard


Le Mar 31, 2008 à 3:00 PM, Damien Gerard a écrit :


I would like to make a generic class, like this :

{$mode objfpc}

generic TMCollection_T = class(TObject)
private
   FDefaultItem: _T;  // line 35
public
   constructor Create;
   destructor Destroy;override;
   [...]
end;


But I have got the following :
commons.pas(35,21) Error: Identifier not found _T
commons.pas(35,21) Error: Error in type definition
commons.pas(39,34) Error: Identifier not found _T
commons.pas(44,84) Error: Identifier not found _T

According to the documentation, I should use `var private`, but I  
have got :


Compiling ./commons.pas
commons.pas(33,3) Error: VAR and TYPE are allowed only in generics
commons.pas(35,21) Error: Identifier not found _T

Could someone tell me where I am wrong ?
Thanks !





I forgot : fpc 2.2.0 and fpc 2.2.1. May be I should upgrade to 2.3.x ?


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Generics

2008-03-31 Thread Damien Gerard


Le Mar 31, 2008 à 3:59 PM, ik a écrit :

Can you create a small proof of concept, and attach it here ?



Here you are.
The unit is in development so it may remain some errors (I would like  
to convert another units with the use of generics).


BTW, is there a way to specifiy the template parameter must be a  
descendant of another class ?



Ido

On Mon, Mar 31, 2008 at 4:27 PM, Damien Gerard  
[EMAIL PROTECTED] wrote:


Le Mar 31, 2008 à 3:00 PM, Damien Gerard a écrit :



I would like to make a generic class, like this :

{$mode objfpc}

generic TMCollection_T = class(TObject)
private
  FDefaultItem: _T;  // line 35
public
  constructor Create;
  destructor Destroy;override;
  [...]
end;


But I have got the following :
commons.pas(35,21) Error: Identifier not found _T
commons.pas(35,21) Error: Error in type definition
commons.pas(39,34) Error: Identifier not found _T
commons.pas(44,84) Error: Identifier not found _T

According to the documentation, I should use `var private`, but I
have got :

Compiling ./commons.pas
commons.pas(33,3) Error: VAR and TYPE are allowed only in generics
commons.pas(35,21) Error: Identifier not found _T

Could someone tell me where I am wrong ?
Thanks !





I forgot : fpc 2.2.0 and fpc 2.2.1. May be I should upgrade to  
2.3.x ?






foo.pas
Description: Binary data





--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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

Re: [fpc-pascal] Generics

2008-03-31 Thread Damien Gerard


Le Mar 31, 2008 à 6:03 PM, Peter Vreman a écrit :

I would like to make a generic class, like this :

{$mode objfpc}

generic TMCollection_T = class(TObject)
private
 FDefaultItem: _T;  // line 35
public
 constructor Create;
 destructor Destroy;override;
 [...]
end;


But I have got the following :
commons.pas(35,21) Error: Identifier not found _T
commons.pas(35,21) Error: Error in type definition
commons.pas(39,34) Error: Identifier not found _T
commons.pas(44,84) Error: Identifier not found _T

According to the documentation, I should use `var private`, but I
have got :

Compiling ./commons.pas
commons.pas(33,3) Error: VAR and TYPE are allowed only in generics
commons.pas(35,21) Error: Identifier not found _T

Could someone tell me where I am wrong ?


The forward declaration of TMCollection makes it a normal class and  
not a generic class.




Oki I understand.
I tried to use an Interface but I had a nice Segementation fault :)

Should I report it as a bug in the mantis ?



foo.pas
Description: Binary data



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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

Re: [fpc-pascal] Generics

2008-03-31 Thread Damien Gerard


Oki I understand.
I tried to use an Interface but I had a nice Segementation fault :)

Should I report it as a bug in the mantis ?

foo.pas



Actually there is the same error with an intermediate class :(


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Generics

2008-03-31 Thread Damien Gerard


Le Mar 31, 2008 à 6:36 PM, Micha Nelissen a écrit :

Damien Gerard wrote:

I tried to use an Interface but I had a nice Segementation fault :)

Should I report it as a bug in the mantis ?

foo.pas


Actually there is the same error with an intermediate class :(


Segmentation faults in the compiler itself can/should always be
reported. Thanks.




Reported as Issue #11075.


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Generics

2008-03-31 Thread Damien Gerard


Le Mar 31, 2008 à 10:06 PM, Damien Gerard a écrit :


Le Mar 31, 2008 à 6:36 PM, Micha Nelissen a écrit :

Damien Gerard wrote:

I tried to use an Interface but I had a nice Segementation fault :)

Should I report it as a bug in the mantis ?

foo.pas


Actually there is the same error with an intermediate class :(


Segmentation faults in the compiler itself can/should always be
reported. Thanks.




Reported as Issue #11075.



It was actually an already known bug :)



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] connection problem

2008-03-27 Thread Damien Gerard


Le Mar 27, 2008 à 2:30 PM, [EMAIL PROTECTED] a écrit :
I am experiencing similar problems with the www.freepascal.org front  
page and svn checkout update - both just hang. It is ISP specific -  
my normal ones work fine, but I am staying away from home this week  
and my host's ISP won't connect.

Colin

Hi, I'm experiencing connection problems to bugs.freepascal.org and
svn.freepascal.org.

[EMAIL PROTECTED]:~/temp svn co
http://svn.freepascal.org/FPC/svn/lazarus/trunk l
svn: requerimiento PROPFIND falló en '/FPC/svn/lazarus/trunk'
svn: PROPFIND de '/FPC/svn/lazarus/trunk': 405 Method Not Allowed
(http://svn.freepascal.org)



It looks like you're going through a transparent proxy blocking WebDAV  
http requests (like PROPFIND)



[EMAIL PROTECTED]:~ ping bugs.freepascal.org
PING bugs.freepascal.org (x.x.x.x) 56(84) bytes of data.
64 bytes from cust198-202.dsl.versadsl.be (x.x.x.x): icmp_seq=1
ttl=40 time=358 ms
64 bytes from cust198-202.dsl.versadsl.be (x.x.x.x): icmp_seq=2
ttl=40 time=386 ms
64 bytes from cust198-202.dsl.versadsl.be (x.x.x.x): icmp_seq=3
ttl=40 time=539 ms

I tried at least since monday. Given absent of reports, and the bug
tracker notices in mail and CIA at IRC I suppose it's working, any
idea?

Jesus Reyes A.






--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


[fpc-pascal] Functions with out parameters

2008-03-10 Thread Damien Gerard


I have the following function :

procedure Foo(const AText: UTF8String; out AValue: UTF8String);
begin
  ShowMessage(AText); //
  AValue := 'A custom value';
end;

procedure AnotherMethod;
var s: UTF8String;
begin
  s := 'Some text';
  Foo(s, s);
  // Do something with `s`
end;


If you have this, the showmessage display an empty string and  
sometimes the app crashes. I had a doubt so I tried this :


procedure AnotherMethod;
var s, t: UTF8String;
begin
  s := 'Some text';
  t := s;
  Foo(t, s);
  // Do something with `s`
end;

And it works well the app never crash and all my variables are  
correct. So I guess the two parameters share the same pointer. It  
seems logic to me in this case.


However, is there a way the compiler produces an error in this case ?  
I suppose there is a similar case with the 'var' keyword.



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Empty string

2008-03-07 Thread Damien Gerard


Le Mar 3, 2008 à 5:22 PM, ik a écrit :


Doesn't FillChar/Word/Byte works for you ?



I don't think any of them made my purpose.


Ido

On Mon, Mar 3, 2008 at 6:16 PM, Damien Gerard [EMAIL PROTECTED]  
wrote:


In any programs, a lot of tests on empty strings are made.
The following made the work :
if Length(s)  0 then ...
or
if s  '' then ...

In a lot of cases, the real length is no needed, just to know if the
string is empty or not.
I am mainly using UTF8String so strings with leading zero.
Just with the first char we can know if the string is empty or not.

Is there a function of this kind that I don't know already exist ?
Would it be possible to implement such a function (may be a stupid
idea for an unknown reason) ?
Can this function be directly done in FPC ?

Regards.


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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





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




--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Empty string

2008-03-07 Thread Damien Gerard


Le Mar 7, 2008 à 2:54 PM, Jonas Maebe a écrit :



On 03 Mar 2008, at 17:16, Damien Gerard wrote:


In any programs, a lot of tests on empty strings are made.
The following made the work :
if Length(s)  0 then ...
or
if s  '' then ...

In a lot of cases, the real length is no needed, just to know if  
the string is empty or not.


That is what if s  '' then checks for. This is already generated  
as optimally as possible.



In a previous thread, I have ask the difference between (Length(s) =  
0) and (s = '')


Copy paste a answer :



if s = '' then ...
of this one
if Length(s)  0 then ...


Both generate the same code.



Consequently, it can not be the same code. Otherwise I understood  
nothing :)




--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Empty string

2008-03-07 Thread Damien Gerard


Le Mar 7, 2008 à 3:35 PM, John Coppens a écrit :


On Fri, 7 Mar 2008 15:09:36 +0100
Damien Gerard [EMAIL PROTECTED] wrote:


Consequently, it can not be the same code. Otherwise I understood
nothing :)


'' is an empty string, _and_ its length is zero (of course). So the
compiler is so intelligent as to replace  length(s) = 0, or s = ''
by the same code.

Normally s = '' would be a very slow way to check for an empty  
string, so

the compiler optimizes this automatically.




Thanks !

Sorry for my question not so clear :)


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] Empty string

2008-03-06 Thread Damien Gerard


Le Mar 6, 2008 à 5:26 PM, Lucas Vasconcelos a écrit :


You can try access a UTF8String lika a array.

So, you can replace your test by

if mystringvar[0]  '' then ...




I thought string should be accessed from 1 not 0 for compatibility.
And it is what I am doing.

for i := 1 to length(s) do ...

so I am not sure that using s[0] is safe

--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


Re: [fpc-pascal] AnsiDequotedStr not return empty for

2008-03-04 Thread Damien Gerard


Le Mar 2, 2008 à 6:11 PM, zaher dirkey a écrit :


Who is need to return the same source if it empty quoted string?
That force me to implement a new function to use it.



I think the real problem is the Delphi Compatiblity.
If the function works the same in Delphi, it must be kept like this.
But a new function (with a different name) may be created with a more  
intuitive behavior.


On Sun, Mar 2, 2008 at 2:17 PM, Micha Nelissen  
[EMAIL PROTECTED] wrote:

Peter Vreman wrote:
 In case always check Delphi documentation to see wether the  
behaviour

 you see is intentional.

 In case of  it is also ambigious what you want. Because  in the
 middle of the string is translated to a single . So you might also
 expect that it returns a single  instead of an empty string.

Wouldn't it be reasonable to expect the rules are similar to Pascal
itself, with  being a single quote, and '' an empty string ?

Micha



--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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

[fpc-pascal] Empty string

2008-03-03 Thread Damien Gerard


In any programs, a lot of tests on empty strings are made.
The following made the work :
if Length(s)  0 then ...
or
if s  '' then ...

In a lot of cases, the real length is no needed, just to know if the  
string is empty or not.

I am mainly using UTF8String so strings with leading zero.
Just with the first char we can know if the string is empty or not.

Is there a function of this kind that I don't know already exist ?
Would it be possible to implement such a function (may be a stupid  
idea for an unknown reason) ?

Can this function be directly done in FPC ?

Regards.


--
Damien Gerard
[EMAIL PROTECTED]

Intelligence is 10 million rules.
   -- Douglas Lenat





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


[fpc-pascal] Vim FileType for pascal files

2008-02-24 Thread Damien Gerard


hi !

I use includes files and a vim editor. Obviously  .inc are not  
recognized as pascal files.

I tried the following :
// vim:ts=4:filetype=pascal

but it does not work.

Any ideas ?


--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Vim FileType for pascal files

2008-02-24 Thread Damien Gerard


Le Feb 24, 2008 à 9:59 PM, Lucas Vasconcelos a écrit :


hi,

try

// vim: set ts=4 filetype=pascal :

;~]



It does not work either :(

On Sun, Feb 24, 2008 at 9:29 AM, Damien Gerard  
[EMAIL PROTECTED] wrote:


hi !

I use includes files and a vim editor. Obviously  .inc are not
recognized as pascal files.
I tried the following :
// vim:ts=4:filetype=pascal




--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] XML Programming..

2008-02-13 Thread Damien Gerard


Le Feb 13, 2008 à 2:06 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] 
 a écrit :


Actually I want to change data beetwen application from .Net with my  
app in
FPC using web interface (webservices ?). Is there are an examples  
about that

?



May be take a look at this :
http://wiki.freepascal.org/Web_Service_Toolkit



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Semaphore

2008-02-12 Thread Damien Gerard


Le Feb 12, 2008 à 12:36 PM, Graeme Geldenhuys a écrit :


On 11/02/2008, Damien Gerard [EMAIL PROTECTED] wrote:

My program must work under OSX/Nux and Windows.
I may have missed something but I can not find something suitable for
me.
Under Windows OpenSemaphore, under unixes CurrentTM.Semaphore*...

Is there any TSemaphore class of equivalent ? Or may be an example  
how

to use Semaphores ? :)


I've wondered the same thing In the end I had to write code like
the following:
Not idea, but it works. We needed to support Linux and Windows only.


procedure TtiPool.CreatePoolSemaphore;
begin
 {$IFDEF MSWINDOWS}
 if FSemaphore  0 then
   CloseHandle(FSemaphore);
 FSemaphore := CreateSemaphore(nil, FMaxPoolSize, FMaxPoolSize, nil);
 {$ENDIF MSWINDOWS}
 {$IFDEF LINUX}
 sem_destroy(FSemaphore);
 if sem_init(FSemaphore, 0, FMaxPoolSize)  0 then
   raise Exception.Create('Failed to create the semaphore');
 {$ENDIF LINUX}
end;



Thanks !

I think I can safely change LINUX by UNIX and it should work on OS X  
too.

I will made a TSemaphore :)




Regards,
 - Graeme -


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




--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Semaphore

2008-02-12 Thread Damien Gerard


Le Feb 12, 2008 à 12:36 PM, Graeme Geldenhuys a écrit :


On 11/02/2008, Damien Gerard [EMAIL PROTECTED] wrote:

My program must work under OSX/Nux and Windows.
I may have missed something but I can not find something suitable for
me.
Under Windows OpenSemaphore, under unixes CurrentTM.Semaphore*...

Is there any TSemaphore class of equivalent ? Or may be an example  
how

to use Semaphores ? :)


I've wondered the same thing In the end I had to write code like
the following:
Not idea, but it works. We needed to support Linux and Windows only.


procedure TtiPool.CreatePoolSemaphore;
begin
 {$IFDEF MSWINDOWS}
 if FSemaphore  0 then
   CloseHandle(FSemaphore);
 FSemaphore := CreateSemaphore(nil, FMaxPoolSize, FMaxPoolSize, nil);
 {$ENDIF MSWINDOWS}
 {$IFDEF LINUX}
 sem_destroy(FSemaphore);
 if sem_init(FSemaphore, 0, FMaxPoolSize)  0 then
   raise Exception.Create('Failed to create the semaphore');
 {$ENDIF LINUX}
end;




I realize you have already made a TSemaphore like. May be I can  
directly use it for my purposes ?



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Semaphore

2008-02-12 Thread Damien Gerard


Le Feb 12, 2008 à 2:41 PM, Jonas Maebe a écrit :



On 11 Feb 2008, at 10:45, Damien Gerard wrote:

I think it has been discussed before but I would like to use  
Semaphores, to allow multiple reads but 1 write at once (which is  
in fact commons operations in a multi-thread program).


My program must work under OSX/Nux and Windows.
I may have missed something but I can not find something suitable  
for me.

Under Windows OpenSemaphore, under unixes CurrentTM.Semaphore*...


CurrentTM.Semaphore* should also work under Windows (if it doesn't,  
please file a bug report). And the way to use those is by calling


{$ifdef unix}
uses
 cthreads;
{$endif}
var
 p: pointer;
begin
 p:=currenttm.SemaphoreInit;
 currenttm.semaphorepost(p);
 currenttm.semaphorewait(p);
 currenttm.semaphoredestroy(p);
end.




I though that too but currenttm can not be found under Windows. What  
is the good unit for it ?


--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


[fpc-pascal] Semaphore

2008-02-11 Thread Damien Gerard


Hi !
I think it has been discussed before but I would like to use  
Semaphores, to allow multiple reads but 1 write at once (which is in  
fact commons operations in a multi-thread program).


My program must work under OSX/Nux and Windows.
I may have missed something but I can not find something suitable for  
me.

Under Windows OpenSemaphore, under unixes CurrentTM.Semaphore*...

Is there any TSemaphore class of equivalent ? Or may be an example how  
to use Semaphores ? :)




--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


[fpc-pascal] Internal Error 200212277

2008-01-23 Thread Damien Gerard


I often got the error from FPC Internal Error 200212277 when I build  
my applications using Lazarus, whatever the version of fpc (=2.2  
others I don't know)
It happens only when I choose build and not Build all, so when my  
apps are not entirely rebuild.


What is it exactly ?
Have I something to do from my side ?


--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Heterogenous list of objects

2008-01-22 Thread Damien Gerard


On Jan 22, 2008, at 11:22 AM, [EMAIL PROTECTED] wrote:


Hi,

I'd like to manage a list of heterogenous objects. For instance, I  
have a list of objects to buy in store: cheeses (of class TCheese),  
soaps (of class TSoap), flowers (of class TFlower), etc...


I thought to gather pointers to different objects of these classes  
in a TList. But, when it comes to manipulate or destroy these items,  
I am in trouble: I have lost the information about the precise type  
of the object the pointer points to.


Does somebody have an idea?



Like this :
(I can make a complete example if needed)


type
  TNodeAbstract = class
 procedure print;virtual;abstract;
  end;

  TNodeFoo = class(TNodeAbstract)
 procedure print;override;
 procedure SpecificMethodeForFoo;
  end;


...

var objs: TObjectList;
objs := TObjectList.Create(True);
objs.Add(TNodeFoo.Create);

...


var o : TNodeAbstract;
for i := 0 to objs.Count - 1 do begin
   o := TNodeAbstract(Objs[i]);
   if (o is TNodeFoo) then
  (o as TNodeFoo).SpecificMethodeForFoo;
   o.Print;
end;




Thanks in advance,
Gilles Marcou


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




--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


[fpc-pascal] property or public

2008-01-21 Thread Damien Gerard


I have (it would seem) a stupid question :)
We have TStringList vars. User can do what he want with it.
Which one is the stupid or the better way to do it ?


TMyClass = class(TObject)
public
   snip
   List1: TStringList;
   List2: TStringList;
end;


or


TMyClass = class
private
   FList1: TStringList;
   FList2: TStringList;

public
   property List1: TStringList read FList1;
   property List2: TStringList read FList2;
end;

--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] property or public

2008-01-21 Thread Damien Gerard


On Jan 21, 2008, at 2:52 PM, Joao Morais wrote:


Damien Gerard wrote:

I have (it would seem) a stupid question :)
We have TStringList vars. User can do what he want with it.
Which one is the stupid or the better way to do it ?
TMyClass = class(TObject)
public
  snip
  List1: TStringList;
  List2: TStringList;
end;
or
TMyClass = class
private
  FList1: TStringList;
  FList2: TStringList;
public
  property List1: TStringList read FList1;
  property List2: TStringList read FList2;
end;


The later, *much* better. You should never use class members outside  
the private area.




Thanks ! What is the reason ? I am happy I was right but I need some  
reason :)




--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] property or public

2008-01-21 Thread Damien Gerard


On Jan 21, 2008, at 4:47 PM, Joao Morais wrote:


Matt Emson wrote:

Joao Morais wrote:

Damien Gerard wrote:


On Jan 21, 2008, at 2:52 PM, Joao Morais wrote:


Damien Gerard wrote:

I have (it would seem) a stupid question :)
We have TStringList vars. User can do what he want with it.
Which one is the stupid or the better way to do it ?
TMyClass = class(TObject)
public
 snip
 List1: TStringList;
 List2: TStringList;
end;
or
TMyClass = class
private
 FList1: TStringList;
 FList2: TStringList;
public
 property List1: TStringList read FList1;
 property List2: TStringList read FList2;
end;


The later, *much* better. You should never use class members  
outside the private area.


Thanks ! What is the reason ? I am happy I was right but I need  
some reason :)


Encapsulation, on behalf of the integrity of the instance.


Implementation detail is also a good example. Then:
TMyClass = class
private
FList1: array of string; //convoluted, but uses a different storage  
mechanism

FList2: array of string;
protected
function GetList1: TStringList; virtual;
function GetList1: TStringList; virtual;
public
property List1: TStringList read GetList1;
property List2: TStringList read GetList2;
end;
You can implement the storage for GetList1 and GetList 2 any way  
that you wish internally, but give a uniform external interface.


Exact, polymorphism is also a reason. You can have abstract methods  
and no class members if the design requires. The interface continues  
the same.


That is what I thought too. But I wanted external advice.
Thanks to all !



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


[fpc-pascal] FreePascal Coding style

2008-01-20 Thread Damien Gerard


Is there a standard Coding style for FreePascal (Pascal) available  
which programmers should use ?

It is for my boss :)


--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


[fpc-pascal] Read UTF8 Files

2008-01-19 Thread Damien Gerard

Hi !

I would like to read UTF8 files. There is TFileStream, and it seems to  
make the job. However, I need read _big_ files (with long string) so I  
would like to read block by block instead of a big string in memory  
with ReadAnsiString.



How should I do ?

Thanks !


--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] dot within unit file name

2008-01-18 Thread Damien Gerard


On Jan 18, 2008, at 12:16 PM, Bee wrote:


And yes, I'd like to have implemented that (child units) in FPC.


What is child unit?



http://www.adaic.com/docs/95style/html/sec_4/4-1-1.html



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] dot within unit file name

2008-01-18 Thread Damien Gerard


On Jan 18, 2008, at 11:16 AM, Bee wrote:


Hi all,

Why cant FPC use unit that has (some) dot(s) within the file name?  
Can FPC support it in the next release (2.2.2)?




I think the dot is used in the grammar.
for example :


unit foo;
interface
procedure Print;
implementation
[...]
end.


You want to be able to call foo.Print;  and you can not make the  
difference between a dot for the filename and a dot as a separator.



Sometimes I need to have some units for example: unit1.ori.pas and  
unit1.modif.pas, which I need to switch to one of them but never use  
them both.


TIA.




--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Problem using fpc

2008-01-14 Thread Damien Gerard


On Jan 14, 2008, at 7:13 AM, Plato wrote:



Compiling using the IDE+fpc 2.2.0 works correctly on my  
laptop(celeron cpu),
yet on my new desktop(Intel 2140 Dual Core + one SATA disk and 2 IDE  
disks)
I consistently get the following result if compiling a program(or  
unit)

eg for a file '.pas' I get:
Error:Can't create object file x.o
Error:Can't create object x.o
Both systems run under XP Home+SP2. Presumably a configuration  
problem? Any

suggestions(polite) please.


May be some Permissions issues ?



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


[fpc-pascal] Classes with abstract methods

2008-01-14 Thread Damien Gerard


With fpc you can get myfile.pas(77,47) Warning: Constructing a class  
 with abstract methods
I just would like to know why it is allowed to build classes with  
abstract methods. AFIK it is different from other compilers and it is  
a bit strange for me.



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Classes with abstract methods

2008-01-14 Thread Damien Gerard


On Jan 14, 2008, at 10:27 AM, Michael Van Canneyt wrote:




On Mon, 14 Jan 2008, Damien Gerard wrote:



With fpc you can get myfile.pas(77,47) Warning: Constructing a  
class 

with abstract methods
I just would like to know why it is allowed to build classes with  
abstract
methods. AFIK it is different from other compilers and it is a bit  
strange for

me.


Delphi gives exactly the same warning.


I don't remember that.

It is allowed to create such instances: as long as you don't call  
any of the

abstract methods, there will be no problem.



Is there a way to abort the compilation in this cases instead of a  
warning ?



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Classes with abstract methods

2008-01-14 Thread Damien Gerard


On Jan 14, 2008, at 11:00 AM, Graeme Geldenhuys wrote:


On 14/01/2008, Michael Van Canneyt [EMAIL PROTECTED] wrote:


Is there a way to abort the compilation in this cases instead of a  
warning ?


Currently not.


If you want to be that strict, then use Interfaces instead of  
Abstract classes.



Indeed I should do this. Thanks



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Classes with abstract methods

2008-01-14 Thread Damien Gerard


On Jan 14, 2008, at 10:53 AM, Michael Van Canneyt wrote:




On Mon, 14 Jan 2008, Damien Gerard wrote:



On Jan 14, 2008, at 10:27 AM, Michael Van Canneyt wrote:




On Mon, 14 Jan 2008, Damien Gerard wrote:



With fpc you can get myfile.pas(77,47) Warning: Constructing a  
class


with abstract methods
I just would like to know why it is allowed to build classes with  
abstract
methods. AFIK it is different from other compilers and it is a  
bit strange

for
me.


Delphi gives exactly the same warning.


I don't remember that.


D:\Tempdcc32 unit1
Borland Delphi Version 15.0
Copyright (c) 1983,2002 Borland Software Corporation
Unit1.pas(32) Warning: Constructing instance of 'TStrings'  
containing abstract method 'TStrings.Clear'
Unit1.pas(32) Warning: Constructing instance of 'TStrings'  
containing abstract method 'TStrings.Delete'
Unit1.pas(32) Warning: Constructing instance of 'TStrings'  
containing abstract method 'TStrings.Insert'

Unit1.pas(32) Hint: Value assigned to 'T' never used
Unit1.pas(36)
37 lines, 0.11 seconds, 475 bytes code, 8 bytes data.



Yes I trust you don't wory, just my mind is playing with me :)



It is allowed to create such instances: as long as you don't call  
any of the

abstract methods, there will be no problem.



Is there a way to abort the compilation in this cases instead of a  
warning ?


Currently not.


Thanks



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


[fpc-pascal] TStringList

2008-01-14 Thread Damien Gerard


I often use TObjectLis, which is able to destroy by itself objects in  
its list.
However, is it the same with a TStringList when an object is added  
with AddObject ?


I mean when the method .Clear or Delete are called, is my associated  
object is destroyed in the same time ?
I suppose there is not the case due to there is not the property  
OwnObject as in a TObjectList.



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Classes with abstract methods

2008-01-14 Thread Damien Gerard


On Jan 14, 2008, at 11:55 AM, Michael Van Canneyt wrote:




On Mon, 14 Jan 2008, Peter Vreman wrote:

It is allowed to create such instances: as long as you don't  
call any of the

abstract methods, there will be no problem.



Is there a way to abort the compilation in this cases instead of  
a warning ?


Currently not.


You can abort compilation in case of any warning with the -Sew  
option. The same goes for note or
hint with -Sen or -Seh, but those are only usefull for compiler  
tests.


The problem with this mechanism is that if you have another warning  
which occurs first,
that will stop your compilation, you'll never get to the abstract  
warning...



I agree.
May be a new option in a future release of fpc ? :)
It would be nice to have a switch to do it.



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Classes with abstract methods

2008-01-14 Thread Damien Gerard


On Jan 14, 2008, at 2:59 PM, Jonas Maebe wrote:



On 14 Jan 2008, at 14:43, Damien Gerard wrote:


On Jan 14, 2008, at 11:55 AM, Michael Van Canneyt wrote:

The problem with this mechanism is that if you have another  
warning which occurs first,
that will stop your compilation, you'll never get to the abstract  
warning...


I agree.
May be a new option in a future release of fpc ? :)
It would be nice to have a switch to do it.


There is already a feature request for the ability to turn off/on  
certain warnings in Mantis. Upgrading certain warnings (and hints/ 
notes) to errors is quite related. It should be quite doable for an  
outsider to implement this sort functionality, but until now no one  
has volunteered yet.



I see. I will see what I can do next month.


--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


[fpc-pascal] Extension .pp or .pas

2008-01-11 Thread Damien Gerard


I am starting a new project and I worry about filename conventions.
It is possible to use .pp or .pas for fpc source files.

Lazarus creates .pas files AFAIK. The project will be a console  
application.


Is there some existing conventions (from history or something else) or  
we totally don't care about ?



--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




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


Re: [fpc-pascal] Maybe a new fpc book :)

2008-01-05 Thread Damien Gerard


On Jan 5, 2008, at 11:11 AM, Florian Klaempfl wrote:


Marco Ciampa schrieb:

I work in a high school in Italy.
We are currently using fpc + gnuplot for math and phisics  
simulations.
In one lab we are currently starting to use Linux as the _sole_  
platform.


On Wed, Jan 02, 2008 at 12:35:57PM -0500, Anthony W. Henry wrote:
   1. What OS is most-used for Free Pascal? Windows?  
Linux?

80% windows and 20% Linux (this one growing)



Not OS X at all ? I am a bit surprised.


   2. What libraries do most people use for console  
(i.e.,

   terminal or text-mode) apps? I dislike ncurses; is
   there a better way?

console 
graph unit (BGI drivers under windows and Linux (X _not_ VGAlib) )


If one writes a book, _please_ use SDL for graphics and skip the  
legacy

graph unit :)


Agree :)


--
Damien Gerard
[EMAIL PROTECTED]

People who used magic without knowing what they were doing usually  
came to a sticky end. All over the entire room, sometimes.

-- (Terry Pratchett, Moving Pictures)



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


[fpc-pascal] Type declaration

2007-12-21 Thread Damien Gerard


Hi !

I would like to know if there are any differences between these two  
following declarations :


type
   TMyType = smallint;

And

type
  TMyType = type smallint;


--
Damien Gerard
[EMAIL PROTECTED]

People who used magic without knowing what they were doing usually  
came to a sticky end. All over the entire room, sometimes.

-- (Terry Pratchett, Moving Pictures)



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


[fpc-pascal] String comparison

2007-12-21 Thread Damien Gerard


Just another question :)
What is the most efficient way to check if a string is empty or not ?

if s = '' then ...
of this one
if Length(s)  0 then ...


--
Damien Gerard
[EMAIL PROTECTED]

People who used magic without knowing what they were doing usually  
came to a sticky end. All over the entire room, sometimes.

-- (Terry Pratchett, Moving Pictures)



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


Re: [fpc-pascal] String comparison

2007-12-21 Thread Damien Gerard


On Dec 21, 2007, at 2:47 PM, Daniël Mantione wrote:




Op Fri, 21 Dec 2007, schreef Damien Gerard:



Just another question :)
What is the most efficient way to check if a string is empty or not ?

if s = '' then ...
of this one
if Length(s)  0 then ...


Both generate the same code.


Thanks !

--
Damien Gerard
[EMAIL PROTECTED]

People who used magic without knowing what they were doing usually  
came to a sticky end. All over the entire room, sometimes.

-- (Terry Pratchett, Moving Pictures)



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


Re: [fpc-pascal] Type declaration

2007-12-21 Thread Damien Gerard


On Dec 21, 2007, at 3:53 PM, ik wrote:


Hi,

On Dec 21, 2007 3:23 PM, Damien Gerard [EMAIL PROTECTED] wrote:


Hi !

I would like to know if there are any differences between these two
following declarations :

type
   TMyType = smallint;


This is an alias to smallint, giving it a new way reference it.



And

type
  TMyType = type smallint;


This is a new type, that have the range of smallint, but they are not
the same. If you will place a TMyType variable inside a smallint
paremeter you might have an error or warning of type mismatch.



I like it :)
Thanks !



--
Damien Gerard
[EMAIL PROTECTED]

People who used magic without knowing what they were doing usually  
came to a sticky end. All over the entire room, sometimes.

-- (Terry Pratchett, Moving Pictures)



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


[fpc-pascal] Makefile with fpcmake

2007-12-21 Thread Damien Gerard


I am trying to use fpcmake to compile my fpc programs (console, i386/ 
OS X Leopard, fpc 2.2.0)

ut I've got the following :


Shani [milipili] ...ects/Sayuri/trunk/sayuri % fpcmake -Tall - 
vw 
15 
:50 #159

FPCMake Version 2.0.0 [2007/12/21]
Processing Makefile.fpc
 Targets: i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd  
i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd  
i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince  
i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k- 
amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux  
powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc- 
morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc- 
embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm- 
linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian  
powerpc64-linux powerpc64-embedded

 Globals:
FPCDIR = ../lib/fpc/2.2.0
PACKAGESDIR = $(FPCDIR)/packages $(FPCDIR)/packages/base $ 
(FPCDIR)/packages/extra $(FPCDIR)/packages

UNITSDIR = $(FPCDIR)/units/$(FULLTARGET)
BASEDIR = /Users/milipili/Projects/Sayuri/trunk/sayuri
 Required packages for linux-i386: rtl
 Package rtl: Looking for Makefile.fpc: ../lib/fpc/2.2.0/rtl/ 
Makefile.fpc ../lib/fpc/2.2.0/packages/rtl/Makefile.fpc ../lib/fpc/ 
2.2.0/packages/base/rtl/Makefile.fpc ../lib/fpc/2.2.0/packages/extra/ 
rtl/Makefile.fpc ../lib/fpc/2.2.0/packages/rtl/Makefile.fpc 
 Package rtl: Looking for Package.fpc: ../lib/fpc/2.2.0/rtl/ 
Package.fpc ../lib/fpc/2.2.0/units/i386-linux/rtl/Package.fpc 

Error: Target linux, package rtl not found


I use dmg packages from the lazarus mirrors, so I have two separated  
packages (binaries and sources).
I copied the source files (rtl,packages) into the /usr/local/lib/fpc/ 
2.2.0/ without any results.



Where I am wrong ?



PS: My Makefile.fpc

[package]
name=Sayuri
version=0.1

[require]
packages=


[target]
programs=sayuri

[compiler]
unitdir=languages
includedir=.

[default]
target=all

[clean]
files=$(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))


--
Damien Gerard
[EMAIL PROTECTED]

People who used magic without knowing what they were doing usually  
came to a sticky end. All over the entire room, sometimes.

-- (Terry Pratchett, Moving Pictures)



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