AnsweredAssumed Answered

Adventure 2 EVS: Scrolling Checkboxes: Select DeSelect Check box value

Question asked by tays01s on Dec 26, 2014
Latest reply on Dec 29, 2014 by philmodjunk

Title

Adventure 2 EVS: Scrolling Checkboxes: Select DeSelect Check box value

Post

I'm just trying to understand the script and apologies that my Qs [[? ]] are at a rather basic level !

#If value is not selected, add it to the list. If value has already been selected, remove it from the list.

#

If [ IsEmpty ( FilterValues ( MainScCheckBoxes::SelectedValuesList ; Values4ScCheckBoxes::ValueName ) ) // Clicked value is not in list ]

[Q: So effectively MainScCheckBoxes::SelectedValuesList is the list of potential values and Values4ScCheckBoxes::ValueName are the values to filter.]]

#append clicked value to list

Set Field [ MainScCheckBoxes::SelectedValuesList; List ( MainScCheckBoxes::SelectedValuesList ; Values4ScCheckBoxes:: ValueName ) ]

[[Q: If the value wasn't listed in the filter, it's appended to the list. Is 'List' saying list everything in MainScCheckBoxes::SelectedValuesList and whatever is 'checked' in Values4ScCheckBoxes:: ValueName? Since the latter field should contain all checked values, why does it need also the first field?]]

Else

#delete clicked value from list

Set Field [ MainScCheckBoxes::SelectedValuesList; Substitute ( ¶ & MainScCheckBoxes::SelectedValuesList & ¶ ; ¶ & Values4ScCheckBoxes::ValueName & ¶ ; ¶ ) ]

[[Q: Does "¶ & MainScCheckBoxes::SelectedValuesList & ¶ " simply mean an item in the MainScCheckBoxes::SelectedValuesList list that equals the value of the item deleted in "¶ & Values4ScCheckBoxes::ValueName & ¶" and replaced by ¶?

Why is a "¶" put either side? Is it necessary to specify an item rather than a field]]

Set Field [ MainScCheckBoxes::SelectedValuesList; Middle ( MainScCheckBoxes::SelectedValuesList ; 2 ; Length ( MainScCheckBoxes::SelectedValuesList ) - 2 ) // this step trims off the extra ¶'s at beginning and end of the list ]

[[Q: Trimming 2 characters from beginning/end is when using "¶[space]"/ "[space]¶"? I assume the space is only there for easier readability?]]

 

Outcomes