InstallScript 中数组的使用

很遗憾InstallScript中没有数组(至少我没找到)。

但是别灰心它拥有LIST。

LIST是一组针对链表的操作集合,包含很多方法。

一下是一个读取的简单例子。

环境:WinXp InstallShield2009(InstallScript版)

(由于是手敲的所以可能会有错误,恭请指正)

例子 以外InstallScript还提供了一系列关于List的操作函数,可以加以活用。

function USELIST()

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 ",SERVER);

            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);

 打完收工。。。。。

原文地址:https://www.cnblogs.com/fjfjfjfjfjfj/p/1428793.html