Tony Goodman provides a script "Smart History Viewer" at http://www.smartdxl.com/content/?p=418, Michael Sutherland has one at https://www.ibm.com/mysupport/s/forumsquestion?id=0D50z00006HIGSUCA5, also, if you do a search on https://www.ibm.com/mysupport/s/forumshome for e.g. "dxl history" you might find some more code examples which should help you with this topic.
Your problem is the variable o
. It is set only in the loop for o in entire m
, it always refers to the o
in the current version of m
, never to the corresponding Object in a baseline. When you open the Module lBaseMod
, o
is not automatically reassigned.
So, use a new variable of type Object
, set it to the Object in the baseline corresponding to o
and browse through this new Object's history, see the linked scripts for reference.
Also, you should rework the flow of your script. With your approach, you open all the Baselines of m
for each Object. In your case this means 2000 * 20 load
and close
. It will be much faster (though not necessarily less memory consuming) to open all the baselines of m
in an outer loop, probably using a Skip list to collect the necessary information.
Also note that when you test your script, "print" becomes very slow after some time. It will be faster if you remember all the values that you want to print e.g. in a Buffer and print it at the end of your script, or write the output to a file.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…