/* Delete the track and check for an error */ err = MIDISetEvent('DEL', -1) IF err \== "" THEN SAY errWhen the currently selected track is deleted, then there is no longer a currently selected event/track.
Here we delete all tracks containing data:
/* Reset the shortcut increment */ MIDITrack(0) /* Set each non-empty track in turn */ WHILE MIDITrack("") \== 0 THEN DO /* Delete the track */ err = MIDISetEvent('DEL', -1) /* Check for an error */ IF err \== "" THEN DO SAY err LEAVE END END