[fpc-pascal]Classes/Objects/Pointers

2003-02-09 Thread James Mills
Hi all, Sorry to bother you again, can't seem to see what I'm doing wrong it's the same as my dynamic code for strings... var nicks: PNick; nNicks: Integer; procedure initialiseDataNicks; procedure addNick(data: String); procedure updateNick(index: Integer; nick: pNick); function getNi

Re: [fpc-pascal]Amiga snapshot uploaded.

2003-02-09 Thread amorel
On Sun, Feb 09, 2003 at 08:04:46PM +0100, Carl Eric Codere wrote: > > Greetings, > I've uploaded a new snapshot for the amiga,which is > available at this url: > > ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/amiga/m68k/baseami.lha Thanks for that, I`ll check and try it out. Regards _

[fpc-pascal]Amiga snapshot uploaded.

2003-02-09 Thread Carl Eric Codere
Greetings, I've uploaded a new snapshot for the amiga,which is available at this url: ftp://ftp.freepascal.org/pub/fpc/snapshot/v10/amiga/m68k/baseami.lha Hopefully the unit related problems are now fixed. Carl ___ fpc-pascal maillist -

Re: [fpc-pascal]isprime()

2003-02-09 Thread astlab
Hi Mark > Just out of curiosity, is Franco's algorithm based upon the recent > discovery by mathematicians in India? No, the method of Agrawal, Kayal and Saxena is still in a theoretical state and we have to wait for an efficient algorithm to apply it. I used an old Miller-Rabin method. By testin

Re: [fpc-pascal]isprime()

2003-02-09 Thread astlab
Hi Anton > To me it seems that your function works properly. I compared the > results for all cardinal values, using your algorithm > (cprimes_v.create below) against the results of my own algorithm > (cprimes_m.create below), which I updated to 32 bits tonight. I'm happy to read that the functio

Re: [fpc-pascal]isprime()

2003-02-09 Thread Mark Emerson
> whereas you analytically check one single > number for primality. Just out of curiosity, is Franco's algorithm based upon the recent discovery by mathematicians in India? Mark ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/

Re: [fpc-pascal]graph unit and the mouse

2003-02-09 Thread Mark Emerson
Florian Klaempfl wrote: > > Mark Emerson wrote: > > Does anybody know a way to read the mouse at pixel resolution while > > using the graph unit? > > > > You mean for go32v2? It depends on your mouse driver I think. > Please excuse my ignornace, but I don't yet understand what "go32v2" means...I

Re: [fpc-pascal]Error: The object arg1 has no VMT

2003-02-09 Thread Anton Tichawa
Hello, Preben Mikael Bohn! Could you post the sources once again - I've already deleted your initial request. Anton. > Preben Mikael Bohn mumbled something about: > > Dear all, I get the error "Error: The object TINTERPOLATION has no VMT" > > when trying to compile one of my programs with the o

Re: [fpc-pascal]Error: The object arg1 has no VMT

2003-02-09 Thread Preben Mikael Bohn
Preben Mikael Bohn mumbled something about: > Dear all, I get the error "Error: The object TINTERPOLATION has no VMT" when > trying to compile one of my programs with the option -Sd (delphi mode), but > not in normal mode. Maybe I should add that when I compile the program with the -S2 option I do

Re: [fpc-pascal]Pointer Help

2003-02-09 Thread James Mills
On Sun, Feb 09, 2003 at 03:42:29PM +0100, Anton Tichawa wrote: > Hi, > > > But getMem and reAllocMem allocate a number of bytes on the heap, > > wouldn't you have to free that number of bytes using freeMem(pointer, n) > > ? > > No, Free Pascal keeps track of the allocated size for a pointer creat

Re: [fpc-pascal]graph unit and the mouse

2003-02-09 Thread Florian Klaempfl
Mark Emerson wrote: Does anybody know a way to read the mouse at pixel resolution while using the graph unit? You mean for go32v2? It depends on your mouse driver I think. ___ fpc-pascal maillist - [EMAIL PROTECTED] http://lists.freepascal.org/ma

Re: [fpc-pascal]Pointer Help

