Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_ERRORLINE abilities
#5
Here is an example:

1 On Error GoTo FAULT
2
3 '------------------------------------------------------------------------------
4 DTE1: 'Send Date to COM5
5 A$ = Date$
6 Put #1, , A$
7 STATLINE$ = Date$ + " - " + Time$ + " - COM5 Date Request"
8 GoSub EVENTSAVE
9 GoSub PRINTSTAT
10 Return
11 '------------------------------------------------------------------------------
12 TME1: 'Send Time to COM5
13 A$ = Time$
14 Put #1, , A$
15 STATLINE$ = Date$ + " - " + Time$ + " - COM5 Time Request"
16 GoSub EVENTSAVE
17 GoSub PRINTSTAT
18 Return
19 '------------------------------------------------------------------------------
20
21 FAULT:
22 If _ErrorLine = 9 Print "Unable to print Date"
23 Resume
24
25 

Now, if I add a bunch of code prior to Line 9, the an error occurring from that line of code will no longer print because the line number changed. That line of code is now line 11.

1 On Error GoTo FAULT
2
3 Screen 0, 1: Width 80: Color 2, 0
4 KEY Off: Cls: Close
5 '------------------------------------------------------------------------------
6 DTE1: 'Send Date to COM5
7 A$ = Date$
8 Put #1, , A$
9 STATLINE$ = Date$ + " - " + Time$ + " - COM5 Date Request"
10 GoSub EVENTSAVE
11 GoSub PRINTSTAT
12 Return
13 '------------------------------------------------------------------------------
14 TME1: 'Send Time to COM5
15 A$ = Time$
16 Put #1, , A$
17 STATLINE$ = Date$ + " - " + Time$ + " - COM5 Time Request"
18 GoSub EVENTSAVE
19 GoSub PRINTSTAT
20 Return
21 '------------------------------------------------------------------------------
22
23 FAULT:
24 If _ErrorLine = 9 Print "Unable to print Date"
25 Resume

I hope that makes sense......
Reply


Messages In This Thread
_ERRORLINE abilities - by MichelleL - 01-24-2024, 11:55 PM
RE: _ERRORLINE abilities - by bplus - 01-25-2024, 12:16 AM
RE: _ERRORLINE abilities - by Kernelpanic - 01-25-2024, 12:21 AM
RE: _ERRORLINE abilities - by SMcNeill - 01-25-2024, 02:34 AM
RE: _ERRORLINE abilities - by MichelleL - 01-25-2024, 03:01 AM
RE: _ERRORLINE abilities - by SMcNeill - 01-25-2024, 03:43 AM
RE: _ERRORLINE abilities - by mdijkens - 01-25-2024, 02:36 PM
RE: _ERRORLINE abilities - by Kernelpanic - 01-25-2024, 04:42 PM



Users browsing this thread: 6 Guest(s)