From Lavish Software Wiki
Jump to: navigation, search


Object Type Vitals
Defined By LavishScript
Inherits none
Reduces To NULL
Variable Object Type iterator
Uses Sub-Types no
C/C++ Type LSIterator *

An iterator is a special type of object that allows iteration of the contents of another object, or other type of list associated with some object.

The available members and methods for an iterator object depend on the aforementioned contents or list being iterated. For example, a set has only keys, but a collection has keys and values.


  •  ? Target: The iteration target object (such as a set or collection being iterated). The object type will be the original object type of the object
  •  ? Key: The current key in the iteration. The object type depends on the data being iterated.
  •  ? Value: The current value in the iteration. The object type depends on the data being iterated.
  • bool IsValid: Determines if the iterator is valid, pointing to a valid iteration target and key/value
  • bool Reversible: TRUE if the list being iterated also goes backwards, thus making the Previous method valid
  • bool Constant: TRUE if the list will not allow you to set object values (i.e. the values are constant)
  • bool RandomAccess: TRUE if the list allows random access (the iterator:Jump method)


  • First: Sets the iterator position to the first element
  • Last: Sets the iterator position to the last element
  • Next: Sets the iterator position to the next element (continues iteration forward)
  • Previous: Sets the iterator position to the previous element (continues iteration backward)
  • SetValue[...]: Sets the value at the current iterator position
  • Jump[...]: Jumps to a given element

See Also

LavishScript Object Types

string - mutablestring - unistring
byte - float - float64 - int - uint - int64
Boolean (TRUE/FALSE)
boolptr - byteptr - floatptr - float64ptr - intptr - uintptr - int64ptr - rgbptr - stringptr
objectcontainer - array - index - collection - queue - stack - set - variablescope
jsonobject - jsonarray - jsonvaluecontainer - jsonvalue
iterator - jsoniterator
point3f - rgb - script - binary - event - enumtype
File Handling
filepath - file - filelist - filelistentry
exists - lavishscript - math - system - type - variable
lavishmachine - Accessed via the Top-Level Object LMAC
task - tasklibrary - taskmanager - tasktype - taskpulseargs - elmactaskstate