LEGO Engineering

| | | | | | | |
How do I configure a container?


23rd of April, 2010

(2 )
100% thumbs up 0% thumbs down

Unlike other programming languages, containers do not need to be declared. However, you still need to give them values.  For example, to set the blue container to a value of ten you use the fill container command, with a constant of 10 wired in:

general_container_pic_1.jpg

If you are doing multiple operations to the same container it is often useful to wire the container into multiple operating functions.  However, be careful when wiring one container to multiple modify commands:

general_container_pic_2.jpg

or

general_container_pic_3.jpg

As you can see, the last value filled into the container is always the one that is in the container as the program views it. This is because container values are global and could be left over from a previous program.  For example, if you run the first program above that sets the red container to 30, the value of the red container will remain 30 until another program changes its value.  Also remember that, while the multiple connection shortcut is very handy, it should only be used when you are certain that it really ought to be wired into all functions involved.  Also be aware that containers can only hold integer values; see \"wiring in constants\" for more information about this problem.
\n






6/8/04-AG

ses
   :
   :
* :
* :
 


Home | About Us | Contact Us

© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.