Problem
Die Anzahl der OLE Objekte in einem Modul soll ermittelt werden. Außerdem ermittelt das Skript noch welche Typen einer Enumeration „BB_TYPE“ auftreten.
Ansatz
* Verwendung der Funktion oleCount (Ein Objekt kann im Objekt Text mehrere OLE Objekte haben).
* Verwendung einer Skip Liste (HashMap) um die Types zu ermitteln, die auftreten können (ein Type ist eine Attribut-Enumeration)
Lösung – Solution
int oleCountInModule=0; int internalCount=0; Skip typeCollection = create; void checkOLEcount(Object o, string attributeName) { int n = oleCount(o.attributeName); oleCountInModule=oleCountInModule+n; if(n>0 && o."BB_Type" "" != "Internal" && o."BB_Type" "" != "ChangeHistory") { put(typeCollection , o."BB_Type" "", o."BB_Type" "") } } Module m = current; Object o; for o in m do { checkOLEcount(o, "Object Text") } print "OLE Count in Module: " oleCountInModule " / davon " internalCount " internal\n"; for myIterator in typeCollection do { string keyValue = (string key(typeCollection )); string currentObject = ""; if(find(typeCollection , keyValue, currentObject)) { // Just put the column names here.. it will work print currentObject "\n" } }