This shows you the differences between two versions of the page.
ro:try [2017/08/23 05:08] junior-root created |
ro:try [2020/02/28 10:46] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Try / Catch / EndTry (Instrucțiune) ===== | ||
- | > **Engleză: | ||
- | ==== Format ==== | ||
- | **try**\\ | ||
- | (tab)[[programsyntax|instrucțiune(-uni)]]\\ | ||
- | **catch**\\ | ||
- | (tab)[[programsyntax|instrucțiune(-uni)]]\\ | ||
- | **end try** | ||
- | ==== Descriere ==== | ||
- | Execută instrucțiunile din blocul **Try**. Dacă apare vreo eroare în cadrul acestui bloc se sare și se execută instrucțiunile din blocul **Catch**. | ||
- | ==== Exemplu ==== | ||
- | < | ||
- | for t = -1 to 1 | ||
- | try | ||
- | print " | ||
- | catch | ||
- | print " | ||
- | end try | ||
- | next t | ||
- | </ | ||
- | va afișa | ||
- | < | ||
- | 9/-1= -9.0 | ||
- | eroare: împărțire la zero | ||
- | 9/1= 9.0 | ||
- | </ | ||
- | ==== Vezi și ==== | ||
- | {{page> | ||
- | ==== Istoric ==== | ||
- | |1.0.0.2|Adăugată în acestă versiune| | ||