01-21-2010, 08:32 PM
Function Function45
out
;ARRAYS add an empty line to the end when outputting them. This is undesireable in some cases and cannot figure out how to get rid of it.
out "----Example 1----"
str Multiline_Text=
;Line 1
;Line 2
;Line 3
;Line 4
;Line 5
ARRAY(str) Array1=Multiline_Text
out Array1
out "There shouldn't be an empty line above this."
out "----Example 2----"
ARRAY(str) Array2
int i=1
rep 5
,Array2[]=_s.from("Line " i)
,i+1
out Array2
out "There shouldn't be an empty line above this."
out "----A string solution----"
Multiline_Text=Array1
_i=Multiline_Text.len
_s.left(Multiline_Text _i-2)
out _s
out "There is not an empty line above this."
;Outputs:
;----Example 1----
;Line 1
;Line 2
;Line 3
;Line 4
;Line 5
;
;There shouldn't be an empty line above this.
;----Example 2----
;Line 1
;Line 2
;Line 3
;Line 4
;Line 5
;
;There shouldn't be an empty line above this.
;----A string solution----
;Line 1
;Line 2
;Line 3
;Line 4
;Line 5
;There is not an empty line above this.