fom_ln
23rd November 2023, 15:18
Hello, i have a problem.
With the code below i print twice per row the array, instead of printing it only once at the end of the report in the detail 171.
I used as input field the array flat_string with depth 10, and used in the layout fields the field flat_string(1,i) to dinamically use it.
Can you help me? Thanks!
This is the code of my array:
declaration:
long array.max, posi
extern long i
long max_length, iter_length, flat_length
string flat_string(2000)
extern boolean print.switch
detail.11:
before.layout:
array.max = 10
max_length = 132
posi = 1
if lattr.language$ = "6" then
flat_string = "Something."
else
flat_string = "Something else"
endif
for i = 1 to array.max
iter_length = max_length
flat_length = len(trim$(flat_string))
while posi + iter_length <= flat_length and
flat_string(posi + iter_length - 1;1) <> " " and
iter_length > 0
iter_length = iter_length - 1
endwhile
print.switch = true
test_string(1, i) = flat_string(posi; iter_length)
r.171.s.detail()
posi = posi + iter_length
print.switch = false
if posi > flat_length then
break
endif
endfor
lattr.print = false
With the code below i print twice per row the array, instead of printing it only once at the end of the report in the detail 171.
I used as input field the array flat_string with depth 10, and used in the layout fields the field flat_string(1,i) to dinamically use it.
Can you help me? Thanks!
This is the code of my array:
declaration:
long array.max, posi
extern long i
long max_length, iter_length, flat_length
string flat_string(2000)
extern boolean print.switch
detail.11:
before.layout:
array.max = 10
max_length = 132
posi = 1
if lattr.language$ = "6" then
flat_string = "Something."
else
flat_string = "Something else"
endif
for i = 1 to array.max
iter_length = max_length
flat_length = len(trim$(flat_string))
while posi + iter_length <= flat_length and
flat_string(posi + iter_length - 1;1) <> " " and
iter_length > 0
iter_length = iter_length - 1
endwhile
print.switch = true
test_string(1, i) = flat_string(posi; iter_length)
r.171.s.detail()
posi = posi + iter_length
print.switch = false
if posi > flat_length then
break
endif
endfor
lattr.print = false