Running into a little issue here, and hopefully someone can spot my error.
I run a code block that needs the date time, from a cell in a listbox to be put into a variable for the current date and time. (It isn’t REALLY the current date and time) but the value of the cell.
Window1.PopupMenu1.SelectionChanged, line 92
Expected (String, Locale, TimeZone), but these arguments are (Integer, Int64, Nil).
theNextRunDateTime = DateTime.FromString(window1.ListBox1.LastAddedRowIndex,4)
I don’t see that you actually get the string from the listbox.
As a general rule, simplify your code first. Get the string from the listbox and then convert to a DateTime. That will generally make it more clear than trying to do everything in one line of code.
Best would be to not try to read such data at all from user interface representation.
Your just creating fail point that is not needed by doing that.
So for example in good app that you want to have maintainable and fewer fail points then you would have it something like this:
You have some data model representing your data. Lets say your list box is displaying persons.
You have person class. (The model for your data).
You fill the relevant columns in your list box and treat it only as visual representation.
You put the Person class instance in the CellTag.
So when you want to get anything from person for given listbox row then you simply access the CellTag, and get the Person class instance, from that you get for example Person.Birthdate.
Yep. But it was the down and dirty answer he was looking for. He can always go back and create a class to do it as Bjorn laid out when he has time and if he cares whether it is a future failure point.