Changeset 387 for cpp/frams/vm/classes/collectionobj.cpp
- Timestamp:
- 05/24/15 21:00:19 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/vm/classes/collectionobj.cpp
r383 r387 15 15 ParamEntry vector_paramtab[]= 16 16 { 17 {"Vector",1,13,"Vector","Vector is 1-dimensional array, indexed byinteger value (starting from 0). "18 "Multidimensional arrays can be simulated by putting other Vector objects into theVector.\n"17 {"Vector",1,13,"Vector","Vector is a 1-dimensional array indexed by an integer value (starting from 0). " 18 "Multidimensional arrays can be simulated by putting other Vector objects into a Vector.\n" 19 19 "Examples:\n" 20 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 2darray\n"23 "for(var element in v3) Simulator.print(element); //Vector supports enumeration"21 "var v2=[123,\"string\"]; //a 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 24 }, 25 25 {"clear",0,PARAM_NOSTATIC,"clear data","p()",PROCEDURE(p_clear),}, … … 45 45 {"Dictionary",1,9,"Dictionary","Dictionary associates stored values with string keys " 46 46 "(\"key\" is the first argument in get/set/remove functions). Integer \"key\" can be " 47 "used to enumerate all elements ( the sequence of elements is not preserved).\n"47 "used to enumerate all elements (note that the sequence of elements is not preserved).\n" 48 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"49 "var d2=Dictionary.new(); d2[\"name\"]=\"John\"; d2[\"age\"]=44; //shorthand notation equivalent to the line above\n" 50 50 "var i;\nfor(i=0;i<d.size;i++) Simulator.print(d.getKey(i)+\" is \"+d.get(i));",}, 51 51 {"clear",0,PARAM_NOSTATIC,"clear data","p()",PROCEDURE(p_clear),},
Note: See TracChangeset
for help on using the changeset viewer.