Icon representing a recipe

Recipe: Note remove all Notes V1.0

created by gramps

Profile


Name
Note remove all Notes V1.0
ID
43888
Shared with
Public
Parent
None
Children
None
Created on
August 14, 2012 at 17:01 PM UTC
Updated on
August 14, 2012 at 17:01 PM UTC
Description

DESTRUCTIVE! resets all Notes to zero-length string ""

Best for


Code


-- Note remove all Notes V1.0 -- -- DESTRUCTIVE! resets all Notes to zero-length string "" -- -- by gramps (John McLeod) -- V1.0 -- August 14, 2012 -- progname = "Note remove all Notes V1.0" -- function BFG() -- resets all the Notes for i=1,structure.GetCount() do structure.SetNote(i, "") end end -- function BFG -- -- MAIN stuff -- print(progname,"started") -- local ask = dialog.CreateDialog("reset all Notes") ask.Instructions = dialog.AddLabel("press OK to PERMANENTLY REMOVE ALL Notes!") ask.OK = dialog.AddButton("OK", 1) ask.Cancel = dialog.AddButton("Cancel", 0) if (dialog.Show(ask) > 0) then BFG() -- reset all the Notes print("all Notes have been reset to \"\"") else print("user canceled operation, Notes retained") end -- print(progname,"ended") -- -- end Note remove all Notes V1.0

Comments