InstallShield数据类型List-(数组)

InstallShield的脚本InstallScript中没有数组,可以用List来实现。以下是List的一个实例:

function testList()

STRING svString;
LIST myList;
INT nResult;

begin
    //create a list
      myList=ListCreate(STRINGLIST);// orelse a NUMBERLIST

    //error check
    if (myList=LIST_NULL) then
       MessageBox("ListCreate error ",SEVERE);
       abort;
    endif;
   
    //List add string
     svString = "string1";
     if (ListAddString(myList,svString,AFTER)<0) then
        MessageBox("ListAddString error ",INFORMATION);
        abort;
     endif;
    
     svString = "string2";
     if (ListAddString(myList,svString,AFTER)<0) then
        MessageBox("ListAddString error ",INFORMATION);
        abort;
     endif;

     //read myList from first Item
     nResult=ListGetFirstString(myList,svString);

      //Loop all items
      while(nResult != END_OF_LIST)
         MessageBox(svString,INFORMATION);
         //find the next item
         nResult=ListGetNextString(myList,svString);
      endwhile;

      //destrpy myList
      ListDestroy(myList);

end;

 

你可能感兴趣的:(InstallShield数据类型List-(数组))