.. highlightlang:: us .. index:: keys .. index:: obj_keys .. _obj_keys: obj_keys ======== .. us.tag obj_keys NOTREADYENGLISH New410 obj :ref:`obj_keys` returns all keys or a range of keys for the given object. .. function:: keys = obj_keys(obj) keys = obj_keys(obj, start) keys = obj_keys(obj, start, end) .. us.return **Return Value** *keys* is an array of integer numbers or strings. .. us.params **Parameters** .. uparam:: obj *obj* is the object created with :ref:`obj_create`. .. uparam:: start *start* is the first key. .. uparam:: end *end* is the predecessor of the last key. *start* and *end* must be of the same type, both strings or both numbers. .. us.comment **Comment** ``obj.keys()`` returns the string keys. ``obj.keys("a", "d")`` returns all string keys starting with "a", "b" or "c". The keys are returned in the alphabetical order. ``obj.keys(1)`` returns all number keys greater or equal to 1. ``obj.keys(-DBL_MAX, 0)`` returns all number keys with negative indices. ``obj.keys(1, 10)`` returns all number keys in the range 1 to < 10. ``obj.keys(-DBL_MAX, DBL_MAX)`` returns all number keys (DBL_MAX is the number 1.7976931348623158e+308.) .. us.example **Example** :: obj = obj_create() for (i in 1:10000) { idx = rand(1,1) *100000; obj[idx] = i; } print obj.keys(1,1000) .. seealso:: :ref:`overview-uniscript-objects`, :ref:`obj_has_key` :sub:`id-1690081`