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

2010-04-27 Thread Jürgen Hestermann
There is a lot of ambigouity with dynamic arrays. There certainly is if you expect them to work like regular arrays. They are a quite different datatype. At least it should always mean the same independent from context. It does always mean the same, just like a class instance always means the

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

2010-04-27 Thread ajv
I dit not follow this thread, but maybe it helps. Dynamic arrays are located on the heap and are reference counted. The command System.Move will bypass the reference counting. For this reason and to be sure the data is available when you need it use System.Move on stack located arrays an

Re: [fpc-pascal] State of FPC docs.rant

2010-04-27 Thread Marco van de Voort
In our previous episode, Joseph Montanez said: I just spent 2 hours on FPDoc's trying to get how to use it. Automatic documentation was dead easy but the whole XML integration part was a nightmare, so I gave up reading the docs on how to use the doc. Instead I figure Hey there must be examples

[fpc-pascal] pointer magic

2010-04-27 Thread spir ☣
Hello, Two basic questions about pointer targets (I call target what is pointed to). -1- untyped pointer allocation In case of an untyped pointer, I read the compiler considers the target'size is 1 byte. There certainly is an operation to allocate memory for the target according to an existing

Re: [fpc-pascal] State of FPC docs.rant

2010-04-27 Thread Graeme Geldenhuys
On 27 April 2010 02:00, John wrote: I think you missed my point.  I don't need 'new developer' documentation for OOP.  What I can't understand is how the documentation system itself works, ie, how to go about using it to contribute documentation. * Download 'fpdoc.pdf' or 'fpdoc.ps' and read

Re: [fpc-pascal] State of FPC docs.rant

2010-04-27 Thread Graeme Geldenhuys
On 27 April 2010 04:39, Joseph Montanez jmonta...@gorilla3d.com wrote: Spent another hour making a pretty example, found out there was no CSS file generated, and made my own: http://www.gorilla3d.com/fpdoc/animal/tanimal.talk.html Nice. I reported the missing CSS file issue years ago. I

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

2010-04-27 Thread Florian Klaempfl
Jürgen Hestermann schrieb: There is a lot of ambigouity with dynamic arrays. There certainly is if you expect them to work like regular arrays. They are a quite different datatype. At least it should always mean the same independent from context. It does always mean the same, just like a

Re: [fpc-pascal] pointer magic

2010-04-27 Thread cobines
2010/4/27 spir ☣ denis.s...@gmail.com: -1- untyped pointer allocation In case of an untyped pointer, I read the compiler considers the target'size is 1 byte. There certainly is an operation to allocate memory for the target according to an existing piece of data. Something like    data :=

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

2010-04-27 Thread Doug Chamberlin
On 4/27/2010 2:04 AM, Jürgen Hestermann wrote: An identifier should always refer to a memory address/location. If the type of the data at that memory location is a pointer then it should be possible to change the expression to the memory address of the data by dereferencing it with ^. But for

[fpc-pascal] Question about Deleting elements in Dynamic Array

2010-04-27 Thread Bihar Anwar
Just say, I have a dynamic array with size=5, and I want to delete elements from the index 0 to 2. Is there a trick (the fastest way) to delete those elements (0 to 2) without moving activities? I've tried to make the dynamic array just pointing to 3rd element and set a new length for it, but

Re: [fpc-pascal] Question about Deleting elements in Dynamic Array

2010-04-27 Thread dmitry boyarintsev
On Tue, Apr 27, 2010 at 5:42 PM, Bihar Anwar bihar_an...@rocketmail.com wrote: Just say, I have a dynamic array with size=5, and I want to delete elements from the index 0 to 2. Is there a trick (the fastest way) to delete those elements (0 to 2) without moving activities? You won't do it

Re: [fpc-pascal] State of FPC docs.rant

2010-04-27 Thread Florian Klaempfl
David Emerson schrieb: I'm far more comfortable using git than svn, and if there was such a repo it would help lower the barrier to entry for me at least. I created a mercurial mirror: http://florianklaempfl.de:8000/fpcdocs/ ___ fpc-pascal maillist

[fpc-pascal] XML Iteration

2010-04-27 Thread Lee Jenkins
This isn't still true for latter version of FPC like 2.4.1, right? http://wiki.freepascal.org/XML_Tutorial#Printing_the_names_of_nodes A quick note on navigating the DOM tree: When you need to access nodes in sequence, it is best to use FirstChild and NextSibling properties (to iterate

Re: [fpc-pascal] fcl-passrc example program, and a couple of bugreports

2010-04-27 Thread Michael Van Canneyt
On Mon, 26 Apr 2010, Michalis Kamburelis wrote: All the talk about the Pascal parser in fcl-passrc got me interested recently. I did some experiments, and I thought I mention here: 1. I added a simplest example how to use fcl-passrc to the wiki: http://wiki.freepascal.org/fcl-passrc This

