[fpc-devel]Weird isn't it ?

Maly maly at zga.pl
Wed Feb 12 21:11:15 CET 2003


Anton Tichawa wrote:
> I didn't read all your code. But you should change:
> 
> constructor CFile.Create(var AFS:CDataFile;APath:string);
> 
> to
> 
> constructor CFile.Create(AFS:CDataFile;APath:string);
> 
> when AFS is an already constructed class. The reason is that AFS is a
> pointer to the instance. If AFS is already valid, i. e. points to an
> instance, there's no need and even danger when you pass it as var.
> You should pass a class as var only if you intend to make it point to
> a new or different instance.


well, yes You're right about that, the previous 
version of that declaration was without the 'var',
i added var after this bug came up - i tried
everything to correct this :/. but that's not
the cause of my problem - anyway i'll change it
back to the previous form i.e. without 'var'.

(currently i have added 'Write;' without any
 arguments, there is no output, code works but
 it's still not right - i don't want any Write :/)

p.s.
I guess it's a bit like a problem i had a long time ago
the code 'crashed' FPU (if it's possible), and just adding
delay(1) to the main processing loop helped.

Still waiting for some help.

Best Regards 
Luke 'Maly' O.






More information about the fpc-devel mailing list