structures

Kevin nnoydb at excite.com
Mon Mar 8 15:59:18 EST 2004


As associative array can be used like a data structure where each dimension represents a element or series of elements.

put x_cor into arrayVariable["bullet01", "x"] 
put y_cor into arrayVariable["bullet01", "y"]

This could all be in a element called "bullets" 

put x_cor into arrayVariable["bullets", "bullet01", "x"]
put y_cor into arrayVariable["bullets", "bullet01", "y"]


How this helps.

Kevin



-==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=-
Disclaimer:

Any resemblance between the above views and those of my
employer, my terminal, or the view out my window are purely
coincidental. 
Any resemblance between the above and my own views is non-deterministic.

 The question of the existence of views in the absence of anyone to hold
them
is left as an exercise for the reader. The question of the existence of
the reader
 is left as an exercise for the second god coefficient. 
(A discussion of non-orthogonal, non-integral polytheism is beyond the
scope of this article.)



 --- On Mon 03/08, Marty Billingsley < marty at vertex.ucls.uchicago.edu > wrote:
From: Marty Billingsley [mailto: marty at vertex.ucls.uchicago.edu]
To: use-revolution at lists.runrev.com
Date: Mon, 8 Mar 2004 11:29:40 -0600 (CST)
Subject: structures

Is there a way to create structures in Transcript?<br>I want to represent an entity that has several attributes<br>(actually, I want to represent an array of such entities).<br>So, is there something similar to the "struct" that exists<br>in programming languages like c++ and scheme?<br><br>For example, one of my students wants to create an array<br>of bullets for his video game.  For each bullet we need to<br>know the following:<br> - its current availability (already in use, or available)<br> - its movement in the x direction if in use<br> - its movement in the y direction if in use<br><br>We could use three parallel arrays, but it seems cleaner to<br>use a struct.  Is it possible?<br><br>Thanks,<br>  - marty<br><br>--<br>Marty Billingsley (marty at ucls.uchicago.edu)<br>The University of Chicago Laboratory Schools<br><br>    "We are our choices...."<br>                   - Sartre<br>_______________________________________________<br>use-revolution mailing list<br>use-revolution at lists.runrev.com<br>http://lists.runrev.com/mailman/listinfo/use-revolution<br>

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


More information about the use-livecode mailing list