I'm using this:
Code: Select all
on menuPick pItemName
delete pItemName from field "Field321"
end menuPick
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
on menuPick pItemName
delete pItemName from field "Field321"
end menuPick
Code: Select all
on menuPick pItemName
set the wholeMatches to true
put lineoffset(pItemName, field "Field321") into tOS
if tOS > 0 then
delete line tOS of field "Field321"
end if
end menuPick
Code: Select all
--We are setting a local variable called tLineNumber
local tLineNumber
--We are making TLineNumber the number 1
put 1 into tLineNumber
--loops through each line of my field
repeat for each line tLine in field "Very Long List"
--here is where I'm lost. Where did we get tline? I didn't declare it??
doStuff tLine, tLineNumber
--Why do we have to add 1 to tLineNumber if we've already told it to repeat for each line of my field "Very long list"??
add 1 to tLineNumber
end repeat
Code: Select all
on menuPick pItemName
set the wholeMatches to true
local tLineNumber
put 1 into tLineNumber
repeat for each line tLine in field "Field321"
put lineoffset(pItemName, field "Field321") into tWordToDelete
if tWordToDelete > 0
then
delete line tWordToDelete of field "Field321"
end if
add 1 to tLineNumber
end repeat
end menuPick
here you create your variable tLine, that is where it comes fromrepeat for each line tLine in field "Very Long List
repeat for each line tLine in field...Why do we have to add 1 to tLineNumber if we've already told it to repeat for each line of my field "Very long list"??
here you mix two forms. For what you want to do you dont need the repeat for each line, the repeat and the lineOffset is sufficient. tWordToDelete holds the line number, no need for an additional counter, pItemName holds the word, no need to look at the text of the line in repeat for each line tLine.on menuPick pItemName
 Â
 set the wholeMatches to true
 Â
  local tLineNumber
put 1 into tLineNumber
repeat for each line tLine in field "Field321"
Â
 put lineoffset(pItemName, field "Field321") into tWordToDelete
  if tWordToDelete > 0
  then
    delete line tWordToDelete of field "Field321"
  end if
 Â
  add 1 to tLineNumber
 Â
  end repeat
 Â
end menuPick
Code: Select all
on menuPick pItemName  Â
set the wholeMatches to true
repeatÂ
put lineoffset(pItemName, field "Field321") into tWordToDelete
if tWordToDelete > 0 then
delete line tWordToDelete of field "Field321"
else
exit repeat -- you are done, no more occurences, get out of the repeat loop
end if
end repeat
end menuPick