Re: [fpc-pascal] how to simulate abstract properties

2009-08-16 Thread Jonas Maebe
On 16 Aug 2009, at 04:37, Marc Santhoff wrote: What I want is to ensure not forgetting to override any method. The compiler should stop on error when this happens. How can this be done? (I know the compiler does emit a warning, but switching to "stop on warning" is o option for me.) Seems li

[fpc-pascal] Byte array manipulation

2009-08-16 Thread Wimpie Nortje
Hi all, I have a lot of byte arrays which contains mostly text but also #0. I am looking for functions to manipulate these arrays. The stuff in strutils are mainly what I need but they operate on strings which is not usable to me due to the #0. Are there any such functions in FPC? And whil

Re: [fpc-pascal] how to simulate abstract properties

2009-08-16 Thread Marc Santhoff
Am Sonntag, den 16.08.2009, 12:00 +0200 schrieb Jonas Maebe: > On 16 Aug 2009, at 04:37, Marc Santhoff wrote: > > > What I want is to ensure not forgetting to override any method. The > > compiler should stop on error when this happens. > > How can this be done? > > > > (I know the compiler does e

Re: [fpc-pascal] how to simulate abstract properties

2009-08-16 Thread Jonas Maebe
On 16 Aug 2009, at 19:58, Marc Santhoff wrote: Am Sonntag, den 16.08.2009, 12:00 +0200 schrieb Jonas Maebe: Seems like there is a practical use-case for http://bugs.freepascal.org/view.php?id=13957 after all :) Do I understand correctly that this patch allow me to remap the warning

Re: [fpc-pascal] how to simulate abstract properties

2009-08-16 Thread Marc Santhoff
Am Sonntag, den 16.08.2009, 20:05 +0200 schrieb Jonas Maebe: > On 16 Aug 2009, at 19:58, Marc Santhoff wrote: > > > Am Sonntag, den 16.08.2009, 12:00 +0200 schrieb Jonas Maebe: > >> > > > >> Seems like there is a practical use-case for > >> http://bugs.freepascal.org/view.php?id=13957 > >> after

Re: [fpc-pascal] Byte array manipulation

2009-08-16 Thread theo
AnsiString does not have problems with #0. Test: var aStr:AnsiString; begin aStr:='test-test-test'; aStr:=StringReplace(aStr,'-',#0,[rfReplaceAll]); //if you ouput now, you'll only see 'test'... aStr:=StringReplace(aStr,#0,'-',[rfReplaceAll]); //...but the text is still in the String; Edit1.text

Re: [fpc-pascal] Byte array manipulation

2009-08-16 Thread Wimpie Nortje
theo wrote: AnsiString does not have problems with #0. Test: var aStr:AnsiString; begin aStr:='test-test-test'; aStr:=StringReplace(aStr,'-',#0,[rfReplaceAll]); //if you ouput now, you'll only see 'test'... aStr:=StringReplace(aStr,#0,'-',[rfReplaceAll]); //...but the text is still in the Strin

Re: [fpc-pascal] Byte array manipulation

2009-08-16 Thread Andrew Brunner
Hi there, I have a ByteArray unit that's pretty extensive. function toString(Var Item:TByteArray):string var iLen:Integer; begin iLen:=System.Length(Item); SetLength(Result,iLen); if iLen>0 then System.Move(Item[0],Result[1],iLen); end; On Sun, Aug 16, 2009 at 12:35 PM, Wimpie Nortje