Delphi 7 * Const Record Initialization by Sean P. Dollard


Tips

Delphi Const Record Initialization

type
  TRFIDHardwareType = (
    rhwUnknown,
    rhwAPROMIX,
    rhwPRIORITY_RWE232,
    rhwAllflex,
    rhwXRPEIDReader,
    rhwAgridentAPR500,
    rhwCTStickReader,
    rhwAgridentABR200,
    rhwKD_Pi60
    );
	
  TComSettings = record
    Baudrate: Integer;
    Databits: Integer;
    Stopbits: Integer;
    Parity: string;
  end;

  TRfidInput = record
    AllowTest: Boolean;
    Description: string;
    ComSettings: TComSettings;
  end;

const // var
  RfidInput: Array[TRFIDHardwareType] of TRfidInput =
    (
     (AllowTest:False;
	  Description:'';
	  ComSettings:(Baudrate:9600;Databits:8;Stopbits:1;Parity:'None')),
     (AllowTest:True;
	  Description:'APROMIX';
	  ComSettings:(Baudrate:9600;Databits:8;Stopbits:1;Parity:'None')),
     (AllowTest:True;
	  Description:'Priority 1';
	  ComSettings:(Baudrate:9600;Databits:8;Stopbits:1;Parity:'None')),
     (AllowTest:False;
	  Description:'ALLFLEX';
	  ComSettings:(Baudrate:9600;Databits:8;Stopbits:1;Parity:'None')),
     (AllowTest:True;
	  Description:'XRP EID Reader';
	  ComSettings:(Baudrate:9600;Databits:8;Stopbits:1;Parity:'None')),
     (AllowTest:False;
	  Description:'Agrident APR 500';
	  ComSettings:(Baudrate:9600;Databits:8;Stopbits:1;Parity:'None')),
     (AllowTest:False;
	  Description:'CT Stick Reader';
	  ComSettings:(Baudrate:9600;Databits:8;Stopbits:1;Parity:'None')),
     (AllowTest:True;
	  Description:'Agrident ABR 200';
	  ComSettings:(Baudrate:9600;Databits:8;Stopbits:1;Parity:'None')),
     (AllowTest:False;
	  Description:'KINGDOES Pi60';
	  ComSettings:(Baudrate:9600;Databits:8;Stopbits:1;Parity:'None'))