Attrs by index

From SDU
Revision as of 14:11, 16 March 2012 by Kowy (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.


This method can be used to fetch attributes from a recordset just returned from sync_fetch and it should be faster then dob_by_index method, because it doesn't need to create full dob in memory, but only specified attributes. It can be called in Spell Code using send_wait method.


<source lang="javascript"> void send_wait (int timeout, object recordset, "attrs_by_index", int start_index, int end_index, "DEFAULT", int attrs_num [, var attrs]) </source>

  • timeout - how long (?in seconds?) should the method wait for finishing the method (0 means infinite)
  • recordset - object returned from sync_fetch method
  • start_index - from which index do you want to iterate? Must by between 0 and item_count-1
  • end_index - to which index do you want to iterate? Must by between 0 and item_count-1
  • attrs_num - number of following attributes
  • attributes - each attribute of fetched object you want to return should be passed its name as a string here


On success the resulted list is filled into a global array msg as follows:

  • msg[0] - SD system attribute used for enumeration (NEXT, LAST or EOF can be here)
  • msg[1] - item Persistent ID
  • msg[2] - empty?
  • msg[3] - index in the recordset
  • msg[4] - number of returned attributes (should be same as attrs_num)
  • msg[5] - value of the first asked attribute
  • msg[6] - value of the second asked attribute
  • ...