[fpc-pascal] Array slices

2007-11-11 Thread Christos Chryssochoidis
Hello all, A while ago in one of the FPC lists I had read that FPC 2.2.0 supports array slices. So I made a program to test this feature: program Test_Slices; procedure Test(C : array of Integer); begin end; var A : array of Integer; B : array of Integer; begin setLengt

Re: [fpc-pascal] Bugs in 2.1.4 ?

2007-06-01 Thread Christos Chryssochoidis
Certainly the first one was a silly mistake of mine. The function was a method and the variable was a class field. As for the second I'm not so certain. It really gave me errors when I compiled it at first. As I have deleted this fragment now, I can't check wether It had any { } inside it, bu

[fpc-pascal] Bugs in 2.1.4 ?

2007-06-01 Thread Christos Chryssochoidis
I'm not sure if the following are bugs of 2.1.4: 1) A variable used in the body of a function that I defined, while it is not defined in the function's var part, the file compiles successfully. 2) The compiler reports error when a code fragment is commented out with { }, while if I remov

Re: [fpc-pascal] Constant members within class

2007-06-01 Thread Christos Chryssochoidis
On 5/31/07, Matt Emson <[EMAIL PROTECTED]> wrote: >taclass = class > fi:integer; > public > property i write fi; > end; Not to pick on little details, but shouldn't that be: property i: interger read fi; as the OP wanted a read only member? What you gave them was write on

Re: [fpc-pascal] Constant members within class

2007-05-30 Thread Christos Chryssochoidis
Thanks a lot for the prompt response. I 'm a total novice in Object Pascal. I will have a look to the classes' properties… Marco van de Voort wrote: Is there a way to define const members for a class, as for example in TClass = class public const i : integer;// and hopping to b

[fpc-pascal] Constant members within class

2007-05-30 Thread Christos Chryssochoidis
Hi, Is there a way to define const members for a class, as for example in TClass = class public const i : integer;// and hopping to be able to set it within the constructor… end; ? Thank you in advance ___ fpc-pasc

Re: [fpc-pascal] Dynamic array as return type of functions

2007-05-24 Thread Christos Chryssochoidis
On 23 Μαϊ 2007, at 3:05 ΜΜ, Tom Verhoeff wrote: On Wed, May 23, 2007 at 11:36:20AM +0300, Christos Chryssochoidis wrote: It *is* allowed. The only trick is that you have to declare a type for your dynamic array, i.e. you have to write something like Yes, I have noticed that if you

Re: [fpc-pascal] Dynamic array as return type of functions

2007-05-23 Thread Christos Chryssochoidis
On 23 Μαϊ 2007, at 11:11 ΠΜ, Daniël Mantione wrote: Op Wed, 23 May 2007, schreef Michalis Kamburelis: Christos Chryssochoidis wrote: Hi, I tried to write some function that returned a dynamic array, and realized that this isn't allowed. Why? After all one can specify an array of var

[fpc-pascal] Dynamic array as return type of functions

2007-05-23 Thread Christos Chryssochoidis
er, and so there wouldn't be any runtime overhead for returning a dynamic array from a function. Thanks, Christos Chryssochoidis ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] fpc 2.1.4 Intel Mac installation

2007-05-22 Thread Christos Chryssochoidis
Jonas Maebe wrote: On 21 mei 2007, at 22:58, Christos Chryssochoidis wrote: I downloaded the new FPC version, 2.1.4, for the Intel Mac platform to try it. When I try to install it the installer refuses to proceed, saying that "this package contains only Intel binaries which cannot be

[fpc-pascal] fpc 2.1.4 Intel Mac installation

2007-05-21 Thread Christos Chryssochoidis
Hi, I downloaded the new FPC version, 2.1.4, for the Intel Mac platform to try it. When I try to install it the installer refuses to proceed, saying that "this package contains only Intel binaries which cannot be used on a PowerPC-based Macintosh. Install the PowerPC version of FPC instea

[fpc-pascal] Re: Widestrings length and character iteration

2007-05-10 Thread Christos Chryssochoidis
Daniël Mantione wrote: > > Op Wed, 9 May 2007, schreef Christos Chryssochoidis: > >> OK, I figured out what happened. The source file was saved in UTF-8 encoding, >> but I hadn't put in my source file the compiler directive {$CODEPAGE UTF8}. >> After inc

[fpc-pascal] Re: Widestrings length and character iteration

2007-05-09 Thread Christos Chryssochoidis
Daniël Mantione wrote: > > Op Mon, 7 May 2007, schreef Christos Chryssochoidis: > >> Daniël Mantione wrote: >>> Not possible, a widestring is UCS-2/UTF-16. >> I defined a widestring with 7 characters (code points), and the length() >> function returned t

[fpc-pascal] Re: Widestrings length and character iteration

2007-05-08 Thread Christos Chryssochoidis
Daniël Mantione wrote: > > Op Mon, 7 May 2007, schreef Christos Chryssochoidis: > >> Hi, >> >> Are there any rtl functions to compute the length (in characters) of a >> widestring and to iterate over its characters? > > If you treat it as UCS-2: length(

[fpc-pascal] Widestrings length and character iteration

2007-05-07 Thread Christos Chryssochoidis
Hi, Are there any rtl functions to compute the length (in characters) of a widestring and to iterate over its characters? In my system (Mac OS X/fpc 2.1.3), a widestring is implemented as a UTF-8 encoded string, as I found out. Thanks ___ fpc-pas