Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Installscript Arrays


2 replies to this topic

Steve Rauda

Steve Rauda
  • Members
  • 2 posts

Posted 21 April 2001 - 20:33

Anyone know if it is possible to declare an array variable in installscript?  If so, can you show me some syntax.  I do not seem to see this functionality in the documentation.

Dave I

Dave I
  • Members
  • 195 posts

Posted 24 April 2001 - 15:53

Steve,
         There is a function in installscript called "Resize."  ISWI recognises the command but there is no help on it for some strange reason.  I found it in "Bob Baker's WI Developers guide" p.547.

Here is the example given in the book:

function Foo()

INT nArray();   //Note no initial size give to array

begin

//Size the array to hold 3 values
Resize(nArray, 3);

nArray(0) = 0;
nArray(1) = 1;
nArray(2) = 2;


//display "Value=1"
SprintfBox(INFORMATION, "Script Test", "Value=%d", nArray(1));
end;

"Resize" I presume supports all the basic data types and structures, 2D arrays are not supported i.e. nArray(1)(2);

And be careful not to make your array smaller than your data or you'll lose some (obviously.)

Hope this helps,
Dave.

This info is copyrighted to Mr.bob and his book. Ta.