I htink what you're looking for is a map, a list with name/value pairs. There are a couple of functions for this:
Map newMap()
Returns a new empty map
Map newMapFromValues(String key1, Object value1, ...)
Returns a new map initialized to contain the specified keys and values.
Boolean isEmpty(Map map)
Returns whether the map contains any elements or not.
Number length(Map map)
Returns the number of elements in map.
Map copyMap(Map map)
Returns a copy of specified map (flat copy).
Map addMapEntry(Map map, String key, Object value)
Adds a new entry key->value to the map and returns the map. Returns a new map when the map should not exist yet.",
Object getMapValue(Map map, String key)
Returns the object for key or null when no mapping for key exists.
Object getMapValue(Map map, String key, Object default)
Returns the object for key or default when no mapping for key exists or map is null.
Object removeMapEntry(Map map, String key)
Removes the entry for the given key and returns the value.
List getMapKeys(Map map)
Returns a list of the keys of map.
List getMapValues(Map map)
Returns a list of the values of map.
Your code might look like this:
Code: Select all
cid = 123456;
bssid = "12:34:56:78:9A:BC";
global_wifi_list = newMap();
addMapEntry(global_wifi_list, bssid, cid);
...