2003-02-09 Thread Anton Tichawa
Hi, > But getMem and reAllocMem allocate a number of bytes on the heap, > wouldn't you have to free that number of bytes using freeMem(pointer, n) > ? No, Free Pascal keeps track of the allocated size for a pointer created with GetMem/ReallocMem. They need this information for heap management, s

[fpc-pascal]Error: The object arg1 has no VMT

2003-02-09 Thread Preben Mikael Bohn
Dear all, I get the error "Error: The object TINTERPOLATION has no VMT" when trying to compile one of my programs with the option -Sd (delphi mode), but not in normal mode. The error is listed but apparently not documented in http://www.freepascal.org/docs-html/user/node15.html#SECTION00151

Re: [fpc-pascal]Pointer Help

2003-02-09 Thread James Mills
On Sun, Feb 09, 2003 at 03:12:07PM +0100, Anton Tichawa wrote: > On Sunday 09 February 2003 12:54, you wrote: > > > freeMem(tmpStrings, sizeOf(String) * (N)); > > No, only: > > freeMem(tmpStrings); But getMem and reAllocMem allocate a number of bytes on the heap, wouldn't you have to free that

Re: [fpc-pascal]Pointer Help

2003-02-09 Thread Anton Tichawa
On Sunday 09 February 2003 12:54, you wrote: > freeMem(tmpStrings, sizeOf(String) * (N)); No, only: freeMem(tmpStrings); Read the Manual - Free Pascal Programmer's Manual, Section 4.5, "Writing Your Own Memory Manager" - because that's what you're actually doing. HTH Anton Tichawa. --

Re: [fpc-pascal]Pointer Help

2003-02-09 Thread Anton Tichawa
Hello, James! That's exactly what I meant: I'm not sure if fpc is able to keep track of the destruction of the strings in case of AnsiString. You might check it by displaying the total free memory before and after the deallocation of tmpStrings. But one of the developers might answer this quest

Re: [fpc-pascal]Pointer Help

2003-02-09 Thread James Mills
On Sun, Feb 09, 2003 at 02:22:55PM +0100, Anton Tichawa wrote: > Hello, James! > > I found an error at GetMem / ReAllocMem: Your code: > > getMem(tmpStrings, 100); > {reAllocMem(tmpStrings, (I + 1));} > > reserves 100 or (I + 1) BYTES, but you need space for 100 or (I + 1) > STRINGS, i. e.

Re: [fpc-pascal]Pointer Help

2003-02-09 Thread James Mills
On Sun, Feb 09, 2003 at 02:22:55PM +0100, Anton Tichawa wrote: > Hello, James! > > I found an error at GetMem / ReAllocMem: Your code: > > getMem(tmpStrings, 100); > {reAllocMem(tmpStrings, (I + 1));} > > reserves 100 or (I + 1) BYTES, but you need space for 100 or (I + 1) > STRINGS, i. e.

Re: [fpc-pascal]Pointer Help

2003-02-09 Thread Anton Tichawa
Hello, James! I found an error at GetMem / ReAllocMem: Your code: getMem(tmpStrings, 100); {reAllocMem(tmpStrings, (I + 1));} reserves 100 or (I + 1) BYTES, but you need space for 100 or (I + 1) STRINGS, i. e. the code should be: getMem(tmpStrings, SizeOf(String) * 100); {reAllocMem(tm

Re: [fpc-pascal]isprime()

2003-02-09 Thread Anton Tichawa
Hi, Franco Milani! To me it seems that your function works properly. I compared the results for all cardinal values, using your algorithm (cprimes_v.create below) against the results of my own algorithm (cprimes_m.create below), which I updated to 32 bits tonight. All I changed in your function

Re: [fpc-pascal]Pointer Help

2003-02-09 Thread James Mills
On Sun, Feb 09, 2003 at 08:30:57PM +1000, James Mills wrote: > Hi all, > > Sorry if this is trivial, but I'm sick of it :) > I'm using fpc to convert my (originally delphi) code to read and write > ini style files, however writing will not work as I want, the data in > the pointer keeps getting fi

[fpc-pascal]Pointer Help

2003-02-09 Thread James Mills
Hi all, Sorry if this is trivial, but I'm sick of it :) I'm using fpc to convert my (originally delphi) code to read and write ini style files, however writing will not work as I want, the data in the pointer keeps getting filled with junk. I'm using getMem, and reAllocMem functions to create dyn