说明:其中第一个数据类型为关联数组中存储数据元素(item)的类型,第二个数据类型为索引(index)的数据类型。 2 关联数组方法 1 关联数组一般方法 1 size 返回关联数组的长度; 2 delete(index) delete(index):删除索引为index的元素;如果不传入参数index,则清空整个关联数组。 q1初值 q1 = {1:3,2:5,100:90}...
Associative Array Methods Example moduletb;intfruits_10 [string];initialbeginfruits_10 = '{"apple":4,"orange":10,"plum":9,"guava":1};// size() : Print the number of items in the given dynamic array$display("fruits_10.size() = %0d", fruits_10.size());// num() : Another fun...
Associative Array Methods Associative Array Methods Example moduletb;intfruits_l0[string];initialbeginfruits_l0='{"apple":4,"orange":10,"plum":9,"guava":1};// size() : Print the number of items in the given dynamic array$display("fruits_l0.size() = %0d",fruits_l0.size());// ...