procedure GetValue(InStr: String); var i ,iPos: Integer; tempStr : String; str : array[0..100] of String; begin tempStr := InStr; for i := 1 to Length(InStr) do begin str[i] := Copy(tempStr,1,1); iPos := Pos(';',tempStr); str[i] := Copy(tempStr,1,1); if iPos > 0 then Delete(tempStr,1,iPos) else Break; endend;
先
str1:='1';
strTemp:='2;3;a;b;c'然后
str2:='2'
strTemp:='3;a;b;c'
如此循环...
var
i ,iPos: Integer;
tempStr : String;
str : array[0..100] of String;
begin
tempStr := InStr;
for i := 1 to Length(InStr) do
begin
str[i] := Copy(tempStr,1,1);
iPos := Pos(';',tempStr);
str[i] := Copy(tempStr,1,1);
if iPos > 0 then
Delete(tempStr,1,iPos)
else
Break;
endend;