Einzelnen Beitrag anzeigen

Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.685 Beiträge
 
Delphi 11 Alexandria
 
#1

c# sruct mit string inhalt nach delphi

  Alt 11. Jan 2022, 11:27
ich zerbreche mir gerade den kopf wie man so etwas nach delphi bringt
Delphi-Quellcode:
static struct foobar foobar[]=
{
    {"string0",0}
,
    {"string11 ",11},
    };
mein erster versuch sah so aus (weil dort static steht nahm ich const) aber ist wohl falsch da es ein record sein müsste
Delphi-Quellcode:
const
  foobar : array[0..11] of String = (
    'string0', // 0
    '', // 1
    '', // 2
    '', // 3
    '', // 4
    '', // 5
    '', // 6
    '', // 7
    '', // 8
    '', // 9
    '', // 10
    'string11//11
    );
und es als record umzuwandeln da scheitere ich an der zuweisung des string inhalts
Delphi-Quellcode:
type
  foobar = record
    foobar : record
      case integer of
         0: (string);
        11: (string);
    end;
  end;
Hat jemand einen Rat?
Gruß vom KodeZwerg
  Mit Zitat antworten Zitat