2022-01-11 06:17 PM
I have an array that I need to output but I need to be able to control the width of each line it outputs. I understand that you cannot have a duplicated textblock name but is there a way around this? I can almost achieve what I need with a basic text2 line but defining the width is important.
Any help is much appreciated.
Many thanks
Solved! Go to Solution.
2022-01-11 08:32 PM
You need to have a number that adds 1 each next, then convert it to a string and make it part of the name, thus your name increases/changes each time.
2022-01-11 08:32 PM
You need to have a number that adds 1 each next, then convert it to a string and make it part of the name, thus your name increases/changes each time.
2022-01-13 08:18 AM - last edited on 2022-01-14 03:04 AM by Laszlo Nagy
dim arr[iElement] ! for example it's an array you need to display
! i consider that each element in array is a string value (word)
! according to define text style, text has height stored in value 'textSize'
maxLength = 0.200 ! for ex. maximum lenght of row is 200 mm
rowLength = 0
for i=1 to iElement
iLength = stw( arr[iElement] )*0.001*GLOB_SCALE
rowLength = rowLength + iLength
if rowLength > maxLength then
add2 0, -textSize*GLOB_SCALE ! 'making' new line of text
rowLength = iLength
endif
text2 0,0, arr[iElement] ! displaying current value of array
next i