The documentation states that you can use try/catch with Basic scripts, however, Catch seems to be an unrecognized keyword, although Try is recognized.
Had anyone else attempted this?
Before posting, and to avoid disappointment, please read the following:
- This forum is not for 2BrightSparks to provide technical support. It's primarily for users to help other users. Do not expect 2BrightSparks to answer any question posted to this forum.
- If you find a bug in any of our software, please submit a support ticket. It does not matter if you are using our freeware, a beta version or you haven't yet purchased the software. We want to know about any and all bugs so we can fix them as soon as possible. We usually need more information and details from you to reproduce bugs and that is better done via a support ticket and not this forum.
- If you are entitled to technical support then please submit a support ticket. Please do not post the same question to the forum and also via a support ticket. Once again, 2BrightSparks does not provide technical support via this forum.
Basic Try/Catch ?
-
- Enthusiastic
- Posts: 15
- Joined: Sat Aug 20, 2022 1:21 pm
Re: Basic Try/Catch ?
So as far as I can tell, you CANNOT use Try/Catch/Try End within 'Basic' v10 for Syncback, it simply does not support it despite what is defined in the documentation. You cannot use any flavor of 'On Error' either for error handling under the latest Syncback Basic.
With Pascal under Syncback, I found that you can perform a Try/Except/end, however, it seems that you cannot actually capture any Exception messages or other exception details within the Try statements, such as with "On E:", so everything's scaled back as far as the scripting capabilities go. The lack of proper error handling is certainly a concern. It seems it would be best to define my own Programs 'Before and After' (likely with powershell), to try to handle issues for which the Syncback script would be too weak. Alternatively, perhaps importing some DLL files would provide the functionality to perform what is desired.
With Pascal under Syncback, I found that you can perform a Try/Except/end, however, it seems that you cannot actually capture any Exception messages or other exception details within the Try statements, such as with "On E:", so everything's scaled back as far as the scripting capabilities go. The lack of proper error handling is certainly a concern. It seems it would be best to define my own Programs 'Before and After' (likely with powershell), to try to handle issues for which the Syncback script would be too weak. Alternatively, perhaps importing some DLL files would provide the functionality to perform what is desired.
-
- 2BrightSparks Staff
- Posts: 417
- Joined: Thu Sep 18, 2014 2:08 am
Re: Basic Try/Catch ?
Ηι,
Maybe these topics in the script engine's developer Support Center can illustrate and clarify how to do it:
https://support.tmssoftware.com/t/on-e- ... ort/2308/2
https://support.tmssoftware.com/t/how-t ... ion/2488/2
https://support.tmssoftware.com/t/excep ... ess/2323/3
Thanks,
Kostas
![2BrightSparks [2bs]](./images/smilies/2bs.gif)
Maybe these topics in the script engine's developer Support Center can illustrate and clarify how to do it:
https://support.tmssoftware.com/t/on-e- ... ort/2308/2
https://support.tmssoftware.com/t/how-t ... ion/2488/2
https://support.tmssoftware.com/t/excep ... ess/2323/3
Thanks,
Kostas
![2BrightSparks [2bs]](./images/smilies/2bs.gif)
-
- Enthusiastic
- Posts: 15
- Joined: Sat Aug 20, 2022 1:21 pm
Re: Basic Try/Catch ?
Thank you, however, "On E:" is not handled properly or recognized properly by the Syncback implementation of Pascal, which is my point that these are 'scaled back' versions of the scripting languages that can only handle so many commands.
-
- Enthusiastic
- Posts: 15
- Joined: Sat Aug 20, 2022 1:21 pm
Re: Basic Try/Catch ?
Ok sorry, I see those links were their 'workarounds' for the "on e:" limitations... thank you.