Running through the Notes Building App course. Just had a row of pulling out a good portion of my hair. "Why, oh why doesn't it work??! Arghhh!!!!"
I discovered (is it by design or bug??) that this will compile fine, but doesn't work as intended. Although the internal "end if" is missing the Script editor has no problem with it.
Code: Select all
if tNoteID is empty then
put getUUID() into tNoteID
else
-- inline statement below
if deleteNote(tNoteID, tNotesFile) = 0 then answer "Error saving note."
-- with no "end if" it will compile fine
exit mouseUp
end if
Code: Select all
if tNoteID is empty then
put getUUID() into tNoteID
else
-- inline statement broken
if deleteNote(tNoteID, tNotesFile) = 0 then
answer "Error saving note."
-- will not compile with missing "end if"
exit mouseUp
end if
Cheers,
MadDogDean