[fpc-pascal] Object Pascal operating system

2008-12-07 Thread Crause, Christo (JC)
Some proof of the concept: ClassiOS
(http://www.petros-project.com/index.php/products/classios.html) was
written in Delphi. Not an open source project, but it shows it can be
done.

Christo


NOTICE: Please note that this eMail, and the contents thereof, 
is subject to the standard Sasol eMail legal notice which may be found at: 
http://www.sasol.com/legalnotices   
   

If you cannot access the legal notice through the URL attached and you wish 
to receive a copy thereof please send an eMail to 
[EMAIL PROTECTED]

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


[fpc-pascal] RE: Succ() and Pred() operations

2008-04-10 Thread Crause, Christo (JC)
 Message: 9
 Date: Wed, 9 Apr 2008 13:55:40 -0800
 From: Ricardo Vi?gas [EMAIL PROTECTED]
 Subject: [fpc-pascal] Succ() and Pred() operations
 
 Hi there!
 
 I have installed FPC 2.2.0 [2007/09/09] a few days ago on my 
 WinXP-Pro-SP2, and I'm just taking a Web Tutorial on the language.
 when I come to User defined variable types, I decided to 
 make the following test:
 
 Program Test (Output);
 Type Vars = (var0, var1);
 Var x : Vars;
 Begin
x := var1;
x := Succ (x);
Writeln ( Ord(x) );
x := var0;
x := Pred (x);
Writeln ( Ord(x) );  
End.
 
 It compiled and executed without error, and returned 
 following 2 lines:
 2
 -1
 
 Is that supposed to be the correct output, or should it have 
 pointed an error during execution?
 The first symbol of the set has value 0, and second one, 
 value 1. To which symbols corresponds the values 2 and -1?

You can enable range checking {$R+}, which should then raise an error
if the value goes out of range. Tested with FPC 2.3.1.

Regards,
Christo

NOTICE: Please note that this eMail, and the contents thereof, 
is subject to the standard Sasol eMail legal notice which may be found at: 
http://www.sasol.com/legalnotices   
   

If you cannot access the legal notice through the URL attached and you wish 
to receive a copy thereof please send an eMail to 
[EMAIL PROTECTED]

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


Re: [fpc-pascal] Basic question about TStringList

2008-03-28 Thread Crause, Christo (JC)
 From: [EMAIL PROTECTED]

 As a consequence I have another question. Suppose I have a function  
 that returns a TStringList:
 
 Myfunction(): TStringList;
 
 I must have inside a line like:
 
 Result:=TStringList.Create;
 
 Let A be a TStringList, I have two ways to catch the result 
 of my function:
 
 A:=Myfunction();
 
 or
 
 A.Assign(Myfunction());
 
 In the first case, if do A.Free, I release the memory 
 allocated by the  
 function. What's arriving in the second case? I can do A.Free, but  
 does that action will also release the memory allocated by 
 the function?
 
 By the way, do you have some tricks to detect this kind of error?

This consequence of returning references to newly created objects is a
very subtle one and I have seen some spectacular memory leaks caused by
this practice.  My programming convention is to try to always call
.Create
and .Free in the same context if possible i.e.

procedure Myfunction(const ASL: TStringList);
begin
// add stuff to ASL
end;

And in code using this function:

SL := TStringList.Create;
Myfunction(SL);
// do stuff
SL.Free;

Not quite bullet proof yet, since one can call Myfunction without
actually
instantiating SL, but at least that should give you a runtime error that
should be easy to trace.

Regards
Christo Crause

NOTICE: Please note that this eMail, and the contents thereof, 
is subject to the standard Sasol eMail legal notice which may be found at: 
http://www.sasol.com/legalnotices   
   

If you cannot access the legal notice through the URL attached and you wish 
to receive a copy thereof please send an eMail to 
[EMAIL PROTECTED]

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


[fpc-pascal] RE: fpc-pascal Digest, Vol 43, Issue 21

2008-03-17 Thread Crause, Christo (JC)
 From: Codebue Fabio - P-Soft [EMAIL PROTECTED]
 
 I learn about all your tips... but nothing todo. I try to summarize
 I'm using firebird 2.0.3 in windows vista environment. pudf 
 was compiled
 with fpc 2.0.4 and created with lazarus 0.9.22

Did you upgrade or installed a newer version of Firebird over an older
one?  On my machine I installed a newer version over the older one, and
it installed the new version in a subdirectory under Firebird, but the
old
UDF folder was not removed.  I ended up with the following structure,
which lead me to putting UDF dll's in the wrong folder:

C:\Program Files\Firebird\UDF = old UDF folder, not used by my Firebird
2.0
C:\Program Files\Firebird\Firebird_2_0\UDF = new and correct UDF folder

Note that this situation is specific to the way I upgraded and your
folder
structures may look different.  Just ensure that the UDF folder you are
using is at the same level as the bin folder containing the version you
are running.

Regards,
Christo

NOTICE: Please note that this eMail, and the contents thereof, 
is subject to the standard Sasol eMail legal notice which may be found at: 
http://www.sasol.com/legalnotices   
   

If you cannot access the legal notice through the URL attached and you wish 
to receive a copy thereof please send an eMail to 
[EMAIL PROTECTED]

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


[fpc-pascal] RE: Firebird UDF

2008-03-13 Thread Crause, Christo (JC)
 From: Codebue Fabio - P-Soft
...
 function pround(var valore: real; ndec: integer):real;export; 
...
 DECLARE EXTERNAL FUNCTION pround 
 DOUBLE PRECISION, INTEGER 
 RETURNS DOUBLE PRECISION BY VALUE 
 ENTRY_POINT 'pround' MODULE_NAME 'pudf'; 
 
 if I use it with an instruction like this 
 
 select round(123.1233, 2) as nrounded from rdb$database 
 
 I have back this error 
 
 Invalid token. 
 invalid request BLR at offset 59. 
 function PROUND is not defined. 
 module name or entrypoint could not be found. 
 
 do you have some idea regarding this error?

I guess you made a typo in your select statement,
since it calls round, not pround.

It would appear that Firebird cannot load the 
dll/so or find the entry point to the function
in the dll.  Did you copy the dll/so to the UDF
subdirectory of your Firebird diretory?  You
could also try adding the extension (.dll or .so)
to the name of the library.  If you are using Linux
you should also check the permissions on the library
and make sure that Firebird can load it.  If this
doesn't work, open the Firebird.conf file and check
what the value for UdfAccess is.

You may also have to change the calling convension of
your function to cdecl, since that is what Firebird expects.

Regards,
Christo

NOTICE: Please note that this eMail, and the contents thereof, 
is subject to the standard Sasol eMail legal notice which may be found at: 
http://www.sasol.com/legalnotices   
   

If you cannot access the legal notice through the URL attached and you wish 
to receive a copy thereof please send an eMail to 
[EMAIL PROTECTED]

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


[fpc-pascal] OT: RE: fp not available

2005-11-15 Thread Crause, Christo (JC)
 From: Vincent Snijders [EMAIL PROTECTED]
 Subject: Re: [fpc-pascal] RE: fp not available
 To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org

 Please, write error messages with svn versions of both fpc 
 and lazarus to the 
 lazarus mailing list or submit a bug report on 
 http://www.lazarus.freepascal.org/mantis/main_page.php
 
 But make sure you are the latest svn version of both fpc and 
 lazarus. A number of 
 fixes have been made since the latest releases.
 
 As far as I know, lazarus can be compiled and started on linux-amd64
 
 Vincent.

Thanks Vincent, I had another look at the compiler errors and realised
that the fpc.cfg file was not set up correctly to work with the SVN
version of FPC.  Lazarus does indeed compile with both latest fpc 2.0.1
and 2.1.1

Regards,
Christo Crause

NOTICE: Please note that this eMail, and the contents thereof, 
is subject to the standard Sasol eMail legal notice which may be found at: 
http://www.sasol.com/legalnotices   
   

If you cannot access the legal notice through the URL attached and you wish 
to receive a copy thereof please send an eMail to 
[EMAIL PROTECTED]


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


[fpc-pascal] RE: fp not available

2005-11-14 Thread Crause, Christo (JC)
 Date: Sun, 13 Nov 2005 17:50:46 +0100
 From: J.L. Blom [EMAIL PROTECTED]
 Subject: [fpc-pascal] fp not available

 I have an AMD64 running the 64-bit version of Fedora4 and I 
 haven't found a specific 64-bit version of fpc. 
 I hope somebody can give me some clues.
 Joep

You can download x86_64 fpc 2.0.0 rpm's from:
http://www.freepascal.org/down-x86_64-linux-ftp.freepascal.org.html

I am interested in knowing whether you get Lazarus working in 64 bit
mode.  I have compiled it with fpc 2.0.0, but get runtime errors.  I
could not get Lazarus to compile with 64 bit fpc 2.0.1 or 2.1.1 yet.

Regards,
Christo Crause

NOTICE: Please note that this eMail, and the contents thereof, 
is subject to the standard Sasol eMail legal notice which may be found at: 
http://www.sasol.com/legalnotices   
   

If you cannot access the legal notice through the URL attached and you wish 
to receive a copy thereof please send an eMail to 
[EMAIL PROTECTED]


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