From: Matt M. <mat...@ya...> - 2007-03-28 23:20:52
|
--- Kwasir <kw...@gm...> wrote: > Hi everyone! > > Can someone give me a hint how to get the ID of an > selected Item in a > list? Currently I do have a list and and adding is > no problem. But when > I select an Item, I do not find any method in the > documentation, that > gives me the ID of the current item, so that I > can do "List.delete(self, aPosition)". > So there should be some method which returns the > aPosition, or a property. > Am I too tired to see it? > > Thank you! Lists in PythonCard are list any other Python lists, and all the usual list comprehensions and methods work just fine. Example: If myList is the list in question and "string_in_myList" is an element of the list, then listIndex = myList.index("string_in_myList") will assign the index of "string_in_myList" in myList to listIndex. Enjoy! - Matt Minton ____________________________________________________________________________________ Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html |