Return-Path: wjeuerle@Athena.MIT.EDU 
Received: from dtc.hp.com by lantern.dtc.hp.com with SMTP
	(16.6/15.5+IOS 3.22) id AA14196; Fri, 28 Aug 92 08:12:05 -0700
Return-Path: <wjeuerle@Athena.MIT.EDU>
Received: from ATHENA.MIT.EDU by dtc.hp.com with SMTP
	(16.6/15.5+IOS 3.22) id AA03834; Fri, 28 Aug 92 08:12:40 -0700
Received: from M11-116-6.MIT.EDU by Athena.MIT.EDU with SMTP
	id AA19923; Fri, 28 Aug 92 11:12:34 EDT
From: wjeuerle@Athena.MIT.EDU
Received: by m11-116-6 (5.57/4.7) id AA14039; Fri, 28 Aug 92 11:12:32 -0400
Message-Id: <9208281512.AA14039@m11-116-6>
To: aybee@Athena.MIT.EDU
Date: Fri, 28 Aug 92 11:12:31 EDT


------- Forwarded Message

Received: from ATHENA.MIT.EDU by po7.MIT.EDU (5.61/4.7) id AA08431; Wed, 19 Aug 92 14:13:43 EDT
Received: from CECI006.MIT.EDU by Athena.MIT.EDU with SMTP
	id AA14439; Wed, 19 Aug 92 14:13:37 EDT
From: jert@Athena.MIT.EDU
Received: by ceci006.MIT.EDU (5.61/4.7) id AA01774; Wed, 19 Aug 92 14:13:33 -0400
Message-Id: <9208191813.AA01774@ceci006.MIT.EDU>
To: jud@Athena.MIT.EDU, schluss@Athena.MIT.EDU, samaa@Athena.MIT.EDU,
        webst@Athena.MIT.EDU, lynne@Athena.MIT.EDU, mohcm@Athena.MIT.EDU,
        yassir@Athena.MIT.EDU, chess@Athena.MIT.EDU, davis@Athena.MIT.EDU,
        lerman@Athena.MIT.EDU, harada@Athena.MIT.EDU, htomi@Athena.MIT.EDU,
        pbailey@Athena.MIT.EDU, aybee@Athena.MIT.EDU, jert@Athena.MIT.EDU,
        wjeuerle@Athena.MIT.EDU, mtcasey@Athena.MIT.EDU
Subject: arrays are here!
Date: Wed, 19 Aug 92 14:13:30 EDT

Finally, arrays are now available in EventScript.

An array is basically a static data structure consisting of a number
	of elements exsisting in given dimensions.  A 1-dimensional
	array is a sort of list of elements given numerical cell
	numbers from 0 to the number of the last element.
	2-dimensional arrays take on the forms of grids, cubes,
	hypercubes and such.

The synax for using an array is fairly simple.  In the beginning of one's 
	scriptfile, where one declares the global var's, one can define arrays
	by the following :

		array 	test{3};

	where array is a keyword (like var), test is the name of the array, 
	and 3 is the dimensionality of the array.  One can define several
	arrays in one line like so:

		array testa{2}, testb{4};

Arrays can also be declared locally in objects like local variables.  The
	keyword and syntax is the same for instance :

	object IAmAnObject
	{
		on Hello
		{
			local a,b;
			array tes1{1}, tes2{3};

			etc....
		}
	}

	arrays, however, are not shared by clones.

To use an array in the object the syntax is as follows :

		test[1,3,2]

	where test is the name of the array and 1, 3, and 2 are the number of
	the element being referenced in that particular dimension.  Above, 
	test was defined as a 3-dimensional array so 1 is the number of the
	element being referenced in the first dimension, 3 is the element in
	the second dimension and 2 is the element in the third dimension.

The syntax for storing into arrays is the same as for variables :

		put 4 into test[1,3,2];
		
	This line will store the value 4 into the given element of the array.
	One interesting feature is that it is possible to copy one array into 
	another of the same size, so 
	
		put test into tes2;

	is a valid statement.  Also, one may store one the last dimension of 
	an array into an array of equal size, so 

		put test[1,3] into tes1;

	is also a valid statement.

Array values are also valid in functions and expressions:

		printf(test[1,3,2]);
		GetPackageAttribute(pkgID, "name", test[1,2,4]);
		put (test[1,3,2] + test[1,4,5]) into a;

	are all valid statements (assuming there is something in test[1,4,5] 
	for the last example).  Also, for the = expression, arrays are only
	equal if all of the elements and the dimensionality are the same.
	For a boolean value, arrays always return false.  

If you have any problems or questions please direct them to either Bill, or
	myself.  Any complaints will result in the complainer being beaten 
	about the head and shoulders with large, blunt instruments.

Have fun,
- -john

Additional disclaimer by bill:
  There are probably still a few problems with arrays.  If you have
ANY problems with them, don't get upset, it's probably a problem that
we missed.  (In fact, as john was writing this, I thought of a few
places that we might have missed) Questions, suggestions, etc would be
appreciated, but since we are out of here on friday, you'd better be
quick about it.  (Although I am sure we will be able to take care of
any problems that you find after that)

For a little bit more information, there is a document that describes
arrays a little more, in what might be a little more readable format.
It's on-line in /mit/musedev/MSC/wjeuerle/arrays/implemantation.dvi.
(There will probably be a printed copy or 2 around, as well.)

------- End of Forwarded Message

