, . - ( ):
procedure ParseLine(const aLine: RawByteString; var aInstrument: string; var
aLane, aTileNo, aX, aY: Integer; var aMultiplexID: Ansistring; var aPair:
Byte);
var
arrayIndex: Integer;
index: Integer;
lineLength: Integer;
NumList: array[0..3] of Integer;
I: Integer;
multiEnd: Integer;
begin
lineLength := Length(aLine);
index := Pos(':', aLine);
SetLength(aInstrument, index - 2);
for I := 2 to index - 1 do
aInstrument[I-1] := Char(aLine[I]);
arrayIndex := 0;
FillMemory(@NumList, SizeOf(NumList), 0);
while (index < lineLength) and (arrayIndex < 4) do
begin
Inc(index);
if (aLine[index] = ':') or (aLine[index] = '#') then
Inc(arrayIndex)
else
NumList[arrayIndex] := NumList[arrayIndex] * 10 + Ord(aLine[index]) - Ord('0');
end;
aLane := NumList[0];
aTileNo := NumList[1];
aX := NumList[2];
aY := NumList[3];
multiEnd := Pos('/', aLine, index);
SetLength(aMultiplexID, multiEnd - index - 1);
Inc(index);
for I := index to multiEnd - 1 do
aMultiplexID[I-index+1] := aLine[I];
if (multiEnd+1 < lineLength) then
aPair := Ord(aLine[multiEnd+1]) - Ord('0')
else
aPair := 0;
end;
, . , . , , , . . , , , , , . . , .