I'm trying to create a basic program to better understand array functionality.
I've attached a screenshot of the UI to help you better understand what exactly I'm trying to do here.
I have 2 arrays in which I would like to populate with information.
There are 2 fields where a user can input text - when the "Add" button is clicked, I want push this text into their respective array.
Once the text has been added to the arrays, I want to clear the text in the fields, so the user can add more items to each array.
To test if the arrays are working - the "Show" button, when clicked should then populate the "list" fields at the bottom of the UI with the content of their respective array.
(This is not currently working as expected).
The "Refresh" button, when clicked should "reset" the app - clearing all of the data in all of the fields, and clearing out all of the data in each array - so the user can start over from scratch.
For some reason this is not working as I would like it to.
Here is my card script:
Code: Select all
global varArray1, varArray2
on mouseUp
if the short name of the target is "btnAdd" then
put the text of field "fldArray1Item" into varArray1[last line of the keys of varArray1]
put the text of field "fldArray2Item" into varArray2[last line of the keys of varArray2]
put empty into field "fldArray1Item"
put empty into field "fldArray2Item"
else if the short name of the target is "btnShow" then
put varArray1 into field "fldArray1List"
put varArray2 into field "fldArray2List"
else if the short name of the target is "btnRefresh" then
put empty into field "fldArray1Item"
put empty into field "fldArray2Item"
put empty into field "fldArray1List"
put empty into field "fldArray2List"
put empty into varArray1
put empty into varArray2
end if
end mouseUp
Thank you for your time!