Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.755 Beiträge
 
Delphi 10.4 Sydney
 
#1

Funktion Parameter zuweisen (Array of Byte)

  Alt 14. Sep 2006, 13:37
Ich habe folgende Typdeklaration:

Delphi-Quellcode:
types

  RLInformation = record
     case boolean of
       true : (rawSet : Array [0..7] of Byte);
       false: ( RNCID: Array [0..1] of Byte;
                CellID: Array [0..1] of Byte;
                BTSNumber: Array [0..1] of Byte;
                CPICHEc_N0: Byte;
                HSDPAIndicator: Byte;
              )
  end;


Damit mappe ich ein Array auf verschieden kleine Arrays.

Nun will ich mit folgender Funktion z.B die CellID bekommen.
Also übergebe ich der Funktion ein Array of Byte und will
sie Funktionsintern der Variable RLInfo.rawSet (ist auch ein Array of Byte).
Delphi-Quellcode:
function getCellID(RLData: Array of Byte):Word;
var
  RLInfo: RLInformation;
// i:Byte;
begin
// for i:=0 to High(RLData) do
// RLInfo.rawSet[i]:= RLData[i];
  RLInfo.rawSet:=RLData; //<----------incompatible types
  result:= StrToInt('$'+IntToHex(RLInfo.cellID[0],2)+IntToHex(RLInfo.cellID[1],2));
  if result = High(Word) then
    result := 0;
end;
Nur mosert Delphi da.
Wenn ich die Wert einzeln übergebe klappt das.
Ist mir aber zu Zeitintensiv.

Weiß jemand aus dem Forum Rat?

Grüße und Danke
Klaus
Klaus
  Mit Zitat antworten Zitat