Jump to content

How to use the "Lists" feature?


Recommended Posts

Can someone help me out to understand how to use the Lists feature found in the solution explorer. I don't see anything in the help files. I can see that there are many types of Lists available, and I can easily create Lists, but I don't see where/how to actually use or reference the List(s), once created.

Link to comment
Share on other sites

  • MVP 2022

I didn't know about this one, so I went digging.  There are so many hidden nuggets in UniLogic!

There is some information about Lists in the Help under "For" Loops, specifically as an input argument in the "For Each" function block.  I couldn't find an example on them.

Any input from the Creators on how this works?

 

Joe T.

Link to comment
Share on other sites

13 minutes ago, Joe Tauser said:

I didn't know about this one, so I went digging.  There are so many hidden nuggets in UniLogic!

There is some information about Lists in the Help under "For" Loops, specifically as an input argument in the "For Each" function block.  I couldn't find an example on them.

Any input from the Creators on how this works?

 

Joe T.

You can use lists as an argument for the "for each" loop without having to manage the max iterations of a typical for loop.  Here is a quick example of the for each with a list:

image.png.a6a36ce530b3830b0aadd0fec7e20e30.png

image.png.0c7e3ed588710f95a93a930d0a40ec3e.png

 

 

Current Item tag is a local tag similar to this C example:

bool list[10]; 

int PE_Active = 0;                                         // INT16 in UniLogic

for (int index = 0, index <= MAX_INDEX; index++){

   if(list[index] == true){

         PE_Active += PE_Active + 1;

   }

}

 

 

 

Link to comment
Share on other sites

OK. thanks.

This brings up a new topic now...Combo Box list of text source

I was hoping I could utilize the "Lists" with combo boxes somehow...I would like to have the "Options: List" collection of a combo box be sourced from a dynamic list, or data table column of strings. 

Currently, the list for the combo box is fixed and can't be changed thru program code or operator entry. 

I wonder if it's possible to somehow link a data table column of strings, or a list of strings to a Combo Box or "List of Text Variable"

Link to comment
Share on other sites

Thank you @curtharrington1 for clarifying the feature.

It is indeed a new feature that was introduced, along with the "for" and "while" loops.

It is worth having a look at them!

About the feature request on the dynamic combobox, that could be a nice feature.

I'll open a feature request on it.

Have a good day!

Rivka

Link to comment
Share on other sites

  • NoamM changed the title to How to use the "Lists" feature?
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...