Re: [fpc-pascal] Type helper for array

2016-06-09 Thread Jürgen Hestermann
Am 2016-06-09 um 20:18 schrieb Sven Barth: > Am 09.06.2016 17:57 schrieb "Vojtech Cihák" : > > aBuffer.Clear; > > Is it possible to do this without helper? > > You can always set the array to Nil IMO SetLength(aBuffer,0) would the most natural way to clear the array.

Re: [fpc-pascal] Type helper for array

2016-06-09 Thread Sven Barth
Am 09.06.2016 17:57 schrieb "Vojtěch Čihák" : > > Hello, > > I've got following declaration: > ... > {$modeswitch typehelpers} > > interface > > uses > Classes, SysUtils; > > type > TBuffer = array of Single; > > { TBufferHelper } > TBufferHelper = type helper for

[fpc-pascal] Type helper for array

2016-06-09 Thread Vojtěch Čihák
Hello,   I've got following declaration: ... {$modeswitch typehelpers}   interface   uses   Classes, SysUtils;   type   TBuffer = array of Single;     { TBufferHelper }   TBufferHelper = type helper for TBuffer     procedure Clear;   end; ... var aBuffer: TBuffer; ... And I can do: aBuffer[3]:=5;

Re: [fpc-pascal] Incompatible types: got "SYSTEM.PChar" expected "SYSTEM.PChar"

2016-06-09 Thread Sven Barth
Am 09.06.2016 14:30 schrieb "José Mejuto" : > > El 09/06/2016 a las 8:04, Sven Barth escribió: > >>> {$DEFINE THISDONTCOMPILE} >>> TConstRecord: TFirstRecord = ( >>> {$IFDEF THISDONTCOMPILE} >>> Ident: TSomePcharArray[1] >>> {$ELSE} >>> Ident: @TSomePcharArray[1]

Re: [fpc-pascal] Incompatible types: got "SYSTEM.PChar" expected "SYSTEM.PChar"

2016-06-09 Thread José Mejuto
El 09/06/2016 a las 8:04, Sven Barth escribió: {$DEFINE THISDONTCOMPILE} TConstRecord: TFirstRecord = ( {$IFDEF THISDONTCOMPILE} Ident: TSomePcharArray[1] {$ELSE} Ident: @TSomePcharArray[1] {$ENDIF} ); One can only use untyped constants to initialize other constants or

Re: [fpc-pascal] Bls: Writing fpWeb app without Lazarus

2016-06-09 Thread leledumbo
> On > http://www.freepascal.org/~michael/articles/ > you can find some articles that explain the workings of fcl-web. > See web1, web2. WOW! You never said you did document for many things we don't know how to use properly yet. Must be put somewhere everyone else can see, Lazarus wiki would be

Re: [fpc-pascal] Incompatible types: got "SYSTEM.PChar" expected "SYSTEM.PChar"

2016-06-09 Thread Sven Barth
Am 09.06.2016 00:05 schrieb "José Mejuto" : > --- > program testpossiblebug; > > type > TFirstRecord=record > Ident: pchar; > end; > > const > TSomePcharArray: array [0..1] of pchar = ( 'pcharONE','pcharTWO'); > > {$DEFINE THISDONTCOMPILE} > >