Is there a way (I'm sure there probably is) that I can get a SuperBasic prog to restart if it fails during the program? It's just a silly thing I'm doing to format Microdrive cartridges. I know that it's good, supposedly, to format them a number of times to stretch the tape, so I have a simple For/Next loop for that, but it's no good if a format procedure fails and I'm not sitting there to re-start it.
Yes, I also know that microdrives are probably best forgotten and not relied upon in any way for data, but I still find myself strangely drawn to them.
Automatic re-start on error message.
- Chr$
- QL Wafer Drive
- Posts: 1314
- Joined: Mon May 27, 2019 10:03 am
- Location: Sachsen, Germany
- Contact:
Automatic re-start on error message.
https://QXL.WIN
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proved excellent for mdv data recovery.
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proved excellent for mdv data recovery.
Re: Automatic re-start on error message.
Depending on your ROM version, it might be enough to do a simple
somewhere in the program flow. Replace line 110 with whatever you want to have done in case of an error
Tobias
Code: Select all
100 WHEN ERRor
110 CONTINUE
120 END WHEN
Tobias
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
-
- Font of All Knowledge
- Posts: 3973
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: Automatic re-start on error message.
Hi,
If you use Toolkit 2, the error number is returned in tthe funnction, ERNUM and there are error functions defined, relating the the supplied error number.
The definition of the function relstes to a negative ineger.
For a failed format the TK2 function is: ERR_FF, which has a value of -14.
Using Tofro's example:
Where "restart_porgramme" is a PROCedure to restrt the programme.
You coukd always use a SELect structure as well.
See Toolkit 2 manual and QL Technical manual or SMSQ/E Reference manual for more information.
If you use Toolkit 2, the error number is returned in tthe funnction, ERNUM and there are error functions defined, relating the the supplied error number.
The definition of the function relstes to a negative ineger.
For a failed format the TK2 function is: ERR_FF, which has a value of -14.
Using Tofro's example:
Code: Select all
100 WHEN ERRor
110 IF ERNUM=ERR_FF : restart_programme
120 END WHEN
You coukd always use a SELect structure as well.
See Toolkit 2 manual and QL Technical manual or SMSQ/E Reference manual for more information.
Regards,
Derek
Derek
- Chr$
- QL Wafer Drive
- Posts: 1314
- Joined: Mon May 27, 2019 10:03 am
- Location: Sachsen, Germany
- Contact:
Re: Automatic re-start on error message.
Many thanks, I'll try those.
https://QXL.WIN
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proved excellent for mdv data recovery.
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proved excellent for mdv data recovery.