From: Kevin A. <al...@se...> - 2004-04-16 15:48:55
|
> From: Kevin Altis > > You can also give the fields you want to process special names or > a special > prefix that you can compare against in a loop. You might also want to keep > your own list of what you want to process. For example, in the > openBackground event handler, create a list like: > > self.fieldNames = ['SSN', 'FirstName'] > > Then when you need to process those fields you can loop over the list. The > loop below would print out the text of the SSN and FirstName fields. > > for name in self.fieldNames: > print self.components[name].text I should have mentioned that every component has a 'userdata' string attribute that you can use to store whatever string info you need; userdata is never touched by the framework, it is just for your use. The attribute is editable in the resourceEditor. That might be an even simpler place for you to stick info that you can check when you iterate over the components. Personally, I like the list of field names solution above. ka |