Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:31 23 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Lightbulb / Duh Moment  with ON ERROR SKIP

Author Message
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1057
Posted: 12:13am 20 Sep 2024
Copy link to clipboard 
Print this post

After many years of trying to understand the ON ERROR SKIP(nn) command, I finally worked it out. (I think)

I was doing some tests with this command & wasn't working as I thought it should.
I re-read the following for the umpteenth time & I finally saw what I was missing...
  Quote  ON ERROR SKIP will ignore an error in a number of commands (specified
by the number 'nn') executed following this command.

I missed out on seeing
  Quote  will ignore an error in


I was thinking that it missed the specified number of commands , not the error generated by them. The commands are still executed.

The example below now makes sense
  Quote  ON ERROR SKIP 3
WEB NTP -10
IF MM.ERRNO THEN WEB NTP -10
IF MM.ERRNO THEN PRINT "Failure to connect to the Internet" : CPU RESTART

All statements are executed but the errors on the first 3 are ignored.

Now, I have to go though a number of my programs to-re appraise my use of this command.

Brian
ChopperP
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024