Print "Causing UAE via HELP-ABOUT @ " + Mid$(DateTime$,9)
WMenu "&Help"
WMenu "&About Notepad..."
WButtonClick "OK" 'Cause UAE
'TRAP code will execute now
'Exectution resumes here after returning from the TRAP.
'NP.EXE will have terminated.
'Log termination of NP.EXE
Print "NP.EXE has termninated due to a UAE @ " + Mid$(DateTime$,9)
'Check if file was saved
If Exists("Error.Txt") Then
Print """Error.Txt"" successfully found @ " + Mid$(DateTime$,9)
Pause "NP.EXE has terminated, but the file was saved first." + CRLF + "I'll REstart NotePad and load ""Error.Txt"" to prove it..." + CRLF + CRLF + " (hit ok)"
Else
Pause "It Failed - UAE may not have occurred!" + CRLF + " (hit ok)"
End If
'Restart NP.EXE
Run "NP.EXE", NoWait
'OPEN ERROR.TXT
WMenu "&File"
WMenu "&Open..."
DoKeys "Error.Txt{Enter}"
'Prove that file was saved
Pause "Note TimeStamp in file as the Proof that it was saved before dying..." + CRLF + CRLF + "Current Time " + Mid$(DateTime$,9) + CRLF + " (hit ok)"
Pause "Look at VIEWPORT window for log of events..."
Pause "End Of Demo!" + CRLF + "NP.EXE will close" + CRLF +"after clicking ok to this dialog..." + CRLF