Comparison of programming languages (associative array): Difference between revisions

Content deleted Content added
Language support: added FoxPro example
Line 238:
 
=== FoxPro ===
Visual FoxPro implements mapping with the Collections Class.
 
<pre>
mapping = NEWOBJECT("Collection")
mapping.Add("Daffodils", "flower2") && Add(object, key) - key must be character
index = mapping.GetKey("flower2") && returns the index value 1
object = mapping("flower2") && returns "Daffodils" && (retrieve by key)
object = mapping(1) && returns "Daffodils" && (retrieve by index)
</pre>
 
GetKey returns 0 if the key is not found.
 
See Collections in FoxPro Help for all the details.