# Try Catch End Control Flow

**URL:** <https://scilab.discourse.group/t/try-catch-end-control-flow/1082>\
**Category:** General usage\
**Created:** [November 14, 2025, 1:22pm UTC](https://scilab.discourse.group/t/try-catch-end-control-flow/1082 "2025-11-14T13:22:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pascal](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/pascal/32/40_2.png) [@pascal](https://scilab.discourse.group/u/pascal)\
**Post date:** [November 14, 2025, 1:22pm UTC](https://scilab.discourse.group/t/try-catch-end-control-flow/1082/1 "2025-11-14T13:22:08Z")

</div>

Hi Scilab Team i recently played a little bit with try and catch. And i struggle a little bit because it could not handle the semicolon for line ending. And afterwards, when i removed semikolon it find end anymore. It seems that the try-catch -end flow is a little bit inconsitence or stable enough.

---

<div class="post-metadata">

**Author:** ![davidcl](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/davidcl/32/1029_2.png) [@davidcl](https://scilab.discourse.group/u/davidcl)\
**Post date:** [November 17, 2025, 8:30am UTC](https://scilab.discourse.group/t/try-catch-end-control-flow/1082/2 "2025-11-17T08:30:25Z")

</div>

Hi Pascal,

Could you post examples of your try?

This will help us on debugging the issues. Thanks !

---

<div class="post-metadata">

**Author:** ![pascal](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/pascal/32/40_2.png) [@pascal](https://scilab.discourse.group/u/pascal)\
**Post date:** [November 17, 2025, 8:44am UTC](https://scilab.discourse.group/t/try-catch-end-control-flow/1082/3 "2025-11-17T08:44:47Z")

</div>

→ try

> ```auto
> out1(i,:)=[strsplit(stdout1($-6),[" ","="])(3),strsplit(stdout1($-6),[" ","="])(5),strsplit(stdout1($-6),[" ","="])(9),strsplit(stdout1($),["= ","ms"])(2),strsplit(stdout1($),["= ","ms"])(4),strsplit(stdout1($),["= ","ms"])(6)];
> catch
> out1(i,:)=[]
> end
> 
> ```

Undefinierte Variable: i

→ try;

> ```auto
> out1(i,:)=[strsplit(stdout1($-6),[" ","="])(3),strsplit(stdout1($-6),[" ","="])(5),strsplit(stdout1($-6),[" ","="])(9),strsplit(stdout1($),["= ","ms"])(2),strsplit(stdout1($),["= ","ms"])(4),strsplit(stdout1($),["= ","ms"])(6)];
> catch
> out1(i,:)=[]
> end
> 
> ```

try;  
^  
Fehler: 1.1-\>2.1 syntax error, unexpected end of line

---

<div class="post-metadata">

**Author:** ![davidcl](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/davidcl/32/1029_2.png) [@davidcl](https://scilab.discourse.group/u/davidcl)\
**Post date:** [November 17, 2025, 9:13am UTC](https://scilab.discourse.group/t/try-catch-end-control-flow/1082/4 "2025-11-17T09:13:51Z")

</div>

These two errors are expected:

1. the `i` is not defined but used, and error is produced
2. the `try;` is starting a `try` block and ending it with `;` without any instruction.

---

<div class="post-metadata">

**Author:** ![pascal](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/pascal/32/40_2.png) [@pascal](https://scilab.discourse.group/u/pascal)\
**Post date:** [November 17, 2025, 9:54am UTC](https://scilab.discourse.group/t/try-catch-end-control-flow/1082/5 "2025-11-17T09:54:04Z")

</div>

Yes you have right i may confused the end of line syntax with the wright if “statement” ; and try “statement” ;. Yes that was a rule error of mine.

M.f.G. Pascal
