showing the elements of an array in separate lines - Forum

Forum Navigation
You need to log in to create posts and topics.

showing the elements of an array in separate lines

Hi,

I have an array in my code which has different sizes in each run. I want to show its elements in separate lines, like the following example:

element1

element2

element3

...

Also, since the number of its elements is large, it couldn't be shown in one page and a scroll is needed.

I don't know how to do this. Could anyone help me?

Hello,

I assume that you know the length of your array.

Then you can loop through your array and add each element to the wanted object.

https://winhelp.visualneo.com/Control.html#LOOP

You may use a Multiline-Textentry with a String-Variable with [CRLF].

Or a Listbox where you add the lines with the command:

https://winhelp.visualneo.com/Objects.html#LISTBOXADDITEM

Regards

 

 

luishp and saeid have reacted to this post.
luishpsaeid

@hpw

Hi,

Thanks for your response.

What did you mean by the following sentence:

You may use a Multiline-Textentry with a String-Variable with [CRLF].

Could you please give me an example?

Hello,

Take a look at the Text-Entry object:

https://winhelp.visualneo.com/TextEntryFieldTool.html

There you can see Style option "Multi-line". Activate it.

Then you make your textentry so high that you can see more than one line of text.

You can also use scrollbars to scroll through the list when it gets longer.

Setvar "[YourTextEntryContentVariable]" ""
Loop "1" "[YourArrayLength]" "[Counter]"
   Setvar "[YourTextEntryContentVariable]" "[YourTextEntryContentVariable][YourArray[Counter]][#13][#10]"
EndLoop

 

That puts each element in a Stringlist delimited by the CarriageReturn/Linefeed-Characters. (Short [CRLF])

The will sshow up in the Multiline Text-entry object.

Regards

 

 

luishp and saeid have reacted to this post.
luishpsaeid

@hpw

Thank you so much.