Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM array output contains extra [enter]
#1
Is this normal?
Maybe I have something in my QM setup wrong or something I missed.
The 'a' and 'b' output contains an extra [ENTER]?
(at least in my QM, 2.4.10.0)

This outputs as expected.
out a[0]
out a[0]

Macro Macro8
Code:
Copy      Help
ARRAY(str) a
a[]="a"
out a
out a


ARRAY(str) b
b="b"
out b
out b

;; Expected output
str c="c"
out c
out c
 
Code:
Copy      Help
a

a

b

b

c
c
#2
Looks normal Ron. Arrays always have an empty line at that end.

can convert back to string and then trim the string,then out or can use a function like this

Function outARRAY
Code:
Copy      Help
;/
function ARRAY(str)&a

str s=a
if(s.len) s.fix(s.len-2)
out s
 
Code:
Copy      Help
int i; str
ARRAY(str) a
for i 0 10
,a[]=i
// examples how to output an array with no empty line at end
outARRAY(a)
//or
b=a
b.trim
out b
#3
Thanks!


Forum Jump:


Users browsing this thread: 1 Guest(s)