Project

General

Profile

Returnex » History » Version 4

Per Amundsen, 02/16/2023 03:08 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*/returnex [text]*
4
5
Halts a currently executing script and allows the calling routine to continue processing.
6
7
Same as [[/return]] but retains all spaces, including leading, trailing, and multiple.
8
9
*Parameters*
10
11 4 Per Amundsen
table(ktable).
12
|*Parameter*|*Description*|
13
| [text] | Text to return. |
14 1 Per Amundsen
15
*Example*
16
17
<pre>
18
alias example {
19
  ;Prints 9: <space>A<space><space>B<space><space>C<space>.
20
  echo -a $len($preserve_space)
21
 
22
  ;Prints 5: A<space>B<space>C.
23
  echo -a $len($strip_space)
24
}
25
 
26
;Return with the spaces intact.
27
alias preserve_space returnex $get_abc
28
 
29
;Collaps spaces.
30
alias strip_space return $get_abc
31
 
32
;Just an example string "<space>A<space><space>B<space><space>C<space>".
33
alias get_abc returnex $+($chr(32), A, $chr(32), $chr(32), B, $chr(32), $chr(32), C, $chr(32))
34
</pre>