# For Each Value In Catalog Field Array

Grammar — For each val of catalog entry fieldPath for player player
FlagsSubFunctions | Action

Runs the contained actions once for each value for a field for an entry.

# Arguments

  • int<preset::CatalogType> — Catalog
  • string<catalogentry> — Entry
  • string<catalogfieldpath> — Field Path
  • int — Player
  • anyvariable — Value

Returns — void

#AUTOVAR(catalog, int) = #PARAM(catalog);
#AUTOVAR(entry, string) = #PARAM(entry);
#AUTOVAR(fieldPath, string) = #PARAM(fieldPath);
#AUTOVAR(player, int) = #PARAM(player);
#AUTOVAR(i) = 0;
for ( ; #AUTOVAR(i) <= CatalogFieldValueCount(#PARAM(catalog),#AUTOVAR(entry),#AUTOVAR(fieldPath),#AUTOVAR(player))-1 ; #AUTOVAR(i) += 1 ) {
    #PARAM(val) = CatalogFieldValueGet(#PARAM(catalog),#AUTOVAR(entry),#AUTOVAR(fieldPath)+"["+IntToString(#AUTOVAR(i))+"]",#AUTOVAR(player));
    #SUBFUNCS(actions)
}

Category: Catalog / Loops

# Examples

— None found —