[fpc-pascal] New/Dispose vs GetMem/FreeMem

2009-10-15 Thread Graeme Geldenhuys
Hi, Which of these should I use in new projects? I read somewhere that GetMem/FreeMem is actually compatibility methods from Turbo Pascal days, yet I have seen lots of new code that uses it, so I guess it's still ok to use? I have various complex structured types and pointers to those types.

Re: [fpc-pascal] Linux IPC (SHM) : Getting Strange Value for shm_nattch (# of attachements)

2009-10-15 Thread Tom__G
No idea ? :-(( -- View this message in context: http://www.nabble.com/Linux-IPC-%28SHM%29-%3A-Getting-Strange-Value-for-shm_nattch-%28--of-attachements%29-tp25874304p25905043.html Sent from the Free Pascal - General mailing list archive at Nabble.com.

Re: [fpc-pascal] Code conversion question - alloc and dealloc memory

2009-10-15 Thread Florian Klaempfl
Graeme Geldenhuys schrieb: What if I don't pass in a size to FreeMem(), will it know how much to free? Yes (as long as you don't mess with internal heap structures ;)). ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] Re: Code conversion question - alloc and dealloc memory

2009-10-15 Thread Graeme Geldenhuys
On 15/10/2009, Graeme Geldenhuys graemeg.li...@gmail.com wrote: function AllocateMemory( const Size: longint ): pointer; procedure DeallocateMemory( Var P: pointer ); OK, I managed to convert those two functions to the following.. it now compiles under my 64bit

Re: [fpc-pascal] Code conversion question - alloc and dealloc memory

