Tim_Myth
|
Joined:
Jul 2022
Posts:
27
Threads:
16
|
|
I'm using the code from this post: https://forum.hms-networks.com/t/basic-s...g/67326/13
Code: ONERROR "GOTO ERROR"
ERROR:
error_number% = GETSYS PRG, “LSTERR”
LOGEVENT STR$ error_number%
So far every error number has been -1. This isn't very helpful without knowing what -1 means and if LSTERR is always -1, there's no need to check the value.
[string](0..19|%{[char](22+("6283877355999482425089948775838624778987").substring(($_*2),2))}) -replace " "
|
Jean-Yves
|
Joined:
Mar 2016
Posts:
239
Threads:
47
|
|
Hi,
Can you add line in your script, it should solve your issue:
SETSYS PRG,"RESUMENEXT",1
|
Tim_Myth
|
Joined:
Jul 2022
Posts:
27
Threads:
16
|
|
(20-07-2022, 02:58 PM)Jean-Yves Wrote: Hi,
Can you add line in your script, it should solve your issue:
SETSYS PRG,"RESUMENEXT",1
I could, but I want to catch and fix errors, not ignore them. I think as a temporary work around I will make a LINENUMBER tag and update it in each line of the function. I already use a CURRENTFUNCTION tag to track which function is running. EG:
CURRENTFUNCTION@ =""
LINENUMBER@ = 0
ONERROR "GOTO ERROR:
Function MosquittoInit()
CURRENFUNCTION@ = "MosquittoInit"
LINENUMBER@ = 1
MQTT "open", "ewon_flexy", "test.mosquitto.org"
LINENUMBER@ = 2
MQTT "setparam", "log", "1"
LINENUMBER@ = 3
MQTT "subscribe", "ewons/test/messages", 0
ENDFN
ERROR:
error_number% = GETSYS PRG, “LSTERR”
LOGEVENT "Error in function " + CURRENTFUNCTION@ + " on line " + LINENUMBER@ + ": " + STR$ error_number%, 80
Some of my functions are dozens of lines long and the entire program.bas is ~1000 lines.
[string](0..19|%{[char](22+("6283877355999482425089948775838624778987").substring(($_*2),2))}) -replace " "
|
Jean-Yves
|
Joined:
Mar 2016
Posts:
239
Threads:
47
|
|
When I use this, the code appears for me, but only once, this is a bug I have reported it to our R&D
|