FeResPost Web Site                     FeResPost Online User Manual

VII.1.3.1 Printing DataBase lists of Results

This example is stored in file “COMEX/EX03/printResLists.rb”. It corresponds to the example "RUBY/EX04/printResLists.rb" described in section IV.2.4. The differences between the two programs are related to the way FeResPost COM component is accessed, to the access to the objects of different classes, and to the use of iterators. (See corresponding explanations in section IV.2.4.1.)

The same example is also translated in python in file “COMEX/EX03/printResLists.py”. Here again, for explanations on the access to COM component and the use of iterators, the user is referred to section VII.1.4. One notes however differences in the use of iterators that return several values. The following ruby statements:

      db.iter_resultKey.each do |lcName,scName,tpName|  
         tmpRes=db.getResultCopy(lcName,scName,tpName)  
         printf("%-20s%-15s%-50s%-10d' n",lcName,scName,tpName,'  
                tmpRes.Size)  
      end

become in python:

      for tab in db.iter_resultKey:  
         lcName=tab[0]  
         scName=tab[1]  
         tpName=tab[2]  
         tmpRes=db.getResultCopy(lcName,scName,tpName)  
         stdout.write("%-20s%-15s%-50s%-10d' n"%(lcName,scName,tpName,'  
               tmpRes.Size)

(The differences are related to the fact that python has no syntax for iterators that return several values.)