- Timestamp:
- 05/22/15 04:20:22 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/vm/classes/collectionobj.cpp
r375 r383 17 17 {"Vector",1,13,"Vector","Vector is 1-dimensional array, indexed by integer value (starting from 0). " 18 18 "Multidimensional arrays can be simulated by putting other Vector objects into the Vector.\n" 19 "Example:\nvar v=Vector.new();\nv.add(123); v.add(\"string\");",}, 19 "Examples:\n" 20 "var v1=Vector.new(); v1.add(123); v1.add(\"string\");\n" 21 "var v2=[123,\"string\"];// short way of doing the same (square brackets create a vector)\n" 22 "var v3=[[1,2,3],[4,5],[6]];// simulate a 2d array\n" 23 "for(var element in v3) Simulator.print(element);//Vector supports enumeration" 24 }, 20 25 {"clear",0,PARAM_NOSTATIC,"clear data","p()",PROCEDURE(p_clear),}, 21 26 {"size",0,PARAM_READONLY | PARAM_NOSTATIC,"element count","d",GETONLY(size),}, 22 27 {"remove",0,PARAM_NOSTATIC,"remove at position","p(d position)",PROCEDURE(p_remove),}, 23 {"get",0,PARAM_NOSTATIC,"get value at position","p x(d position)",PROCEDURE(p_get), },24 {"set",0,PARAM_NOSTATIC,"set value at position","p(d position,x value)",PROCEDURE(p_set), },28 {"get",0,PARAM_NOSTATIC,"get value at position","p x(d position)",PROCEDURE(p_get),"object[position] can be always used instead of object.get(position)"}, 29 {"set",0,PARAM_NOSTATIC,"set value at position","p(d position,x value)",PROCEDURE(p_set),"object[position]=value can be always used instead of object.set(position,value)"}, 25 30 {"add",0,PARAM_NOSTATIC,"append at the end","p(x value)",PROCEDURE(p_add),}, 26 31 {"find",0,PARAM_NOSTATIC,"find","p d(x value)",PROCEDURE(p_find),"returns the element index or -1 if not found"}, … … 41 46 "(\"key\" is the first argument in get/set/remove functions). Integer \"key\" can be " 42 47 "used to enumerate all elements (the sequence of elements is not preserved).\n" 43 "Example:\nvar d=Dictionary.new(); d.set(\"name\",\"John\"); d.set(\"age\",44);\n" 48 "Examples:\nvar d1=Dictionary.new(); d1.set(\"name\",\"John\"); d1.set(\"age\",44);\n" 49 "var d2=Dictionary.new(); d2[\"name\"]=\"John\"; d2[\"age\"]=44; //shorthand notation, equivalent to the line above\n" 44 50 "var i;\nfor(i=0;i<d.size;i++) Simulator.print(d.getKey(i)+\" is \"+d.get(i));",}, 45 51 {"clear",0,PARAM_NOSTATIC,"clear data","p()",PROCEDURE(p_clear),}, 46 52 {"size",0,PARAM_NOSTATIC | PARAM_READONLY,"element count","d",GETONLY(size),}, 47 53 {"remove",0,PARAM_NOSTATIC,"remove named or indexed element","p(x key)",PROCEDURE(p_remove),}, 48 {"get",0,PARAM_NOSTATIC,"get named or indexed element","p x(x key)",PROCEDURE(p_get), },54 {"get",0,PARAM_NOSTATIC,"get named or indexed element","p x(x key)",PROCEDURE(p_get),"object[position] can be always used instead of object.get(position)"}, 49 55 {"getKey",0,PARAM_NOSTATIC,"get a key of the indexed element","p s(d index)",PROCEDURE(p_getKey),}, 50 {"set",0,PARAM_NOSTATIC,"set named or indexed element","p(x key,x value)",PROCEDURE(p_set), },56 {"set",0,PARAM_NOSTATIC,"set named or indexed element","p(x key,x value)",PROCEDURE(p_set),"object[key]=value can be always used instead of object.set(key,value)"}, 51 57 {"find",0,PARAM_NOSTATIC,"find","p s(x value)",PROCEDURE(p_find),"returns the element key or null if not found"}, 52 58 {"new",0,0,"create new Dictionary","p oDictionary()",STATICPROCEDURE(p_new),},
Note: See TracChangeset
for help on using the changeset viewer.