On Jan 22, 2008 3:46 AM, Peter Alcibiades <[EMAIL PROTECTED]> wrote:
> There is a sales file with a varying number of lines, tab delimited.
>
> Each line records one transaction, the sale of one product.  These lines
> accumulate throughout the day.
>
> At the end of the day, I want to take (for instance) item 1 & tab & item 2 &
> tab, and use this to look up the line in the stock list that corresponds to
> that sale.  Then item 5 of that line in the stock list, which is the stock
> level, should be decremented by 1 to show one of these items has been sold.

Not tested, but should work fine, assuming that your sales file has
been loaded into a variable called tSalesData, and the stock file has
been loaded into tStockData:

set the itemDelimiter to tab
repeat for each line L in tSalesData
   get lineOffset(item 1 to 2 of L, tStockData)
   if it > 0 then subtract 1 from item 5 of line it of tStockData
end repeat

HTH,
Sarah
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to