Page 1 of 1

Component: list f text property how to

Posted: Tue Aug 27, 2013 11:19 am
by Jordy101091
Hi,

I want to create a component with multiple devices.
For example my first working component for the ACS712 features only a single component, I want to update this component to include the following device "ACS759" which has a range of 0-200A for this device I need to program a different sensitivity. There for I want to rename this component to "ACS7xx" where the xx stand for 59,12,62 this way I want to include more devices into one component.

I want that the user can select the device range such as "59" via a drop down menu "list of text"
But how do I use this property in flowcode, I have tried "getvalue" & "getvalue from list" but none of them worked.
I hope I'm clear about my problem and I hope you can Help me.

Regards jordy

Re: Component: list f text property how to

Posted: Tue Aug 27, 2013 11:37 am
by JonnyW
Hi Jordy.

The 'List of Text' and 'List of Ints' work by splitting each line into two parts.

The first part is a 3-character code you can use for your list. The second part is a cosmetic string that the User sees. These are shown in the property edit window in the margin and main area respectively. Clicking on the margin you can alter the code for your list item.
list_select.png
(20.91 KiB) Downloaded 1199 times
The reasons it is done this way are:
1) Ease of programming - you can alter and edit the cosmetic text, translate it, etc, and always have a reliable comparison value for your program.
2) Future-proofing. Amending the list is more reliable because the values in the list that the User sees do not have to be in any particular order or have specific values

The property when read as a variable reads the value of the list item selected. The Fixed list of text/ints reads the value back as a quoted string or an integer value, respectively, otherwise both behave the same way.

I have attached an example program. This uses the Property change event to change a text label on the system panel to the index you have chosen whenever the property changes.
text_list_01.fcfx
(4.65 KiB) Downloaded 209 times
I hope this is useful.

Jonny