Project

General

Profile

Goto » History » Version 3

Per Amundsen, 02/16/2023 12:42 PM

1 2 Per Amundsen
_Added in 1.9.0_
2
3 1 Per Amundsen
*/goto <label>*
4
5
Allows you to jump from one point in a script to another point.
6
7
*Parameters*
8
9 3 Per Amundsen
table(ktable).
10
|*Parameter*|*Description*|
11
| <label> | The label to jump to. |
12 1 Per Amundsen
13
*Example*
14
15
<pre>
16
; /is_even <1-9>
17
;
18
; Example: /is_even 2
19
;   2 is an even number.
20
;   2 is a prime number.
21
alias is_even {
22
  /goto $1
23
  :0 | echo -a You typed zero. | return
24
  :4 | echo -a $1 is an even number.
25
  :1 | :9 | echo -a $1 is a perfect square. | return
26
  :2 | echo -a $1 is an even number.
27
  :3 | :5 | :7 | echo -a $1 is a prime number. | return
28
  :6 | :8 | echo -a $1 is an even number. | return
29
  :error
30
  /echo -a Only single-digit numbers are allowed!
31
  /reseterror
32
}
33
</pre>