Project

General

Profile

Actions

Added in 1.9.0

/returnex [text]

Halts a currently executing script and allows the calling routine to continue processing.

Same as /return but retains all spaces, including leading, trailing, and multiple.

Parameters

Parameter Description
[text] Text to return.

Example

alias example {
  ;Prints 9: <space>A<space><space>B<space><space>C<space>.
  echo -a $len($preserve_space)

  ;Prints 5: A<space>B<space>C.
  echo -a $len($strip_space)
}

;Return with the spaces intact.
alias preserve_space returnex $get_abc

;Collaps spaces.
alias strip_space return $get_abc

;Just an example string "<space>A<space><space>B<space><space>C<space>".
alias get_abc returnex $+($chr(32), A, $chr(32), $chr(32), B, $chr(32), $chr(32), C, $chr(32))

Updated by Per Amundsen almost 2 years ago · 4 revisions

Also available in: PDF HTML TXT