Dears, History example program // history DXL Example /* Example history DXL program. Generate a report of the current Module's history. */ // print a brief report of the history record void print(History h) { HistoryType ht = h.type print h.author "\t" h.date "\t" ht "\t" if (ht == createType || ht == modifyType || ht == deleteType) { // attribute type print h.typeName } else if (ht == createAttr || ht == modifyAttr || ht == deleteAttr) { // attribute definition print h.attrName } else if (ht == createObject || ht == clipCopyObject || ht == modifyObject) { // object print h.absNo if (ht==modifyObject) { // means an attribute has changed string oldV = h.oldValue string newV = h.newValue print " (" h.attrName ":" oldV " -> " newV ")" } } print "\n" } // Main program History h print "All history\n\n" for h in current Module do print h print "\nHistory for current Object\n\n" for h in current Object do print h print "\nNon object history\n\n" for h in top current Module do print h
Object s History h for h in s do { print h.attrName }
vasgyuszi - Tue Apr 12 04:48:41 EDT 2011 |
Re: History example program doesn't work!
That's great. I have two dxl scripts. Both run error-free as separate scrpits. But, if I copy the smaller one into the bigger one, I get always this errors: print "\tattribute " h.attrName " from '" oldVal "' to '" newVal "'\n"
|
Re: History example program doesn't work! vasgyuszi - Tue Apr 12 11:48:45 EDT 2011
That's great. I have two dxl scripts. Both run error-free as separate scrpits. But, if I copy the smaller one into the bigger one, I get always this errors: print "\tattribute " h.attrName " from '" oldVal "' to '" newVal "'\n"
|
Re: History example program doesn't work! vasgyuszi - Tue Apr 12 11:48:45 EDT 2011
That's great. I have two dxl scripts. Both run error-free as separate scrpits. But, if I copy the smaller one into the bigger one, I get always this errors: print "\tattribute " h.attrName " from '" oldVal "' to '" newVal "'\n"
You are getting this error, because in some include you defined a attrName(...) function, which shadows the attrName() function that you are using. The error will probably go away, when you write: print "\tattribute " ( h.attrName() ) " from '" oldVal "' to '" newVal "'\n"
HAString_ oldattrName () { return attrName() } #include <bad_include_that_defines_attrName.inc> print "\tattribute " ( h.oldattrName ) " from '" oldVal "' to '" newVal "'\n" ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: History example program doesn't work! SystemAdmin - Tue Apr 12 12:03:14 EDT 2011 Thank you guys! What a rookie failure... I had within the function, I implemented this little routine, at much earlier place this variable as string defined, but not used any more and forgot about simply... Thanks again, vasgyuszi |
Re: History example program doesn't work! Mathias Mamsch - Tue Apr 12 12:07:15 EDT 2011
You are getting this error, because in some include you defined a attrName(...) function, which shadows the attrName() function that you are using. The error will probably go away, when you write: print "\tattribute " ( h.attrName() ) " from '" oldVal "' to '" newVal "'\n"
HAString_ oldattrName () { return attrName() } #include <bad_include_that_defines_attrName.inc> print "\tattribute " ( h.oldattrName ) " from '" oldVal "' to '" newVal "'\n" ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|