It may happen that in a QAB program we need to be able to assign a value to the nth occurence of some field, where n is a variable. This type of prcessing is very awkward in QAB. It may sometimes be possible to use some kind of trick to change the field - the PROVIDED operator is sometimes useful for this. However the most general method is to use the | operator and the HEAD and TAIL functions.
To assign a single value to a multi-occurs numeric field:
For example, to assign to the ith occurrence of the N10*12
budget field you could use something like this :
head(budget,i-1)| new_value | tail(budget, 12-i)
To assign to n adjacent occurrences you can extend the same technique as follows:
head(budget,i-1)| new_value_1 | new_value_2 |...| new_value_n
| tail(budget, 12-i-(n-1))