Re: [fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread Bihar Anwar
Thanks Jose, Werner, and Jonas for the fantastic discussion and explanation. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread cobines
2010/5/6 spir ☣ : > (By the way, started playing with TFPList already, and could not find how to > get data back! I mean the symtric of add(). Even tried indexing (who knows, > with the syntactic magic of modern language? ;-).) It is indexing. var l: TFPList; p: Pointer; index: Integer; b

Re: [fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread Flávio Etrusco
On Thu, May 6, 2010 at 7:34 PM, Jonas Maebe wrote: > > On 06 May 2010, at 23:28, Werner Van Belle wrote: > >> In 'human' (haha) terms: >> >> - global variable access: write data into 'ds+constant' >> - local variables: write data into 'ss+bp+constant'. >> >> Since the latter involves a term more I

Re: [fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread Jonas Maebe
On 06 May 2010, at 23:28, Werner Van Belle wrote: > In 'human' (haha) terms: > > - global variable access: write data into 'ds+constant' > - local variables: write data into 'ss+bp+constant'. > > Since the latter involves a term more I assume it is bound to take more > time. That was true in t

Re: [fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread Werner Van Belle
Jonas Maebe wrote: > I don't have the faintest idea why it would be true. I'll explain below > Local variables (including arrays) are allocated on the stack and are > accessed without any kind of indirection (except for dynamic arrays, but the > same goes for globally defined dynamic arrays). T

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread spir ☣
On Thu, 6 May 2010 12:10:39 -0300 Flávio Etrusco wrote: > On Thu, May 6, 2010 at 11:58 AM, Florian Klaempfl > wrote: > > José Mejuto schrieb: > >> Hello FPC-Pascal, > >> > >> Thursday, May 6, 2010, 3:53:59 PM, you wrote: > >> > >> c> TList wraps TFPList, which is based internally on an array. So

Re[2]: [fpc-pascal] about dynamic array

2010-05-06 Thread José Mejuto
Hello FPC-Pascal, Thursday, May 6, 2010, 9:50:34 PM, you wrote: DC> The short answer is because you have not set p2 to nil as you did to p1. I do not want to be rude but, do you read all the message ? I was trying to be ironic, but seems that I was unable maybe due my very limited english, sorry

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread Doug Chamberlin
On 5/6/2010 3:12 PM, José Mejuto wrote: Entering the doom again... Next question could be why: p1: TObject; p2: TObject; p1:=TObject.Create(); p2:=p1; P1.free; p1:=nil; Why I get an AV if accesing p2 ? Because the object has been freed... So why is not p2 = nil as p1 ? The short answer is becau

Re[2]: [fpc-pascal] about dynamic array

2010-05-06 Thread José Mejuto
Hello FPC-Pascal, Thursday, May 6, 2010, 8:58:33 PM, you wrote: >> faster in fact. If the user plans to use a record (which is my >> suspect) with TList he must "new" and "dispose" the elements and he >> will end up with a dyn array of pointers after all, which is a TList. FK> A dyn. array of rec

Re: [fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread Jonas Maebe
On 06 May 2010, at 18:12, Werner Van Belle wrote: > Jonas Maebe wrote: >> >> On 06 May 2010, at 16:43, Bihar Anwar wrote: >> >>> If I remember this correctly, I've formerly ever read somewhere (in >>> my Delphi days) that array should be declared globally (not inside a >>> function or procedure

Re[2]: [fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread José Mejuto
Hello FPC-Pascal, Thursday, May 6, 2010, 7:12:46 PM, you wrote: >>> If I remember this correctly, I've formerly ever read somewhere (in >>> my Delphi days) that array should be declared globally (not inside a >>> function or procedure) so that access to the array will be faster. Is >>> this corre

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread Florian Klaempfl
José Mejuto schrieb: > Hello FPC-Pascal, > > Thursday, May 6, 2010, 4:58:41 PM, you wrote: > >>> c> TList wraps TFPList, which is based internally on an array. So access >>> c> is fast; insertion, deletion not. >>> >>> But it is faster than inserting elements in a dynamic array (unless >>> refere

Re[2]: [fpc-pascal] about dynamic array

2010-05-06 Thread José Mejuto
Hello FPC-Pascal, Thursday, May 6, 2010, 4:58:41 PM, you wrote: >> c> TList wraps TFPList, which is based internally on an array. So access >> c> is fast; insertion, deletion not. >> >> But it is faster than inserting elements in a dynamic array (unless >> reference counted ones) because it usua

Re: [fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread Werner Van Belle
Jonas Maebe wrote: > > On 06 May 2010, at 16:43, Bihar Anwar wrote: > >> If I remember this correctly, I've formerly ever read somewhere (in >> my Delphi days) that array should be declared globally (not inside a >> function or procedure) so that access to the array will be faster. Is >> this corre

Re: [fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread Jonas Maebe
On 06 May 2010, at 16:43, Bihar Anwar wrote: If I remember this correctly, I've formerly ever read somewhere (in my Delphi days) that array should be declared globally (not inside a function or procedure) so that access to the array will be faster. Is this correct? No. Jonas __

Re: [fpc-pascal] about dynamic array -- PS

2010-05-06 Thread Matthias K.
2010/5/6 spir ☣ : > Hello, > > It seems the actual issue with static array is that the size is part the > type. So that one cannot even use a pointer to refer to an array which size > is supposed to change (since the pointer's type itself would be constrained > by the size). Is this correct? > I

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread Flávio Etrusco
On Thu, May 6, 2010 at 11:58 AM, Florian Klaempfl wrote: > José Mejuto schrieb: >> Hello FPC-Pascal, >> >> Thursday, May 6, 2010, 3:53:59 PM, you wrote: >> >> c> TList wraps TFPList, which is based internally on an array. So access >> c> is fast; insertion, deletion not. >> >> But it is faster tha

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread Florian Klaempfl
José Mejuto schrieb: > Hello FPC-Pascal, > > Thursday, May 6, 2010, 3:53:59 PM, you wrote: > > c> TList wraps TFPList, which is based internally on an array. So access > c> is fast; insertion, deletion not. > > But it is faster than inserting elements in a dynamic array (unless > reference count

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread spir ☣
On Thu, 6 May 2010 16:20:58 +0200 José Mejuto wrote: > Hello FPC-Pascal, > > Thursday, May 6, 2010, 3:53:59 PM, you wrote: > > c> TList wraps TFPList, which is based internally on an array. So access > c> is fast; insertion, deletion not. > > But it is faster than inserting elements in a dynam

[fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread Bihar Anwar
If I remember this correctly, I've formerly ever read somewhere (in my Delphi days) that array should be declared globally (not inside a function or procedure) so that access to the array will be faster. Is this correct? If yes, does this also true in FPC? Thanks in advance. _

Re: how to install ? [Re: [fpc-pascal] fpGUI Toolkit v0.7-rc2 for FPC 2.4]

2010-05-06 Thread Graeme Geldenhuys
On 6 May 2010 16:22, duilio foschi wrote: > > 'happing' ? Damn broken keyboard! ;-) -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ ___ fpc-

Re: how to install ? [Re: [fpc-pascal] fpGUI Toolkit v0.7-rc2 for FPC 2.4]

2010-05-06 Thread Graeme Geldenhuys
On 6 May 2010 16:08, Martin wrote: > > Nothing on the webpage. Just to let you know, I am busy redesigning the whole fpGUI website - ready for the release of v0.7. The new website contains a lot more helpful information and IDE integration of UI Designer and DocView supporting both Lazarus IDE an

Re: how to install ? [Re: [fpc-pascal] fpGUI Toolkit v0.7-rc2 for FPC 2.4]

2010-05-06 Thread duilio foschi
>This is a status update of what is happing with the fpGUI 'happing' ? Rgds Duilio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re[2]: [fpc-pascal] about dynamic array

2010-05-06 Thread José Mejuto
Hello FPC-Pascal, Thursday, May 6, 2010, 3:53:59 PM, you wrote: c> TList wraps TFPList, which is based internally on an array. So access c> is fast; insertion, deletion not. But it is faster than inserting elements in a dynamic array (unless reference counted ones) because it usually moves less

Re: how to install ? [Re: [fpc-pascal] fpGUI Toolkit v0.7-rc2 for FPC 2.4]

2010-05-06 Thread Graeme Geldenhuys
Martin het geskryf: > All fine and good, > But I couldn't even find out how to install it. > > Nothing on the webpage. There is an INSTALL.TXT, it says change into > src, and run build.bat (for windows) > > I did that 9yes fpc (2.5.1) in path. > > I get some output that it compiles something, b

how to install ? [Re: [fpc-pascal] fpGUI Toolkit v0.7-rc2 for FPC 2.4]

2010-05-06 Thread Martin
All fine and good, But I couldn't even find out how to install it. Nothing on the webpage. There is an INSTALL.TXT, it says change into src, and run build.bat (for windows) I did that 9yes fpc (2.5.1) in path. I get some output that it compiles something, but no exe is created. so how to I g

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread cobines
2010/5/6 spir ☣ : > So, if TList is a type of linked list, it can probably not do the job for me. > Anyway, I'm not a production programmer & would be pleased to explore this > topic as an occasion to learn Pascal and fp further. TList wraps TFPList, which is based internally on an array. So acc

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread spir ☣
On Thu, 6 May 2010 12:16:22 +0200 Graeme Geldenhuys wrote: > 2010/5/6 spir ☣ : > > > > If the answers to last 2 questions is "only every 29th of februar", how can > > one have a "flexible" array? Is there something like that in stock? Would > > you implement it on top of dynamic array, or rathe

Re: [fpc-pascal] standard unit description -- builtin funcs & procs

2010-05-06 Thread Michael Van Canneyt
On Thu, 6 May 2010, spir ☣ wrote: Hello, It seems, maybe, that most people using freepascal actually come from a different environment (esp Delphi) with all needed knowledge about (a dialect of) the language itself, here in fact Pascal *and* object Pascal; and also about its major utilities (

[fpc-pascal] standard unit description -- builtin funcs & procs

2010-05-06 Thread spir ☣
Hello, It seems, maybe, that most people using freepascal actually come from a different environment (esp Delphi) with all needed knowledge about (a dialect of) the language itself, here in fact Pascal *and* object Pascal; and also about its major utilities (& common libraries). How do *real* n

Re: [fpc-pascal] about dynamic array -- PS

2010-05-06 Thread Henry Vermaak
2010/5/6 spir ☣ : > Hello, > > If yes, how is it possible to build a "flexible" array type (in which on can > add/remove elements) on top of static array? It depends on what you want to do with the array. As Jonas said, you may want to look at linked lists if you need to add/remove elements freq

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread Graeme Geldenhuys
2010/5/6 spir ☣ : > > If the answers to last 2 questions is "only every 29th of februar", how can > one have a "flexible" array? Is there something like that in stock? Would you > implement it on top of dynamic array, or rather from scratch on top of static > array (since the "dynamicity" does n

[fpc-pascal] about dynamic array -- PS

2010-05-06 Thread spir ☣
Hello, It seems the actual issue with static array is that the size is part the type. So that one cannot even use a pointer to refer to an array which size is supposed to change (since the pointer's type itself would be constrained by the size). Is this correct? If yes, how is it possible to bu

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread Michael Van Canneyt
On Thu, 6 May 2010, spir ☣ wrote: Hello, Where can one find information on types like dynamic array? Also, on funcs or procs that apply on them, like setLength & copy. If the answers to the following questions are somewhere, just tell me... * Can one rely on the fact that setLength keeps

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread Jonas Maebe
On 06 May 2010, at 11:39, spir ☣ wrote: Where can one find information on types like dynamic array? Also, on funcs or procs that apply on them, like setLength & copy. In the documentation: http://www.freepascal.org/docs-html/ref/refsu14.html * Can one rely on the fact that setLength keeps e

Re: [fpc-pascal] dynamic array contents and system.move

2010-05-06 Thread Jonas Maebe
On 05 May 2010, at 18:21, Jürgen Hestermann wrote: > That's just the root cause of the problem Another problem is that this thread has become too long and nobody is saying anything new anymore. So please continue it on the fpc-other list. Thanks, Jonas FPC mailing lists admin

[fpc-pascal] about dynamic array

2010-05-06 Thread spir ☣
Hello, Where can one find information on types like dynamic array? Also, on funcs or procs that apply on them, like setLength & copy. If the answers to the following questions are somewhere, just tell me... * Can one rely on the fact that setLength keeps existing data (in the range of the ne

Re: [fpc-pascal] cross platform bluetooh library

2010-05-06 Thread leledumbo
I only found http://wiki.lazarus.freepascal.org/Bluetooth this in the wiki. You may want to ask the author to support Windows as well. -- View this message in context: http://old.nabble.com/cross-platform-bluetooh-library-tp28461682p28470840.html Sent from the Free Pascal - General mailing lis