如何在Inno Setup中迭代MULTI_SZ字符串?

时间:2011-09-06 16:30:25

标签: scripting inno-setup pascal

如何在Inno Setup Pascal脚本中迭代MULTI_SZ字符串? 例如超过RegQueryMultiStringValue

返回的值

1 个答案:

答案 0 :(得分:3)

以下是执行此操作的代码:

var
  I,StartPos:Integer;
  MultiSzStr,Element:String;

...

  StartPos := 1;
  for I:= 1 to Length(MultiSzStr) do
  begin
    if MultiSzStr[I] = #0 then
    begin
      Element := Copy(MultiSzStr, StartPos, I - StartPos);
      { do something with the element }
      StartPos := I + 1;
    end;
  end;