julius228 Posted January 9, 2017 Posted January 9, 2017 In version 16.3 (build 2297) I can not access the content of StrLastError. Is it normal? This is the error I have. ? StrLastError C1000 Channel or function not found Many thanks in advantage, Giulio
AzeoTech Posted January 9, 2017 Posted January 9, 2017 strLastError is a private variable and is only created when an error is caught by a try/catch block. So: // ? strLastError here will fail because it doesn't exist yet try x = x + 1 catch() ? strLastError endcatch ? strLastError will work (if x doesn't exist), displaying the error twice because strLastError is created by the catch() statement, but then still exists after the endcatch. It doesn't exist until an error occurs, so using it before the try, or really before the catch() will fail. The last ? strLastError will fail if there is no error because strLastError is never created. So really, as a rule, only use strLastError inside a catch()/endcatch block.
julius228 Posted February 16, 2017 Author Posted February 16, 2017 Thanks a lot for your reply. Giulio
Recommended Posts
Archived
This topic is now archived and is closed to further replies.