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 ifCode: 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


 
  The main thing is that each of us understands it ourselves.
 The main thing is that each of us understands it ourselves. ) so if you have multiple statements on 1 line in C you need to separate them with a semicolon. JavaScript has its ASI (Automatic Semicolon Insertion) and does just that - But  Hypertalk was there first.
  ) so if you have multiple statements on 1 line in C you need to separate them with a semicolon. JavaScript has its ASI (Automatic Semicolon Insertion) and does just that - But  Hypertalk was there first. after Microsoft stopped developing FoxPro in 2004. Although I still write programs in it when needed -
 after Microsoft stopped developing FoxPro in 2004. Although I still write programs in it when needed -