swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with maps


From: Paul E. Johnson
Subject: Re: Problems with maps
Date: Mon, 14 Jun 1999 10:13:24 -0500

> Paulo Urbano wrote:
> 
> I do not manage to deal well with maps.
> I would like a map where the keys were integers and the values were
> floats!!
> Could someone tell me how can I insert both keys and objects in a
> created empty map?
> 
> 
> Urbano

The map can have integers as key values. However, like other swarm
collection types, the items in the map must be objects. You can't just
throw floats in a map.  You should create an object type, and in that
object you can store the float, with a set method, and get the value
back with a get method.

I learned how to do maps from the grid turtle test program 3 that is
distributed with the swarmdocs.  Check it out!

-- 
Paul E. Johnson                         email: address@hidden
Dept. of Political Science              http://lark.cc.ukans.edu/~pauljohn
University of Kansas                    Office: (785) 864-9086
Lawrence, Kansas 66045                  FAX: (785) 864-5700

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]