Re: [fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-11 Thread Felipe Monteiro de Carvalho
On Tue, Jun 11, 2013 at 5:29 PM, m...@rpzdesign.com wrote: > I totally understand, but I did not discover the problem until > I was well into a larger project that I could not de-construct > to try to generate a reproducible sample. > > I am under a time pressure, decided to start using using LA

Re: [fpc-pascal] Inherited and not virtual/overridden procedures

2013-06-11 Thread Jonas Maebe
On 12 Jun 2013, at 00:12, Bart wrote: > var > FooChild: TFooChild; > > begin > FooChild := TFooChild.Create; > FooChild.Bar; > FooChild.Free; > end. > > To my surprise this compiles without any warning or error. > It outputs: > C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test > TFoo.Bar

[fpc-pascal] Inherited and not virtual/overridden procedures

2013-06-11 Thread Bart
Hi, I thought that if I had a subclass that inherited form a parentclass, and both have a method with the same name (Bar), then the method of the subclass hid the method of the parentclass, and you could not call inherited Bar in the subclass. More specifically I was under the impression that you

Re: [fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-11 Thread m...@rpzdesign.com
I totally understand, but I did not discover the problem until I was well into a larger project that I could not de-construct to try to generate a reproducible sample. I am under a time pressure, decided to start using using LAZ/FPC about 3 months ago, and when I

Re: [fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-11 Thread Antonio Fortuny
Hi Folks. I don't know how Jeppe is playing around but because I want to make sure FPC works preoperly I decided to take some time to see what happens Yhis is the code snippet I use in Win32 and Linux x86_64 All are Lazaur 1.0.8 Put the code under a TBut

Re: [fpc-pascal] is there a ready to use FPC Cross compiler x86-Linux -> MIPS-linux?

2013-06-11 Thread Dennis Poon
Jonas, Thanks for the guidance. Where is cpumips defined? Also, I could not use the $fpctarget variable, I had to use the exact file path to avoid some complains in lazarus. #include /etc/fpc.cfg #ifdef cpumips -Fu/home/dennis/fpc/$fpcversion/units/$fpctarget -Fu/home/dennis/fpc/$fpcversion/uni

Re: [fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-11 Thread m...@rpzdesign.com
Oops, those parameters for Posex were backwards: res := PosEx('NEEDLE',mypchar,35) ; On 6/11/2013 7:10 AM, m...@rpzdesign.com wrote: To Marco and Jeppe: As for 2 examples: res := PosEx(mypchar,'NEEDLE',35) ; res := Copy (mypchar, 10,15) ; What are the byte boundaries here? Zero Based from t

Re: [fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-11 Thread Marco van de Voort
In our previous episode, m...@rpzdesign.com said: > As for 2 examples: > > res := PosEx(mypchar,'NEEDLE',35) ; > > res := Copy (mypchar, 10,15) ; These are not examples. These are snippets. Examples I can compile and debug. > What are the byte boundaries here? > Zero Based from the pointer?

Re: [fpc-pascal] Some RTL functions cry big tears when mixing Pchar and Ansistring/String

2013-06-11 Thread m...@rpzdesign.com
To Marco and Jeppe: As for 2 examples: res := PosEx(mypchar,'NEEDLE',35) ; res := Copy (mypchar, 10,15) ; What are the byte boundaries here? Zero Based from the pointer? 1 Based from the pointer? As far as behavior, it would throw the program in unstable land over time and gdb would show wor