Replacing item in line after subtracting
Posted: Mon Oct 31, 2011 10:09 pm
I am a complete newbie with Livecode, and after dabbling a bit with some examples I'd like to do the following:
In a list, I want to find a specific line that equals a value. Then subtract a number from an item in that line and replace the specific item with the new value:
repeat for each line theline in getallister
put item 1 theline & space & item 2 theline into watisnaam
if watisnaam=soekernaam then
put item 12 theline into kryverlofbalwaarde
subtract totelklyn from kryverlofbalwaarde
replace item 12 theline with kryverlofbalwaarde in getallister
end if
end repeat
Trying the above, replaces all the items corresponding to the specific criteria in the whole list with new subtracted value, and not just the specific line.
I only want to subtract a number from the specific line, in this case, item 12 of the line, and replace it with the new subtracted value.
Any help would be much appreciated.
In a list, I want to find a specific line that equals a value. Then subtract a number from an item in that line and replace the specific item with the new value:
repeat for each line theline in getallister
put item 1 theline & space & item 2 theline into watisnaam
if watisnaam=soekernaam then
put item 12 theline into kryverlofbalwaarde
subtract totelklyn from kryverlofbalwaarde
replace item 12 theline with kryverlofbalwaarde in getallister
end if
end repeat
Trying the above, replaces all the items corresponding to the specific criteria in the whole list with new subtracted value, and not just the specific line.
I only want to subtract a number from the specific line, in this case, item 12 of the line, and replace it with the new subtracted value.
Any help would be much appreciated.