2009-10-15 Thread Graeme Geldenhuys
On 15/10/2009, Florian Klaempfl flor...@freepascal.org wrote: Yes (as long as you don't mess with internal heap structures ;)). OK, thanks. So that means I don't need to use the custom AllocateMemory() and DeallocateMemory() functions - no need to track the original size of memory allocated.

Re: [fpc-pascal] Re: Code conversion question - alloc and dealloc memory

2009-10-15 Thread Michael Van Canneyt
On Thu, 15 Oct 2009, Graeme Geldenhuys wrote: On 15/10/2009, Graeme Geldenhuys graemeg.li...@gmail.com wrote: function AllocateMemory( const Size: longint ): pointer; procedure DeallocateMemory( Var P: pointer ); OK, I managed to convert those two functions to

Re: [fpc-pascal] New/Dispose vs GetMem/FreeMem

2009-10-15 Thread Florian Klaempfl
Graeme Geldenhuys schrieb: Hi, Which of these should I use in new projects? I read somewhere that GetMem/FreeMem is actually compatibility methods from Turbo Pascal days, yet I have seen lots of new code that uses it, so I guess it's still ok to use? GetMem/FreeMem are lower level than

Re: [fpc-pascal] Linux IPC (SHM) : Getting Strange Value for shm_nattch (# of attachements)

2009-10-15 Thread Henry Vermaak
2009/10/13 Tom__G t...@guilleminot.org: Hi, I try to get number of processes attached to a specific shared memory segment. So I read the shmctl record to retrieve this into shared memory : type TShmid_ds = record  shm_perm: TIPC_Perm; Permissions  shm_segsz: cint; Segment size  

[fpc-pascal] What does TFileStream.Seek() return?

2009-10-15 Thread Graeme Geldenhuys
Based on the documentation shown here, it doesn't mention what the return value is. Anybody have a clue? http://www.freepascal.org/docs-html/rtl/classes/thandlestream.seek.html -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI

Re: [fpc-pascal] Video4Linux access

2009-10-15 Thread James Buren
Hi Everybody, I need video4linux support for my new project. I tried vfp unit I found in the contribute units website. But it seems very outdated. Itried all things menitioned in the forum, but I'm not able to get the things up. the code is hard to read and I found not one comment line :(

Re: [fpc-pascal] More OS X problems

2009-10-15 Thread Paul Davidson
Thank you Changing the mode in the project fixed all problems. System now compiles correctly. pd On 2009-10-13, at 4:14 PM, Jonas Maebe wrote: Paul Davidson wrote on Tue, 13 Oct 2009: OS X 10.6.1 FPC 2.2.4 Xcode 3.2 (64 bit) Using code base that has complied correctly since 2004

[fpc-pascal] MySQL

2009-10-15 Thread Paul Davidson
FPC 2.2.4 OS X 10.6.1 Xcode 3.2 All references to MySQL function are unresolved by linker. libMySQLclient.a is copied to .pas directory. Using FPC test code for MySQL as template. Any hints please? ___ fpc-pascal maillist -

Re: [fpc-pascal] What does TFileStream.Seek() return?

2009-10-15 Thread Michael Van Canneyt
On Wed, 14 Oct 2009, Graeme Geldenhuys wrote: Based on the documentation shown here, it doesn't mention what the return value is. Anybody have a clue? http://www.freepascal.org/docs-html/rtl/classes/thandlestream.seek.html The return value should be the new - absolute - position in the

Re: [fpc-pascal] Linux IPC (SHM) : Getting Strange Value for shm_nattch (# of attachements)

2009-10-15 Thread Tom__G
Henry Vermaak wrote: 2009/10/13 Tom__G t...@guilleminot.org: Hi, I try to get number of processes attached to a specific shared memory segment. So I read the shmctl record to retrieve this into shared memory : type TShmid_ds = record  shm_perm: TIPC_Perm; Permissions  shm_segsz:

Re: [fpc-pascal] What does TFileStream.Seek() return?

2009-10-15 Thread Graeme Geldenhuys
On 15/10/2009, Michael Van Canneyt mich...@freepascal.org wrote: The return value should be the new - absolute - position in the stream. Ah, thanks Michael. Could the documentation be update with this information...? -- Regards, - Graeme -

Re: [fpc-pascal] Problems to compile FPC 2.3.0

2009-10-15 Thread Jonas Maebe
On 12 Oct 2009, at 17:03, Matthias Klumpp wrote: On Mon, 12 Oct 2009 12:49:03 +0200, Jonas Maebe jonas.ma...@elis.ugent.be wrote: On 11 Oct 2009, at 18:37, Matthias Klumpp wrote: I decided to use this version of FPC for now. Thank you for your help! But now I have problems to compile

Re: [fpc-pascal] What does TFileStream.Seek() return?

2009-10-15 Thread Michael Van Canneyt
On Thu, 15 Oct 2009, Graeme Geldenhuys wrote: On 15/10/2009, Michael Van Canneyt mich...@freepascal.org wrote: The return value should be the new - absolute - position in the stream. Ah, thanks Michael. Could the documentation be update with this information...? I already have put it

Re: [fpc-pascal] What does TFileStream.Seek() return?

2009-10-15 Thread Graeme Geldenhuys
On 15/10/2009, Michael Van Canneyt mich...@freepascal.org wrote: I already have put it in my queue... :-) Thanks. -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Re: [fpc-pascal] pointer arithmetic help required

2009-10-15 Thread Graeme Geldenhuys
By the way, I am reading in the Table of Contents data for an OS/2 INF file. Martin wrote: if pentry is TEntry = record .. end; pentry = ^ TEntry Yes, pEntry is a pointer to a structured type. pEntry: pTTOCEntryStart; The actual structure is as follows...

Re: [fpc-pascal] pointer arithmetic help required

2009-10-15 Thread Martin
Graeme Geldenhuys wrote: By the way, I am reading in the Table of Contents data for an OS/2 INF file. // now increment pEntry to point to next data structure // below, .Length is in bytes inc( pEntry, pEntry^.Length); inc(PEntry, 1) since it increments by the size of the

Re: [fpc-pascal] pointer arithmetic help required

2009-10-15 Thread Graeme Geldenhuys
Martin wrote: Graeme Geldenhuys wrote: By the way, I am reading in the Table of Contents data for an OS/2 INF file. // now increment pEntry to point to next data structure // below, .Length is in bytes inc( pEntry, pEntry^.Length); inc(PEntry, 1) since it increments

Re: [fpc-pascal] MySQL

2009-10-15 Thread Paul Davidson
Added libmysqlclient.a to the project and it gets automatically included in Tagets/cape96/Link Binary With Libraries. Again same linker errors: Symbols not found. Also tried libmysqlclient.la. Same result. When looking at examples and tests in FPC for MySQL they do not contain any

Re: [fpc-pascal] MySQL

2009-10-15 Thread Jonas Maebe
On 15 Oct 2009, at 16:03, Paul Davidson wrote: On 2009-10-15, at 7:13 AM, Jonas Maebe wrote: On 14 Oct 2009, at 18:14, Paul Davidson wrote: FPC 2.2.4 OS X 10.6.1 Xcode 3.2 All references to MySQL function are unresolved by linker. libMySQLclient.a is copied to .pas directory. Using

Re: [fpc-pascal] open arrays as parameters (why packed not allowed)?

2009-10-15 Thread Jonas Maebe
On 15 Oct 2009, at 14:49, Bruce Bauman wrote: [packed for open array parameters] Is there a reason why packed is not allowed in this context? I think it's simply because I forgot to add it when adding support for packed arrays. Please file a bug report. Jonas

RE: [fpc-pascal] open arrays as parameters (why packed not allowed)?

2009-10-15 Thread Bruce Bauman
Thanks. Will do. -Original Message- From: fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of Jonas Maebe Sent: Thursday, October 15, 2009 10:28 AM To: FPC-Pascal users discussions Subject: Re: [fpc-pascal] open arrays as parameters (why

Re: [fpc-pascal] MySQL

2009-10-15 Thread Paul Davidson
Here is the head of the unit: { cMySQL.pas cape61 Created by Paul Davidson on 2005/01/18. Copyright (c) 2005 Corax Networks.Inc.. All rights reserved. } unit cMySQL; {$I Directives.inc} interface {$linklib libmysqlclient.a} uses cBase, cKey, cStack,

[fpc-pascal] BNF grammar for fpc

2009-10-15 Thread Marc Santhoff
Hi everyone, is a complete grammar for fpc written in some variant of BNF available somewhere? I searched the website and the wiki, to no avail. TIA, Marc -- Marc Santhoff m.santh...@web.de ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] pointer arithmetic help required

2009-10-15 Thread Vinzent Höfler
Graeme Geldenhuys graemeg.li...@gmail.com: Now I know why vendors of newer languages (Dephi, Java etc) are trying to hide pointers from programmers. They are very tricky to work with - and give errors without warning! Especially when compiler and programmer are both trying to outsmart each

Re: [fpc-pascal] Who said Pascal isn't popular

2009-10-15 Thread 章宏九
Hmm, currently I am also learning Oberon. No any language requires an IDE. I use vim. Others might use emacs. These are enough. What we need is a simple editor (if you like, GNU nano or simply cat 1.pas is okay) and a compiler. They can make the world, although not that efficiently. Not the