- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
function GetNumber(TempStr, What: string): Integer;
var
Index,
NumberLen: Integer;
begin
Result := 0;
What := LowerCase(What);
Index := Pos(What, TempStr)+Length(What);
if (Index = 0) then begin
ShowMessage('Invalid Item: "'+What+'" is not in "'+TempStr+'"');
Exit;
end;
NumberLen := 1;
if TempStr[Index+1] in ['0'..'9'] then begin
NumberLen := 2;
if TempStr[Index+2] in ['0'..'9'] then begin
NumberLen := 3;
if TempStr[Index+3] in ['0'..'9'] then begin
NumberLen := 4;
if TempStr[Index+4] in ['0'..'9'] then NumberLen := 5;
end;
end;
end;
Result := StrToInt(Trim(Copy(TempStr, Index, NumberLen)));
end;
Комментарии (0) RSS
Добавить комментарий