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] >>> {$ENDIF} >>>

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 varia

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

2016-06-08 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} > > TConstRecord: TFirstRec

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

2016-06-08 Thread José Mejuto
Hello, I have a lot of constant strings and some array of records that should be initialized in one field with one of this entries, so I found two solutions, one is create a symbol for each string, something like: const TMyStringSymbol='String one'; But also I need to be able to enumerate