Re: [fpc-pascal] Question about Deleting elements in Dynamic Array

2010-04-27 Thread Henry Vermaak
On 27 April 2010 14:42, Bihar Anwar bihar_an...@rocketmail.com wrote: Just say, I have a dynamic array with size=5, and I want to delete elements from the index 0 to 2. Is there a trick (the fastest way) to delete those elements (0 to 2) without moving activities? I've tried to make the

Re: [fpc-pascal] State of FPC docs.rant

2010-04-27 Thread Michael Van Canneyt
On Sun, 25 Apr 2010, Joseph Montanez wrote: Okay, Since there hasn't been a clear response on this I've started my own website, to start documenting more of the use of each library. However doing so I am finding some clear issues, and that is some of these units are not finished all the way.

[fpc-pascal] How to convert ISO format string in FreePascal

2010-04-27 Thread Frank Church
I want to convert a time stamp in -mm-dd hh:mm:ss format to a TDatetime in FPC but can't find but haven't found a way yet. My attempt is based on the method here, https://forums.codegear.com/thread.jspa?threadID=16074, but StrToDateTime in FPC does not use the FormatSettings parameter.

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

2010-04-27 Thread Jürgen Hestermann
A file type is actually also a record and you cannot access the fields without an explict type cast. At least a file identifier always means the same memory address (where the record data is stored). If needed (for some special purpose) I *can* typecast it because I know the address of the

[fpc-pascal] What project management tool does FPC developers use?

2010-04-27 Thread Frank Church
What project management tool does FPC and Lazarus developers use? I mean besides mantis for bug tracking? I am thinking along the lines of JIRA, Redmine, Fogbugz etc. It is hard to get a view of what things are progressing or what needs doing, -- Frank Church ===

Re: [fpc-pascal] XML Iteration

2010-04-27 Thread Frank Church
I am glad to see someone with an interest in FPCs XML. Do you have some experience with XPath usage in PFC/Lazarus? On 27 April 2010 16:14, Lee Jenkins l...@datatrakpos.com wrote: This isn't still true for latter version of FPC like 2.4.1, right?

Re: [fpc-pascal] What project management tool does FPC developers use?

2010-04-27 Thread Jonas Maebe
On 27 Apr 2010, at 18:05, Frank Church wrote: What project management tool does FPC and Lazarus developers use? I mean besides mantis for bug tracking? I am thinking along the lines of JIRA, Redmine, Fogbugz etc. As far as FPC is concerned: none. It is hard to get a view of what things are

Re: [fpc-pascal] XML Iteration

2010-04-27 Thread Lee Jenkins
Frank Church wrote: I am glad to see someone with an interest in FPCs XML. Do you have some experience with XPath usage in PFC/Lazarus? No, other than some cursory google searches. I figured I'd be asking about that myself soon. -- Warm Regards, Lee

Re: [fpc-pascal] XML Iteration

2010-04-27 Thread Luiz Americo Pereira Camara
Frank Church escreveu: I am glad to see someone with an interest in FPCs XML. Do you have some experience with XPath usage in PFC/Lazarus? In this program: http://www.silvioprog.com.br/downloads/Cliente_SOAP_SAH.zip?attredirects=0d=1 you can find a simple usage of XPath + WST Luiz

[fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Anthony Walter
I was on freenode irc #fpc earlier and asked some questions but not enough people were online to get an answer. My question was/is: Will there ever again come a point where FPC attempts to bring in more compatibility with Delphi? Specifically, in regards to operator overloading and generic

Re: [fpc-pascal] XML Iteration

2010-04-27 Thread Frank Church
Thanks for the link. What is WST? My searches turn up something related to eclipse. On 27 April 2010 17:50, Luiz Americo Pereira Camara luiz...@oi.com.br wrote: Frank Church escreveu: I am glad to see someone with an interest in FPCs XML. Do you have some experience with XPath usage in

Re: [fpc-pascal] How to convert ISO format string in FreePascal

2010-04-27 Thread José Mejuto
Hello FPC-Pascal, Tuesday, April 27, 2010, 5:43:30 PM, you wrote: FC I switched to using the unixtime value which is also present in the FC records I am using, but it does not allow for Daylight Savings Time FC and is currently an hour behind. Is there some way the FreePascal FC libraries can

Re: [fpc-pascal] fcl-passrc example program, and a couple of bugreports

2010-04-27 Thread Sven Barth
Hi! On 27.04.2010 17:19, Michael Van Canneyt wrote: Also, program files are not parsed by fcl-passrc, it's limited to units for now. We would like to be able to eventually parse program files too. I am all for it. It should not be hard to handle this; It's like parsing an implementation

Re: [fpc-pascal] fcl-passrc example program, and a couple of bugreports

2010-04-27 Thread Michael Van Canneyt
On Tue, 27 Apr 2010, Sven Barth wrote: Hi! On 27.04.2010 17:19, Michael Van Canneyt wrote: Also, program files are not parsed by fcl-passrc, it's limited to units for now. We would like to be able to eventually parse program files too. I am all for it. It should not be hard to handle

Re: [fpc-pascal] Question about Deleting elements in Dynamic Array

2010-04-27 Thread Bihar Anwar
- Original Message From: Henry Vermaak henry.verm...@gmail.com To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org Sent: Tue, April 27, 2010 10:19:45 PM I think the right way to do this is: a := copy(a, 3, length(a) - 3); Presumably copy optimizes this adequately. Henry

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

2010-04-27 Thread Florian Klaempfl
Jürgen Hestermann schrieb: A file type is actually also a record and you cannot access the fields without an explict type cast. At least a file identifier always means the same memory address (where the record data is stored). If needed (for some special purpose) I *can* typecast it because

Re: [fpc-pascal] What project management tool does FPC developers use?

2010-04-27 Thread Florian Klaempfl
Frank Church schrieb: What project management tool does FPC and Lazarus developers use? I mean besides mantis for bug tracking? None, simply because we don't have any time budgets/resources but people are working as soon as they find time. I am thinking along the lines of JIRA, Redmine,

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Florian Klaempfl
Anthony Walter schrieb: I was on freenode irc #fpc earlier and asked some questions but not enough people were online to get an answer. My question was/is: Will there ever again come a point where FPC attempts to bring in more compatibility with Delphi? Nobody can predict if

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Anthony Walter
When I google search for FPC generics tohe top result links here: http://wiki.freepascal.org/Generics Two cases: 1) type generic TListT = class // ... as is now, the word generic is redundant 2) type TListT = class // ... better and in line with Delphi It seems both were on the suggested

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Florian Klaempfl
Anthony Walter schrieb: When I google search for FPC generics tohe top result links here: http://wiki.freepascal.org/Generics Two cases: 1) type generic TListT = class // ... as is now, the word generic is redundant 2) type TListT = class // ... better and in line with Delphi It

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Anthony Walter
Technical limitations aside, at this point what would be needed from the community to get the generic syntax changed? Supposing I had the soruce code changes to accommodate the change to remove the generic keyword, what would be needed from the community to approve moving that change into the

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Florian Klaempfl
Anthony Walter schrieb: Technical limitations aside, at this point what would be needed from the community to get the generic syntax changed? 1) Delphi mode only 2) not breaking old code i.e. accepting both variants 3) more Delphi generic compatibility Supposing I had the soruce code

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Graeme Geldenhuys
On 27 April 2010 20:14, Anthony Walter sys...@gmail.com wrote: 1) type generic TListT = class // ... as is now, the word generic is redundant 2) type TListT = class // ... better and in line with Delphi To be honest, this is a slightly unfair case, saying Free Pascal must become Delphi

Re: [fpc-pascal] XML Iteration

2010-04-27 Thread Luiz Americo Pereira Camara
Frank Church escreveu: Thanks for the link. What is WST? My searches turn up something related to eclipse. Web Services Toolkit: http://wiki.lazarus.freepascal.org/Web_Service_Toolkit Luiz ___ fpc-pascal maillist -

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Anthony Walter
Graeme: To be honest, this is a slightly unfair case, saying Free Pascal must become Delphi compatible, when Free Pascal had generics support *before* Delphi did. Maybe Delphi should become more Free Pascal compatible. I've preemptively disabled this argument so many times in the past. It's

Re: [fpc-pascal] How to convert ISO format string in FreePascal

2010-04-27 Thread Luiz Americo Pereira Camara
Frank Church escreveu: I want to convert a time stamp in -mm-dd hh:mm:ss format to a TDatetime in FPC but can't find but haven't found a way yet. A very simple function i use: function XMLDateTime2DateTime(const XMLDateTime: String): TDateTime; var DateOnly: String; TPos: Integer; begin

Re: [fpc-pascal] How to convert ISO format string in FreePascal

2010-04-27 Thread Graeme Geldenhuys
On 27 April 2010 17:43, Frank Church vfcli...@googlemail.com wrote: I want to convert a time stamp in -mm-dd hh:mm:ss format to a TDatetime in FPC but can't find but haven't found a way yet. I have written the following for the tiOPF project and us it in our company projects for all

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Florian Klaempfl
Anthony Walter schrieb: Graeme: To be honest, this is a slightly unfair case, saying Free Pascal must become Delphi compatible, when Free Pascal had generics support *before* Delphi did. Maybe Delphi should become more Free Pascal compatible. I've preemptively disabled this argument so

