Gt, dann halt extra für sich noch 'ne Variante und für Dax einen schönen Funktionsnamen
Delphi-Quellcode:
Procedure ChangeByteorder(Var S: WideString); Overload;
Var i: Integer;
Begin
For i := 1 to Length(S) do
S[i] := WideChar(Swap(Word(S[i])));
End;
Procedure ChangeByteorder(Var S: UnicodeString); Overload;
Var i: Integer;
Begin
For i := 1 to Length(S) do
S[i] := WideChar(Swap(Word(S[i])));
End;
Procedure ChangeByteorder(P: PWideChar; Len: Integer); Overload;
Var i: Integer;
Begin
For i := 0 to Len - 1 do
P[i] := WideChar(Swap(Word(P[i])));
End;