Re: [fpc-pascal] a few trivial questions

2010-05-12 Thread spir ☣
On Wed, 12 May 2010 16:45:47 +0200 (CEST) Michael Van Canneyt wrote: > > > On Wed, 12 May 2010, spir ☣ wrote: > > > Hello, > > > > * TFPList > > Is there another way to traverse a list than > >for i :=0 to (list.count - 1) do ... > > You can use an enumerator with the latest SVN: > > for

Re: [fpc-pascal] a few trivial questions

2010-05-12 Thread spir ☣
On Wed, 12 May 2010 17:19:57 +0200 Graeme Geldenhuys wrote: > 2010/5/12 spir ☣: > > > > * TFPList > > Is there another way to traverse a list than > >    for i :=0 to (list.count - 1) do ... > > What about list.high? > > Yes, I use the Iterator design pattern. This allows me to write code as >

Re: [fpc-pascal] a few trivial questions

2010-05-12 Thread Lee Jenkins
Michael Van Canneyt wrote: On Wed, 12 May 2010, spir ☣ wrote: Hello, * TFPList Is there another way to traverse a list than for i :=0 to (list.count - 1) do ... You can use an enumerator with the latest SVN: foreach P in List do That's good news. I wasn't aware that that had been i

Re: [fpc-pascal] a few trivial questions

2010-05-12 Thread Graeme Geldenhuys
2010/5/12 spir ☣: > > * TFPList > Is there another way to traverse a list than >    for i :=0 to (list.count - 1) do ... > What about list.high? Yes, I use the Iterator design pattern. This allows me to write code as follows: --- var itr: ITBStringIterator; begin ... itr := gIte

Re: [fpc-pascal] a few trivial questions

2010-05-12 Thread Michael Van Canneyt
On Wed, 12 May 2010, spir ☣ wrote: Hello, * TFPList Is there another way to traverse a list than for i :=0 to (list.count - 1) do ... You can use an enumerator with the latest SVN: foreach P in List do What about list.high? Count=High. Also, is it possible to set a list's base ind

[fpc-pascal] a few trivial questions

2010-05-12 Thread spir ☣
Hello, * TFPList Is there another way to traverse a list than for i :=0 to (list.count - 1) do ... What about list.high? Also, is it possible to set a list's base index to 1 (so that last_index=count)? There is a super handy forEachCall method (calling a proc for each item), but I cannot find

Re: [fpc-pascal] Does FPC has consts of portable OS error codes?

2010-05-12 Thread Bihar Anwar
leledumbo onMay 12, 2010 3:58:09 PM > Any reason for that? or it is not implemented yet? > For the first one, usually errors in FPCgenerate exception, you can handle > that instead. Yes, as you said "usually", it is not "always". For example, FindFirst() and FindNext return OS dependent error

Re: [fpc-pascal] Does FPC has consts of portable OS error codes?

2010-05-12 Thread leledumbo
> Any reason for that? or it is not implemented yet? For me: it's not required. The purpose of error code is to provide information so we can handle it correctly, or at the simplest case, to display to user what has happened. For the first one, usually errors in FPC generate exception, you can ha

Re: [fpc-pascal] Does FPC has consts of portable OS error codes?

2010-05-12 Thread Marco van de Voort
In our previous episode, Bihar Anwar said: > On 12 May 2010, at 05:53, Bihar Anwar wrote: > > >> As the title says. :-) > > > No, it doesn't. > > Any reason for that? or it is not implemented yet? FPC does not support abstraction of operating system errorcodes, and doesn't plan to. The experie

Re: [fpc-pascal] Does FPC has consts of portable OS error codes?

2010-05-12 Thread Bihar Anwar
Jonas Maebe on May 12, 2010 2:32:18 PM On 12 May 2010, at 05:53, Bihar Anwar wrote: >> As the title says. :-) > No, it doesn't. Any reason for that? or it is not implemented yet? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org ht

Re: [fpc-pascal] Does FPC has consts of portable OS error codes?

2010-05-12 Thread Jonas Maebe
On 12 May 2010, at 05:53, Bihar Anwar wrote: As the title says. :-) No, it doesn't. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Does FPC has consts of portable OS error codes?

2010-05-12 Thread Tomas Hajny
On Wed, May 12, 2010 07:37, Bihar Anwar wrote: > Something like this one: > https://libxpl.arsoft.homeip.net/browser/trunk/errormap/xplErrorMap.cpp?rev=70 I don't think we have platform independent (named) constants defined, but as you probably know, common error code _values_ are defined for our