Re: [fpc-pascal] fcl-passrc example program, and a couple of bugreports

2010-04-27 Thread Marco van de Voort
In our previous episode, Michael Van Canneyt said: As soon as I get around to some bugfixing, I'll have a look at these. Shouldn't we create some testsuite for fcl-passrc? (or have a flag in the existing testsuite to exclude tests from fcl-passrc or real compiler tests or so?)

Re: [fpc-pascal] XML Iteration

2010-04-27 Thread Marco van de Voort
In our previous episode, Lee Jenkins said: This isn't still true for latter version of FPC like 2.4.1, right? http://wiki.freepascal.org/XML_Tutorial#Printing_the_names_of_nodes A quick note on navigating the DOM tree: When you need to access nodes in sequence, it is best to use

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Marco van de Voort
In our previous episode, Anthony Walter said: Technical limitations aside, at this point what would be needed from the community to get the generic syntax changed? Patches. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] How to convert ISO format string in FreePascal

2010-04-27 Thread Marco van de Voort
In our previous episode, Frank Church said: attempt is based on the method here, https://forums.codegear.com/thread.jspa?threadID=16074, but StrToDateTime in FPC does not use the FormatSettings parameter. Datetime handling has been rewritten since 2.4.0, and this is already merged back to

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Anthony Walter
Technical limitations aside, at this point what would be needed from the community to get the generic syntax changed?: : Patches. I believe there would first need to be some sort ofg consensus within the community about the changing the syntax. ___

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread Felipe Monteiro de Carvalho
On Tue, Apr 27, 2010 at 10:18 PM, Anthony Walter sys...@gmail.com wrote: I believe there would first need to be some sort ofg consensus within the community about the changing the syntax. If both syntaxes are supported I don't think many people will be against it. -- Felipe Monteiro de

Re: [fpc-pascal] What project management tool does FPC developers use?

2010-04-27 Thread Vincent Snijders
Florian Klaempfl schreef: Frank Church schrieb: What project management tool does FPC and Lazarus developers use? I mean besides mantis for bug tracking? None, simply because we don't have any time budgets/resources but people are working as soon as they find time. I am thinking along the

Re: [fpc-pascal] Question about Deleting elements in Dynamic Array

2010-04-27 Thread Henry Vermaak
On 27 April 2010 18:34, Bihar Anwar bihar_an...@rocketmail.com wrote: Would Move() be faster, instead of Copy()? I guess so, have you tried to benchmark? If you really need speed, why don't you allocate the memory directly? Henry ___ fpc-pascal

Re: [fpc-pascal] Question about Deleting elements in Dynamic Array

2010-04-27 Thread Bihar Anwar
Ok, I'll try to observe the compiled code using debugger and benchmark it if needed. BTW, what do you mean by allocating memory directly? Is there another way to allocate memory for dynamic array besides using SetLength()? - Original Message From: Henry Vermaak

Re: [fpc-pascal] Question about Deleting elements in Dynamic Array

2010-04-27 Thread dmitry boyarintsev
On Wed, Apr 28, 2010 at 7:24 AM, Bihar Anwar bihar_an...@rocketmail.com wrote: Ok, I'll try to observe the compiled code using debugger and benchmark it if needed. BTW, what do you mean by allocating memory directly? Is there another way to allocate memory for dynamic array besides using

Re: [fpc-pascal] Question about Deleting elements in Dynamic Array

2010-04-27 Thread Bihar Anwar
I've tried to use Move() instead of Copy(). Any objection with the following code? var a: array of string; SetLength(a, 5); a[0] := 'aa'; a[1] := 'bb'; a[2] := 'cc'; a[3] := 'dd'; a[4] := 'ee'; System.Move(a[3], a[0], 2 * SizeOf(string) );// instead of a := Copy(a, 3, 2); SetLength(a,

Re: [fpc-pascal] type constraints in generics?

2010-04-27 Thread leledumbo
I would like to limit the actual type in this list to be a child class of TObject. Is this possible and if yes, how can it be done? I don't think it's currently supported. It will be, if someone is willing to do it. In a more general question, what are the differences between the FPC

Re: [fpc-pascal] Bridging FPC and Delphi

2010-04-27 Thread leledumbo
Question: who wants to add it? Felipe Monteiro de Carvalho wrote: On Tue, Apr 27, 2010 at 10:18 PM, Anthony Walter sys...@gmail.com wrote: I believe there would first need to be some sort ofg consensus within the community about the changing the syntax. If both syntaxes are supported I

Re: [fpc-pascal] pointer magic

2010-04-27 Thread Thierry Coq
... In addition, when starting to use Pascal, don't use pointers, and don't invent linked lists, it's been done so many times. Go look up the source code in contnrs.pp to understand lists and containers already available in FPC. Most programming can be done without untyped pointers. Best