[ic] loop list on different item-code

Kevin Walsh interchange-users@icdevgroup.org
Mon Aug 26 08:15:03 2002


> 
> [tmp orig_sku][filter 7][item-code][/filter][/tmp]
> 
> [loop list="[data products sku_set [scratch orig_sku]]"]
>         [data
>                 table=inventory
>                 col=quantity
>                 key="[loop-code]"
>                 increment=1
>                 value="-1"
>         ]
> [/loop]
> 
> I have tried many ways, but this way seems the closest to me. I just need to
> figure out how to fix:
> 
> [loop list="[data products sku_set [scratch orig_sku]]"]
> 
> I know this is wrong syntax, but I haven't been able to figure out how to
> base this products table access on an inline altered [item-code]. No matter
> what I try I always run into this type of wrong syntax -> ]] and quoting
> does no good.
> 
This is the positional vs. named parameter problem that crops up
and bites someone every now and again. :-)

This code has four positional parameters:

    [data products sku_set [scratch orig_sku]]

    arg1: products
    arg2: sku_set
    arg3: [scratch
    arg4: orig_sku]

This code has three named parameters:

    [data table="products" column="sku_set" key="[scratch orig_sku]"]

    arg1: products
    arg2: sku_set
    arg3: [scratch orig_sku] (interpolated value will be passed)


By the way, on a minor side note:

    [filter 7][item-code][/filter]

That would be more efficient if it was changed to this:

    [item-filter 7][item-code][/item-filter]

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/