//< ///-------------------------------------------------------------------------------------- //https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14830975#14830975 int *::+(int *ptr1, int ofs) { int *ptr2 = ptr1; ptr2+=ofs; return ptr2 } int *::@(int *ptr, int ofs) { int ad = *(ptr + ofs); int *ptr2 = addr_ ad; return ptr2 } int *ccp () { DB x = create "" int *p = addr_ x; int *r = p @ 48 destroy x return r } int *mbn (int *cc) { return cc @ 0x74 } int *dp (int *n) { return n @ 0 } int *nn (int *n) { return n @ 8 } int allocatedObjects() { int cnt = 0 int *mb = mbn ccp() while (!null mb) { mb = nn mb; cnt++ } return cnt } ///-------------------------------------------------------------------------------------- ///---------------------------------------------------------------------------------- /*Resources: * https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14901574& * https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14832712� * https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14872132� */ ///---------------------------------------------------------------------------------- #include pragma runLim, 0 const bool DEBUG = false const bool DEBUG_Alloc = false const Module m = current const Folder f = current void PrintAllocs(string Label) { if (DEBUG_Alloc) then print Label "\t" allocatedObjects() "\n" } ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at start of DXL code:" ) ///---------------------------------------------------------------------------------- if ( null m ) { warningBox("Please run this script from a module."); halt } if ( !confirm("This script allows for transfering or deleting of Links!\n\n" //- "WARNING: Modules will be saved automatically and {THERE IS NO UNDO/REVERT} etc.\n"//- "Use at his\\her own risk, user is responsible to correct any mistakes.\n\n"//- "It proceeds without further interaction.\n\n"//- "Proceed to run script?.", msgWarning) ) { halt } bool memoryCleaner(bool& frstrun) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(memoryCleaner) of DXL code:") ///---------------------------------------------------------------------------------- bool ret = true bool confirmx = false int cnt = 0 Skip DataBaseModuleList = create () Module xopen = null Module DataBaseModule = null for DataBaseModule in database do { if(type(DataBaseModule) != "Formal") continue if (DataBaseModule == m) continue put(DataBaseModuleList, ++cnt, DataBaseModule) } if(frstrun) { if ( (cnt > 0) && confirm("All Module(s) within the database must be closed prior to running this script!\n\n" //- "WARNING: Modules will be saved then closed\n\n"//- "It proceeds without further interaction.\n\n"//- "Proceed to close all Modules('"cnt"')?.", msgWarning) ) { xopen = null for xopen in DataBaseModuleList do { if(xopen != m) { //Double checking to make sure not closing current Module (m) if(DEBUG) print "(With Confirmation Prompt!) closing... " fullName(xopen)"-"version(xopen) ((baseline(xopen))?" Baseline":"") "\n" save(xopen) close(xopen) confirmx = true } } } if((cnt > 0 && confirmx) || (cnt == 0)) { ret = false } else { ret = true } } else { xopen = null for xopen in DataBaseModuleList do { if(xopen != m) { if(DEBUG) print "(Without Confirmation Prompt!) closing... " fullName(xopen)"-"version(xopen) ((baseline(xopen))?" Baseline":"") "\n" save(xopen) close(xopen) } } if(!isRead(m)) { save(m) downgrade(m) } } delete DataBaseModuleList ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(memoryCleaner) of DXL code:") ///---------------------------------------------------------------------------------- return ret } if (memoryCleaner(true)) { halt } ////////////////////////////////////////////// // Variables Buffer Version = create (); Version = "1.19 (Beta)" int rowcount = 0 Buffer textBuff = create (); textBuff = ""; setempty(textBuff) Skip ModuleList = createString (); setempty(ModuleList) Skip tSKP = create (); setempty(tSKP) string err = null const string CONF_DIR = "C:\\tool_usage" const string fName = CONF_DIR "\\config.txt" Date dateValue = today() Locale loc = userLocale const string firstrunToday = CONF_DIR "\\" name(m) "_" stringOf(dateValue, loc, "MM_dd_yyyy") ".txt" const string firstrun = CONF_DIR "\\firstrun.txt" const string rtmHtml = CONF_DIR "\\rtm.html" const string continuousruns = CONF_DIR "\\continuousruns.txt" string results = null bool safteguard = true // location of browser or other program used to display the html report string INTERNET_EXPLORER = "C:\\Program Files\\Internet Explorer\\iexplore.exe" ////////////////////////////////////////////// // Icons const Icon iconInLinkIndicator = addr_ 119 const Icon iconOutLinkIndicator = addr_ 120 const Icon iconWaringIndicator = addr_ 176 const string dummy[] = {} DB mainDB, editDB, switchDB, printDB DBE linkSetListView, editButton, sourceModField, targetModField, targetBrowseButton, linkModField,//- linkBrowseButton, optionsRadioBox, okButton, SoftdeletedButton, frmButs, ButHelp, ButDelete,//- ButRevert, ButPrint, switchlinkModField, switchlinkBrowseButton, switchoptionsRadioBox, switchokButton,//- curRow, printtextbox, theTab, Frame1, Frame2, FilterLinkTypes, RegularExpression, ModuleorLinkONOFF,//- ApplyFilterButton, commandline, cmdlnONOFF // http://www.smartdxl.com/content/?p=404 const string tabStrings[] = {"Filters", "Settings"} Skip skipTabs = create // tab skip list - holds the following frame skip lists Skip skipFrame1 = create // to hold elements associated with frame1 Skip skipFrame2 = create // to hold elements associated with frame2 string oldLinkMod = null string oldTgtMod = null Skip cLinks = create () Skip LinkPairings = createString () bool FoundSoftdeletedLinks = false ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(Icons) of DXL code:") ///---------------------------------------------------------------------------------- void closeEditCallback(DB x) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(closeEditCallback) of DXL code:") ///---------------------------------------------------------------------------------- active(ButRevert) active(ButDelete) hide(editDB) ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(closeEditCallback) of DXL code:") ///---------------------------------------------------------------------------------- } void closeReverseCallback(DB x) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(closeReverseCallback) of DXL code:") ///---------------------------------------------------------------------------------- active(editButton) active(ButDelete) active(ButRevert) hide(switchDB) ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(closeReverseCallback) of DXL code:") ///---------------------------------------------------------------------------------- } void closeDeleteCallback(DB x) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(closeDeleteCallback) of DXL code:") ///---------------------------------------------------------------------------------- active(editButton) active(ButRevert) ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(closeDeleteCallback) of DXL code:") ///---------------------------------------------------------------------------------- } void setRowCnt() { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(setRowCnt) of DXL code:") ///---------------------------------------------------------------------------------- set(curRow, rowcount "/" noElems(linkSetListView) "") ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(setRowCnt) of DXL code:") ///---------------------------------------------------------------------------------- } Object object_(int& AbsNo, Module& currMod) { //Created because DXL object(int absno[,Module m]) doesn't return deleted Objects. ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(object_) of DXL code:") ///---------------------------------------------------------------------------------- Object o = null int cAbsNo = 0 for o in entire currMod do { if(null o) continue cAbsNo = o."Absolute Number" if(cAbsNo == AbsNo) { return(o) } } ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(object_) of DXL code:") ///---------------------------------------------------------------------------------- return(null Object) } void headerHtml(Buffer& HtmlBuff) { HtmlBuff += "\n" HtmlBuff += "\n" HtmlBuff += "\t\n" HtmlBuff += "\t\t\n" HtmlBuff += "\t\tRequirement Trace Matrix\n" HtmlBuff += "\t\t\n\n" HtmlBuff += "\t\n" HtmlBuff += "\t\n" HtmlBuff += "\t\t
\n" } void moduleHtml(Module& m, int linkcnt, Buffer& HtmlBuff, Buffer& txtBuf) { HtmlBuff += "\t\t\t

\n" HtmlBuff += "\t\t\t\t\n" HtmlBuff += "\t\t\t\t\t----------------------------------------------------------- '" HtmlBuff += fullName(m) "" HtmlBuff += "' (" HtmlBuff += linkcnt "" HtmlBuff += ")-----------------------------------------------------------\n" HtmlBuff += "\t\t\t\t\n" HtmlBuff += "\t\t\t

\n" txtBuf += "----------------------------------------------------------- '" txtBuf += fullName(m) "" txtBuf += "' (" txtBuf += linkcnt "" txtBuf += ")-----------------------------------------------------------\n" } void sourceHtml(Object& objHTML, Buffer& HtmlBuff, Buffer& txtBuf) { HtmlBuff += "\t\t\t

\n" HtmlBuff += "\t\t\t\t\n" HtmlBuff += "\t\t\t\t\t\n" HtmlBuff += "\t\t\t\t\t\t" HtmlBuff += fullName(module(objHTML)) "" HtmlBuff += "-" HtmlBuff += identifier(objHTML) HtmlBuff += "\n" HtmlBuff += "\t\t\t\t\t\n" HtmlBuff += "\t\t\t\t\n" HtmlBuff += "\t\t\t

\n" if (isDeleted(objHTML)) txtBuf += ("{Solfdeleted} ") txtBuf += fullName(module(objHTML)) txtBuf += "-" txtBuf += identifier(objHTML) txtBuf += "\n" } void targetHtml(int direction, bool srcDeleted, Link& l, Buffer& HtmlBuff, Buffer& txtBuf) { Object objHTML = ((direction == 0)?(target(l)):(source(l))) HtmlBuff += "\t\t\t

\n" HtmlBuff += "\t\t\t\t  \n" HtmlBuff += "\t\t\t\t\t\n" HtmlBuff += "\t\t\t\t\t\t" HtmlBuff += fullName(module(objHTML)) "" HtmlBuff += "-" HtmlBuff += identifier(objHTML) HtmlBuff += " [\n" HtmlBuff += "\t\t\t\t\t\t" HtmlBuff += ((direction == 0)?("('->') "):("('<-') ")) HtmlBuff += fullName(module(l)) "" HtmlBuff += "\n" HtmlBuff += "\t\t\t\t\t\t]\n" HtmlBuff += "\t\t\t\t\t\n" HtmlBuff += "\t\t\t\t\n" HtmlBuff += "\t\t\t

\n" txtBuf += "\t" txtBuf += fullName(module(objHTML)) txtBuf += "-" txtBuf += identifier(objHTML) txtBuf += ((direction == 0)?(" [('->') "):(" [('<-') ")) txtBuf += fullName(module(l)) "" txtBuf += "]" txtBuf += "\n" } void externalLinkHtml(int direction, bool srcDeleted, ExternalLink& extLink, Buffer& HtmlBuff, Buffer& txtBuf) { HtmlBuff += "\t\t\t

\n" HtmlBuff += "\t\t\t\t  \n" HtmlBuff += "\t\t\t\t\t\n" HtmlBuff += "\t\t\t\t\t\t" HtmlBuff += name(extLink) HtmlBuff += " " HtmlBuff += description(extLink) HtmlBuff += " " HtmlBuff += body(extLink) HtmlBuff += "\n" HtmlBuff += "\t\t\t\t\t\n" HtmlBuff += "\t\t\t\t\n" HtmlBuff += "\t\t\t

\n" txtBuf += "\t\t" txtBuf += name(extLink) txtBuf += " " txtBuf += description(extLink) txtBuf += " " txtBuf += body(extLink) txtBuf += "\n" } void footerHtml(Buffer& HtmlBuff) { HtmlBuff += "\t\t
\n" HtmlBuff += "\t\n" HtmlBuff += "" } int traceOut(bool& pHeader, Object& o, Buffer& outBuf, Buffer& txtBuf) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(traceOut) of DXL code:") ///---------------------------------------------------------------------------------- Link l = null ModName_ otherMod = null Object othero = null int lnkcnt = 0 for l in all(o->"*") do { ModuleVersion otherVersion = targetVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) {delete otherVersion; continue} othero = target l if (null othero) {load(otherVersion,false)} othero = target l if (null othero) {delete otherVersion; continue} if (isDeleted othero) {delete otherVersion; continue} if(pHeader) { sourceHtml(o, outBuf, txtBuf) pHeader = false } targetHtml(0, isDeleted(o), l, outBuf, txtBuf) delete otherVersion lnkcnt++ } ExternalLink extLink for extLink in o->"" do { if(pHeader) { sourceHtml(o, outBuf, txtBuf) pHeader = false } outBuf += "\t\t\t

\n" outBuf += "\t\t\t\t  \n" outBuf += "\t\t\t\tExternal Links(Out):\n" outBuf += "\t\t\t

\n" txtBuf += "\t{External Links(Out):}\n" externalLinkHtml(0, isDeleted(o), extLink, outBuf, txtBuf) lnkcnt++ } for extLink in o<-"" do { if(pHeader) { sourceHtml(o, outBuf, txtBuf) pHeader = true } outBuf += "\t\t\t

\n" outBuf += "\t\t\t\t  \n" outBuf += "\t\t\t\tExternal Links(In):\n" outBuf += "\t\t\t

\n" txtBuf += "\t{External Links(In):}\n" externalLinkHtml(0, isDeleted(o), extLink, outBuf, txtBuf) lnkcnt++ } ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(traceOut) of DXL code:") ///---------------------------------------------------------------------------------- return(lnkcnt) } int traceIn(bool& pHeader, Object& o, Buffer& outBuf, Buffer& txtBuf) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(traceIn) of DXL code:") ///---------------------------------------------------------------------------------- Link l = null LinkRef lr = null ModName_ otherMod = null Object othero = null int lnkcnt = 0 bool doneOne = false for lr in all(o<-"*") do { ModuleVersion otherVersion = sourceVersion lr otherMod = module (otherVersion) if (!null otherMod) { if ((!isDeleted otherMod) && (null data(otherVersion))) { load(otherVersion, false) } } delete otherVersion } for l in all(o<-"*") do { ModuleVersion otherVersion = sourceVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) {delete otherVersion; continue} othero = source l if (null othero) {load(otherVersion,false)} othero = source l if (null othero) {delete otherVersion; continue} if (isDeleted othero) {delete otherVersion; continue} if(pHeader) { sourceHtml(o, outBuf, txtBuf) pHeader = false } targetHtml(1, isDeleted(o), l, outBuf, txtBuf) delete otherVersion lnkcnt++ } ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(traceIn) of DXL code:") ///---------------------------------------------------------------------------------- return(lnkcnt) } void printRTM(Module m, Stream& outfile, Stream& txtfile) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(printRTM(Module m, Stream& outfile)) of DXL code:") ///---------------------------------------------------------------------------------- Object cObj = null Buffer headerBuf = create (); headerBuf = "" Buffer bodyBuf = create (); bodyBuf = "" Buffer footerBuf = create (); footerBuf = "" Buffer txtHBuf = create (); txtHBuf = "" Buffer txtBuf = create (); txtBuf = "" int linkTotal = 0 bool pHeader = true if (!null m) { for cObj in entire m do { pHeader = true if (null cObj) continue linkTotal += traceOut(pHeader, cObj, bodyBuf, txtBuf) linkTotal += traceIn(pHeader, cObj, bodyBuf, txtBuf) } headerHtml(headerBuf) moduleHtml(m, linkTotal, headerBuf, txtHBuf) outfile << headerBuf; headerBuf = ""; setempty(headerBuf) txtfile << txtHBuf; txtHBuf = ""; setempty(txtHBuf) outfile << bodyBuf; bodyBuf = ""; setempty(bodyBuf) footerHtml(footerBuf) outfile << footerBuf; footerBuf = ""; setempty(footerBuf) txtfile << txtBuf flush(outfile) flush(txtfile) } else { errorBox("Failed to open: " fullName(m)) } delete headerBuf delete txtHBuf delete bodyBuf delete footerBuf delete txtBuf ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(printRTM(Module m, Stream& outfile)) of DXL code:") ///---------------------------------------------------------------------------------- } void printRTM(DBE x) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(printRTM(DBE x)) of DXL code:") ///---------------------------------------------------------------------------------- if (fileExists_ rtmHtml) { if (fileExists_(INTERNET_EXPLORER)) { system("\"" INTERNET_EXPLORER "\" \"" rtmHtml "\"") } else { infoBox("Report complete. Please see file\n" rtmHtml) } } else { infoBox("Err; Html RTM file doesn't exist!") } ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(printRTM(DBE x)) of DXL code:") ///---------------------------------------------------------------------------------- } string replace (string sSource, string sSearch, string sReplace) { //https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14892683� int iLen = length sSource if (iLen == 0) return "" int iLenSearch = length(sSearch) if (iLenSearch == 0) { //raiseError ("Parameter error", "in strings.inc/replace: search string must not be empty") return "" } // read the first char for latter comparison -> speed optimization char firstChar = sSearch[0] Buffer s = create() int pos = 0, d1,d2; int i while (pos < iLen) { char ch = sSource[pos]; bool found = true if (ch != firstChar) {pos ++; s+= ch; continue} for (i = 1; i < iLenSearch; i++) { if (sSource[pos+i] != sSearch[i]) { found = false; break } } if (!found) {pos++; s+= ch; continue} s += sReplace pos += iLenSearch } results = stringOf s delete s return results } // replace void cmdDiff(int run, bool intrun) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(cmdDiff) of DXL code:") ///---------------------------------------------------------------------------------- if(run == 0 && safteguard) { Stream frtfile = write(firstrun) Stream HTMLfile = write(rtmHtml) printRTM(m, HTMLfile, frtfile) close(HTMLfile) close(frtfile) //archive runs... if (!fileExists_(firstrunToday) && fileExists_(firstrun)) { results = null results = copyFile(firstrun, firstrunToday) if (!null results) errorBox("Err:{sys copy '"results"' "firstrun" to " firstrunToday "}") } if (fileExists_(firstrunToday)) { results = null results = copyFile(firstrunToday, firstrun) if (!null results) errorBox("Err:{sys copy '"results"' "firstrunToday" to " firstrun "}") } safteguard = false // Safe guard to prevent file from being overwritten. } else if (run == 1) { Stream contfile = write(continuousruns) Stream HTMLfile = write(rtmHtml) printRTM(m, HTMLfile, contfile) close(HTMLfile) close(contfile) } else { errorBox("cmdDiff(status:"run")") } memoryCleaner(false) string cmdStr = get(commandline) int cmdlnONOFFChoice = get(cmdlnONOFF) if (cmdlnONOFFChoice == 0 && run == 1 && !intrun) { if (!null firstrun && !null continuousruns) { if (fileExists_(firstrun) && fileExists_(continuousruns)) { results = null win32SystemWait_((replace(replace(cmdStr, "firstrun", firstrun), "continuousruns", continuousruns)), results, 0) if (!null results) errorBox("Err:{sys cmd call '"results"'}") } } } ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(cmdDiff) of DXL code:") ///---------------------------------------------------------------------------------- } Link updateLink(Object& osrc, Buffer& limitModules, Buffer& trgModule, int& trgAbsNo, int& srcAbsNo, int& index, Buffer& direction, string LinkModule) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(updateLink) of DXL code:") ///---------------------------------------------------------------------------------- Link l = null LinkRef lr = null ModName_ otherMod = null Object othero = null if(tempStringOf(direction) == "in") { for lr in all(osrc<-LinkModule) do { ModuleVersion otherVersion = sourceVersion lr otherMod = module (otherVersion) if (!null otherMod) { if ((!isDeleted otherMod) && (null data(otherVersion))) { if (!equal(getItem otherMod, (itemFromID tempStringOf(limitModules)))) {delete otherVersion; continue} load((otherVersion),false) } } delete otherVersion } for l in all(osrc<-LinkModule) do { if(tempStringOf(trgModule) != fullName(target l) "") continue if(targetAbsNo(l) != trgAbsNo) continue if(sourceAbsNo(l) != srcAbsNo) continue ModuleVersion otherVersion = sourceVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) {delete otherVersion; continue} othero = source l if (null othero) {load(otherVersion, false)} othero = source l if (null othero) {delete otherVersion; continue} if (!isBaseline(otherVersion) && null (getColumnValue(linkSetListView, index, 6)"")) {delete otherVersion; break} if (isBaseline(otherVersion) && (getColumnValue(linkSetListView, index, 6) == "[" versionString(otherVersion) "]")) {delete otherVersion; break} delete otherVersion } } else if(tempStringOf(direction) == "out") { for l in all(osrc->LinkModule) do { if(tempStringOf(trgModule) != fullName(target l) "") continue if(sourceAbsNo(l) != trgAbsNo) continue if(targetAbsNo(l) != srcAbsNo) continue ModuleVersion otherVersion = targetVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) {delete otherVersion; continue} othero = target l if (null othero) {load(otherVersion, false)} othero = target l if (null othero) {delete otherVersion; continue} if (!isBaseline(otherVersion) && null (getColumnValue(linkSetListView, index, 6)"")) {delete otherVersion; break} if (isBaseline(otherVersion) && (getColumnValue(linkSetListView, index, 6) == "[" versionString(otherVersion) "]")) {delete otherVersion; break} delete otherVersion } } else { errorBox("Unknown Status {'direction'}") } ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(updateLink) of DXL code:") ///---------------------------------------------------------------------------------- return l } void UnloadedCallBack() { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(UnloadedCallBack) of DXL code:") ///---------------------------------------------------------------------------------- setempty(cLinks) int srcAbsNo = 0 int trgAbsNo = 0 int max = noElems(linkSetListView) int index = 0 Link l = null Object trgObj = null Buffer srcMod = create () Buffer LnkMod = create () Buffer InOut = create () Buffer modName = create () Buffer uID = create () for index in 0:max-1 do { if (selected(linkSetListView, index)) { if (getColumnValue(linkSetListView, index, 7) "" == "In {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "In") { srcMod = getColumnValue(linkSetListView, index, 2) srcAbsNo = intOf(realOf(getColumnValue(linkSetListView, index, 3))) trgAbsNo = intOf(realOf(getColumnValue(linkSetListView, index, 0))) LnkMod = getColumnValue(linkSetListView, index, 5) InOut = "in" modName = fullName(m) uID = qualifiedUniqueID(item tempStringOf(srcMod)) trgObj = object_(trgAbsNo, m) l = updateLink(trgObj, uID, modName, trgAbsNo, srcAbsNo, index, InOut, tempStringOf(LnkMod)) if(null l) { errorBox("{Null} In-Links") } put(cLinks, index, l, true) } else if (getColumnValue(linkSetListView, index, 7) "" == "Out {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "Out") { srcMod = getColumnValue(linkSetListView, index, 2) srcAbsNo = intOf(realOf(getColumnValue(linkSetListView, index, 0))) trgAbsNo = intOf(realOf(getColumnValue(linkSetListView, index, 3))) LnkMod = getColumnValue(linkSetListView, index, 5) InOut = "out" uID = qualifiedUniqueID(item tempStringOf(srcMod)) trgObj = object_(srcAbsNo, m) l = updateLink(trgObj, uID, srcMod, srcAbsNo, trgAbsNo, index, InOut, tempStringOf(LnkMod)) if(null l) { errorBox("{Null} Out-Links") } put(cLinks, index, l, true) } else { errorBox("Error on read {'Status'}") } } } delete srcMod delete LnkMod delete InOut delete modName delete uID ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(UnloadedCallBack) of DXL code:") ///---------------------------------------------------------------------------------- } void UpdateColumnInfo(int ln, Object& srcObj, Object& othero, Link& LnkModule, Buffer& direction, Icon& iconIndicator, bool& updateCreate) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(UpdateColumnInfo) of DXL code:") ///---------------------------------------------------------------------------------- textBuff = ""; setempty(textBuff) if(updateCreate) { insert(linkSetListView, ln, probeAttr_(srcObj, "Absolute Number"), iconIndicator) } set(linkSetListView, ln, 7, tempStringOf(direction)) if(isDeleted othero || isDeleted srcObj) { FoundSoftdeletedLinks = true set(linkSetListView, ln, 0, iconWaringIndicator) set(linkSetListView, ln, 7, tempStringOf(direction) " {DELETED}") } textBuff = probeAttr_(srcObj, "Object textBuff") if (null tempStringOf(textBuff)) { textBuff = probeAttr_(srcObj, "Object Heading") } if (null tempStringOf(textBuff)) { textBuff = "(Inaccessible)" } set(linkSetListView, ln, 1, tempStringOf(textBuff)) set(linkSetListView, ln, 2, fullName(module(othero)) "") set(linkSetListView, ln, 3, probeAttr_(othero, "Absolute Number")) textBuff = probeAttr_(othero, "Object textBuff") if (null tempStringOf(textBuff)) { textBuff = probeAttr_(othero, "Object Heading") } if (null tempStringOf(textBuff)) { textBuff = "(Inaccessible)" } set(linkSetListView, ln, 4, tempStringOf(textBuff)) set(linkSetListView, ln, 5, fullName(module(LnkModule)) "") ModuleVersion otherVersion = moduleVersion(module(othero)) if (isBaseline(otherVersion)) { set(linkSetListView, ln, 6, "[" versionString(otherVersion) "]") } else { set(linkSetListView, ln, 6, "") } delete otherVersion ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(UpdateColumnInfo) of DXL code:") ///---------------------------------------------------------------------------------- } int doSortString(string s1, string s2) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at start/End(doSortString) of DXL code:") ///---------------------------------------------------------------------------------- return(cistrcmp(s1, s2)) } int doSortStringReverse(string s1, string s2) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at start/End(doSortStringReverse) of DXL code:") ///---------------------------------------------------------------------------------- return(cistrcmp(s2, s1)) } int doSortInt(string str1, string str2) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(doSortInt) of DXL code:") ///---------------------------------------------------------------------------------- int s1 = intOf(realOf(str1)) int s2 = intOf(realOf(str2)) int Result = 0 if (s1 == s2) Result = 0 else if (s1 > s2) Result = 1 else if (s1 < s2) Result = -1 else{} ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(doSortInt) of DXL code:") ///---------------------------------------------------------------------------------- return(Result) } bool createLinksetPair(Buffer& src, Buffer& trg, Buffer& linkModName) { // Adds linkModuleDescriptor entry ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(createLinksetPair) of DXL code:") ///---------------------------------------------------------------------------------- bool mandatory = true bool overridable = !mandatory bool exclusive = true bool ret = true f = folder path(module tempStringOf(src)) // Gets the folder containing the source module if (null f){ errorBox("Could not access the folder containing module " tempStringOf(src) ) return false } err = addLinkModuleDescriptor(f, tempStringOf(src), tempStringOf(trg), overridable, mandatory, tempStringOf(linkModName), "") if (!null err) { // Possible duplicate entry of combination src->trg //print (res " (" src "->" trg ")\n" ) err = removeLinkModuleDescriptor(f, tempStringOf(src), tempStringOf(trg)) //print ("Removed entry " src "->" trg "via link module" linkModName) ret = createLinksetPair(src, trg, linkModName) } if (!null err) { errorBox(err) ret = false } else { setLinkModuleDescriptorsExclusive(f, module tempStringOf(src), exclusive) //print ("Created entry " src "->" trg "via link module" linkModName "\n") } err = null ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(createLinksetPair) of DXL code:") ///---------------------------------------------------------------------------------- return ret } bool Linkcreator(Link& l,Buffer& linkMod, bool& revert) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(Linkcreator) of DXL code:") ///---------------------------------------------------------------------------------- ModName_ otherMod = null Object osrc = null Object otgt = null int Error = linkErrorNoError Module tempMod = null // Source Object ModuleVersion sVersion = sourceVersion l otherMod = module(sVersion) if (null otherMod || isDeleted otherMod) {delete sVersion; return false} osrc = source l if (null osrc) {load(sVersion,false)} osrc = source l if (null osrc) {delete sVersion; return false} if (isDeleted osrc) {delete sVersion; return false} tempMod = null; tempMod = edit(fullName(sVersion) "", false) if (!isEdit(tempMod) and !isShare(tempMod)) { tempMod = edit(fullName(sVersion) "", false) if (isRead (tempMod)) { warningBox("Source module '" fullName(sVersion) "' must be open editable!") delete sVersion return false } } if (null tempMod) { errorBox("{Null} Module") delete sVersion; return false } delete sVersion // Target Object ModuleVersion tVersion = targetVersion l otherMod = module(tVersion) if (null otherMod || isDeleted otherMod) {delete tVersion; return false} otgt = target l if (null otgt) {load(tVersion,false)} otgt = target l if (null otgt) {delete tVersion; return false} if (isDeleted otgt) {delete tVersion; return false} tempMod = null; tempMod = edit(fullName(tVersion) "", false) if (!isEdit(tempMod) and !isShare(tempMod)) { tempMod = edit(fullName(tVersion) "", false) if (isRead (tempMod)) { warningBox("Source module '" fullName(tVersion) "' must be open editable!") delete tVersion return false } } if (null tempMod) { errorBox("{Null} Module") delete tVersion; return false } delete tVersion if(!revert) { Error = createLink_(osrc, tempStringOf(linkMod), otgt) } else { Error = createLink_(otgt, tempStringOf(linkMod), osrc) } if (Error != linkErrorNoError) { if(!revert) { reportLinkError_(osrc, otgt, tempStringOf(linkMod), "", Error) } else { reportLinkError_(otgt, osrc, tempStringOf(linkMod), "", Error) } } else { noError() delete l err = lastError() if (!null err) { errorBox(err) return false } } ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(Linkcreator) of DXL code:") ///---------------------------------------------------------------------------------- return true } void getLinkParingVsLinks() { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(getLinkParingVsLinks) of DXL code:") ///---------------------------------------------------------------------------------- LinkModuleDescriptor LMD = null Link l = null Object osrc = null ModName_ otherMod = null Object othero = null Buffer tgtMod = create () Buffer linkMod = create () Skip addLinkPairings = createString () f = folder path(m) // Gets the folder containing the source module bool isManditory = false if(get(optionsRadioBox) == 0) { isManditory = true } for LMD in f do { if (getSourceName(LMD) "" == fullName(m) "") { if(null getTargetName(LMD) "") continue if(null getSourceName(LMD) "") continue if(null getName(LMD) "") continue put(LinkPairings, getTargetName(LMD) "", LMD) } } for osrc in entire m do { if(null osrc) continue if(isDeleted osrc) continue for l in all(osrc->"*") do { ModuleVersion otherVersion = targetVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) {delete otherVersion; continue} othero = target l if (null othero) {load(otherVersion,false)} othero = target l if (null othero) {delete otherVersion; continue} if (isDeleted othero) {delete otherVersion; continue} put(addLinkPairings, fullName(module(othero)) "" fullName(module(l)) "", l) delete otherVersion } } for l in addLinkPairings do { if(delete(LinkPairings, fullName(module(target(l))))) { delete(addLinkPairings, fullName(module(target(l))) "" fullName(module(l)) "") } } for LMD in LinkPairings do { if ( confirm("WARNING: do you want to remove this [" getTargetName(LMD) "] unused Linkpairing Decription via [" name(LMD) "] LinkModule?\n\nContinue?", msgWarning)) { err = removeLinkModuleDescriptor(f, fullName(m) "", getTargetName(LMD) "") if(!null err) { ack(err) } } } for l in addLinkPairings do { othero = target l tgtMod = fullName(module(othero)) linkMod = fullName(module(l)) if ( confirm("WARNING: do you want to add this [" tempStringOf(tgtMod) "] Linkpairing Decription via [" fullName(module(l)) "] LinkModule?\n\nContinue?", msgWarning)) { err = addLinkModuleDescriptor(f, fullName(m) "", tempStringOf(tgtMod), !isManditory, isManditory, tempStringOf(linkMod), "") if(!null err) { ack(err "\n\nPlease Check that all Link(s) are going through the correct [LinkModule]!") } } } err = null delete tgtMod delete linkMod delete addLinkPairings ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(getLinkParingVsLinks) of DXL code:") ///---------------------------------------------------------------------------------- } void getModuleList() { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(getModuleList) of DXL code:") ///---------------------------------------------------------------------------------- LinkRef lr = null Link l = null Object osrc = null ModName_ otherMod = null for osrc in entire m do { if(null osrc) continue //InLinks for lr in all(osrc<-"*") do { ModuleVersion otherVersion = sourceVersion lr otherMod = module (otherVersion) if (!null otherMod) { if ((!isDeleted otherMod) && (null data(otherVersion))) { put(ModuleList, fullName(otherMod)"", fullName(otherMod)"", true) } } delete otherVersion } //OutLinks for l in all(osrc->"*") do { ModuleVersion otherVersion = targetVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) {delete otherVersion; continue} put(ModuleList, fullName(otherMod)"", fullName(otherMod)"", true) delete otherVersion } } ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(getModuleList) of DXL code:") ///---------------------------------------------------------------------------------- } void getLinkSets() { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(getLinkSets) of DXL code:") ///---------------------------------------------------------------------------------- empty(linkSetListView) setempty(cLinks) setempty(ModuleList) inactive(editButton) inactive(ButDelete) inactive(ButRevert) inactive(SoftdeletedButton) LinkRef lr = null Link l = null Object osrc = null ModName_ otherMod = null Object othero = null int cnt = 0 FoundSoftdeletedLinks = false string STargetModule = null Buffer InOut = create () int FilterLinkTypesChoice = get FilterLinkTypes int ModuleorLinkChoice = get ModuleorLinkONOFF string strRegExp = get RegularExpression const Regexp RegExpstr = regexp2 ((null strRegExp)?(".*"):(strRegExp)) getModuleList() for STargetModule in ModuleList do { for osrc in entire m do { if(null osrc) continue if(FilterLinkTypesChoice == 0 || FilterLinkTypesChoice == 2) { for l in all(osrc->"*") do { if(ModuleorLinkChoice == 1 && !RegExpstr fullName(module(l))) continue ModuleVersion otherVersion = targetVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) {delete otherVersion; continue} if(ModuleorLinkChoice == 0 && !RegExpstr fullName(otherMod)) {delete otherVersion; continue} if (!equal(getItem otherMod, (itemFromID qualifiedUniqueID(item STargetModule)))) {delete otherVersion; continue} othero = target l if (null othero) {load(otherVersion,false)} othero = target l if (null othero) {delete otherVersion; continue} delete otherVersion if (isDeleted osrc) { FoundSoftdeletedLinks = true } InOut = "Out" UpdateColumnInfo(cnt++, osrc, othero, l, InOut, iconOutLinkIndicator, true) } } ///------------------------------------------------------------------------------ if(FilterLinkTypesChoice == 1 || FilterLinkTypesChoice == 2) { for lr in all(osrc<-"*") do { ModuleVersion otherVersion = sourceVersion lr otherMod = module otherVersion if (!null otherMod) { if ((!isDeleted otherMod) && (null data(otherVersion))) { if (!equal(getItem otherMod, (itemFromID qualifiedUniqueID(item STargetModule)))) {delete otherVersion; continue} load((otherVersion),false) } } delete otherVersion } for l in all(osrc<-"*") do { if(ModuleorLinkChoice == 1 && !RegExpstr fullName(module(l))) continue ModuleVersion otherVersion = sourceVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) {delete otherVersion; continue} if(ModuleorLinkChoice == 0 && !RegExpstr fullName(otherMod)) {delete otherVersion; continue} if (!equal(getItem otherMod, (itemFromID qualifiedUniqueID(item STargetModule)))) {delete otherVersion; continue} othero = source l if (null othero) {load(otherVersion,false)} othero = source l if (null othero) {delete otherVersion; continue} delete otherVersion InOut = "In" UpdateColumnInfo(cnt++, osrc, othero, l, InOut, iconInLinkIndicator, true) } } } memoryCleaner(false) } delete InOut delete RegExpstr if(FoundSoftdeletedLinks) { active(SoftdeletedButton) } rowcount = 0; setRowCnt() ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(getLinkSets) of DXL code:") ///---------------------------------------------------------------------------------- } void DoDelete(DBE x) { inactive(ButRevert) inactive(editButton) if ( confirm("This script deletes all selected outgoing/incoming link(s).\n\n" //- "It proceeds without further interaction.\n\n" //- "It works by deleting the existing link.\n\n" //- "Continue?", msgWarning) ) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(DoDelete) of DXL code:") ///---------------------------------------------------------------------------------- Item GlobItmStatus = item fullName(m) if(!open module fullName(m)) {errorBox("Working Module Closed!"); return} UnloadedCallBack() Link l = null int max = noElems(linkSetListView) int index = 0 Module xMod = null // Out-Link for index in 0:max-1 do { if (selected(linkSetListView, index)) { if (getColumnValue(linkSetListView, index, 7) "" == "Out {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "In {DELETED}") { continue } if(find(cLinks, index, l)) { ModuleVersion otherVersion = sourceVersion l xMod = edit(fullName(otherVersion) "", false) if (!isEdit(xMod) and !isShare(xMod)) { xMod = edit(fullName(otherVersion) "", false) if (isRead (xMod)) { warningBox("Source module '" fullName(otherVersion) "' must be open editable!") delete otherVersion continue } } if (null xMod) { errorBox("{Null} Module") delete otherVersion continue } delete otherVersion noError() delete l err = lastError() if (!null err) { errorBox(err) continue } } } } err = null flushDeletions() refresh(m) memoryCleaner(false) //Reset display getLinkSets() cmdDiff(1, false) int cmdlnONOFFChoice = get(cmdlnONOFF) if (cmdlnONOFFChoice == 1) infoBox("Done!") ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(DoDelete) of DXL code:") ///---------------------------------------------------------------------------------- } else { closeDeleteCallback(null) } } void DoHelp(DBE x) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(DoHelp) of DXL code:") ///---------------------------------------------------------------------------------- Buffer regexpstr = create () regexpstr = "{\\rtf1\\fbidis\\ansi\\ansicpg936\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}} {\\*\\generator Msftedit 5.41.21.2510;}\\viewkind4\\uc1\\pard\\ltrpar\\lang1033\\f0\\fs20 \\pard\\ltrpar\\nowidctlpar\\li673\\ri-20\\sb42\\tx2960\\tx4260\\expndtw1\\b\\par M\\expndtw0 e\\expndtw1 a\\expndtw-1 n\\expndtw1 i\\expndtw-1 n\\expndtw0 g\\tab\\expndtw1\\tab E\\expndtw-1 x\\expndtw1 am\\expndtw-1 p\\expndtw0 le\\tab\\tab Matches\\b0\\par \\pard\\ltrpar\\nowidctlpar\\sb7\\par \\pard\\ltrpar\\nowidctlpar\\li116\\ri-20\\tx660\\tx2960\\tx4260 *\\tab zero or\\expndtw-1 \\expndtw0 more\\expndtw-1 \\expndtw0 occur\\expndtw-1 r\\expndtw0 ences\\tab\\tab a*\\tab\\expndtw-1\\tab\\tab an\\expndtw0 y \\expndtw-1 n\\expndtw1 u\\expndtw-1 m\\expndtw1 b\\expndtw-1 e\\expndtw0 r\\expndtw-1 \\expndtw1 o\\expndtw0 f \\b a \\b0 c\\expndtw1 h\\expndtw-1 a\\expndtw0 rac\\expndtw-1 t\\expndtw1 e\\expndtw0 r\\expndtw-1 s\\expndtw0 ,\\expndtw-3 \\expndtw-1 o\\expndtw0 r\\expndtw-1 \\expndtw0 n\\expndtw-1 o\\expndtw0 ne\\par \\up1 +\\tab o\\expndtw-1 n\\expndtw0 e\\expndtw-1 o\\expndtw0 r \\expndtw-1 m\\expndtw1 o\\expndtw0 re\\expndtw-1 o\\expndtw0 ccurr\\expndtw-1 e\\expndtw0 n\\expndtw-1 c\\expndtw0 es\\tab\\tab x+\\tab\\tab\\tab\\expndtw-1 o\\expndtw0 ne\\expndtw-2 \\expndtw1 o\\expndtw0 r\\expndtw-1 \\expndtw0 m\\expndtw-1 or\\expndtw0 e \\b x\\expndtw-1 \\expndtw0\\b0 characters\\par \\up0 .\\tab any \\expndtw-1 s\\expndtw1 i\\expndtw0 ngle\\expndtw-5 \\expndtw0 character\\expndtw-5 \\expndtw0 except \\expndtw1 n\\expndtw0 ew\\expndtw-2 \\expndtw0 li\\expndtw1 n\\expndtw0 e\\tab .* \\tab\\tab\\tab\\expndtw-1 an\\expndtw0 y \\expndtw-1 n\\expndtw1 u\\expndtw-1 m\\expndtw1 b\\expndtw-1 e\\expndtw0 r\\expndtw-1 \\expndtw1 o\\expndtw0 f\\expndtw-1 a\\expndtw0 ny\\expndtw-1 c\\expndtw1 h\\expndtw-1 ara\\expndtw1 c\\expndtw-1 t\\expndtw1 e\\expndtw-1 r\\expndtw0 s\\expndtw-3 \\expndtw-1 (a\\expndtw1 n\\expndtw0 y \\expndtw-1 s\\expndtw0 t\\expndtw-1 ri\\expndtw0 ng)\\par \\up1\\\\\\tab esca\\expndtw-1 p\\expndtw0 e\\expndtw-3 \\expndtw0 (liter\\expndtw-1 a\\expndtw0 l\\expndtw-1 \\expndtw0 text\\expndtw-1 \\expndtw0 c\\expndtw-1 h\\expndtw0 ar)\\tab\\tab\\\\.\\tab\\tab\\tab lit\\expndtw1 e\\expndtw-1 r\\expndtw0 a\\expndtw1 l\\expndtw0 ly\\expndtw-2 \\expndtw0 a\\expndtw-1 \\expndtw0\\b .\\expndtw-1 \\expndtw0\\b0 (do\\expndtw-1 t\\expndtw0 )\\expndtw-3 \\expndtw0 c\\expndtw-1 h\\expndtw0 aracter\\par \\up0 ^\\tab start\\expndtw-3 \\expndtw-1 o\\expndtw0 f\\expndtw-1 \\expndtw0 t\\expndtw-1 h\\expndtw0 e\\expndtw-2 \\expndtw0 s\\expndtw-1 t\\expndtw0 ri\\expndtw-1 n\\expndtw0 g\\expndtw-2 \\expndtw-1 (\\expndtw1 i\\expndtw0 f\\expndtw-1 \\expndtw0 at\\expndtw-1 \\expndtw0 start \\expndtw1 o\\expndtw0 f R\\expndtw-1 e\\expndtw0 gexp)\\tab ^\\tab\\tab\\tab The.*\\tab a\\expndtw-1 n\\expndtw0 y\\expndtw-1 \\expndtw0 s\\expndtw-1 t\\expndtw0 ri\\expndtw-1 n\\expndtw0 g\\expndtw-3 \\expndtw0 star\\expndtw-1 t\\expndtw1 i\\expndtw-1 n\\expndtw0 g\\expndtw-4 \\expndtw-1 w\\expndtw1 i\\expndtw0 th\\expndtw-5 \\expndtw0\\b The\\expndtw-3 \\expndtw0\\b0 or \\expndtw-1 s\\expndtw0 tarti\\expndtw-1 n\\expndtw0 g\\expndtw-2 \\expndtw0 with\\expndtw-4 \\expndtw-1\\b Th\\expndtw0 e\\expndtw-3 \\expndtw0\\b0 after\\expndtw-4 \\expndtw0 any\\expndtw-1 \\expndtw0 new li\\expndtw1 n\\expndtw0 e(see\\expndtw-3 \\expndtw0 also [ ] b\\expndtw1 e\\expndtw0 low)\\par $\\tab end\\expndtw-4 \\expndtw0 of\\expndtw-2 \\expndtw0 the\\expndtw-2 \\expndtw0 string\\expndtw-6 \\expndtw0 (if\\expndtw-3 \\expndtw0 at\\expndtw-2 \\expndtw0 end\\expndtw-4 \\expndtw0 of\\par \\pard\\ltrpar\\nowidctlpar\\li673\\ri-20\\sb10\\up1 Regexp)\\up0\\tab\\tab\\tab\\tab\\tab end\\\\\\\\.$\\tab\\tab\\tab any s\\expndtw-1 t\\expndtw0 r\\expndtw1 i\\expndtw0 ng\\expndtw-2 \\expndtw1 e\\expndtw-1 n\\expndtw0 d\\expndtw1 i\\expndtw0 ng\\expndtw-2 \\expndtw0 w\\expndtw1 i\\expndtw0 th\\expndtw-3 \\expndtw1\\b e\\expndtw-1 n\\expndtw0 d\\b0 .\\par \\pard\\ltrpar\\nowidctlpar\\fi-2850\\li2966\\ri-51\\tx660\\tx2960 (\\expndtw-6 \\expndtw0 )\\tab Gr\\expndtw-1 o\\expndtw1 u\\expndtw-1 pi\\expndtw0 ngs\\tab\\tab\\tab\\tab (ref) + (bind) *\\tab\\tab at\\expndtw-1 \\expndtw0 le\\expndtw-1 a\\expndtw0 st\\expndtw-3 \\expndtw0 one \\expndtw-1\\b r\\expndtw1 e\\expndtw0 f\\expndtw-2 \\expndtw0\\b0 string\\expndtw-1 \\expndtw0 t\\expndtw-1 h\\expndtw1 e\\expndtw0 n\\expndtw-2 \\expndtw0 any \\expndtw-1 n\\expndtw1 u\\expndtw-1 mb\\expndtw1 e\\expndtw0 r\\expndtw-4 \\expndtw1 o\\expndtw0 f\\expndtw-1 \\expndtw0\\b bind\\expndtw-2 \\expndtw0\\b0 st\\expndtw-1 r\\expndtw1 i\\expndtw-1 n\\expndtw0 gs\\par [\\expndtw-6 \\expndtw0 ] \\tab c\\expndtw-1 h\\expndtw0 aracter\\expndtw-1 \\expndtw0 r\\expndtw-1 a\\expndtw0 nge\\expndtw-1 \\expndtw0 (letters\\expndtw-5 \\expndtw0 or digits)\\tab\\tab [sS]hall.*\\\\\\\\.$\\tab\\tab any\\expndtw1 \\expndtw0 s\\expndtw-1 t\\expndtw0 ring\\expndtw-2 \\expndtw0 con\\expndtw-1 t\\expndtw0 aining\\expndtw-4 \\expndtw0\\b s\\expndtw-1 h\\expndtw0 all\\expndtw-3 \\expndtw0\\b0 or \\b S\\expndtw-1 h\\expndtw0 all \\b0 and\\expndtw-1 \\expndtw0 ending\\expndtw-6 \\expndtw0 in\\expndtw1 \\expndtw0 a\\expndtw-1 \\expndtw0 lite\\expndtw-1 r\\expndtw0 al\\expndtw-4 \\expndtw0 dot\\expndtw-1 \\expndtw0 (any r\\expndtw-1 e\\expndtw0 quire\\expndtw-1 m\\expndtw0 e\\expndtw-1 n\\expndtw0 t\\expndtw-6 \\expndtw0 sen\\expndtw-1 t\\expndtw0 e\\expndtw-1 n\\expndtw0 ce)\\par \\tab\\tab\\tab\\tab\\tab [^abc]\\tab\\tab\\tab any\\expndtw1 \\expndtw0 cha\\expndtw-1 r\\expndtw0 ac\\expndtw-1 t\\expndtw1 e\\expndtw0 r\\expndtw-4 \\expndtw0 e\\expndtw-1 x\\expndtw0 cept\\expndtw-4 \\expndtw0\\b a\\b0 , \\b b\\b0 , \\expndtw-1 o\\expndtw0 r\\expndtw1 \\expndtw0\\b c\\b0\\par \\tab\\tab\\tab\\tab\\tab [a-zA-Z]\\tab\\tab any alphabetic\\expndtw-8 \\expndtw0 character\\par \\tab\\tab\\tab\\tab\\tab [0-9]\\tab\\tab\\tab any digit\\par |\\tab Altern\\expndtw-1 a\\expndtw0 ti\\expndtw1 v\\expndtw0 e\\tab\\tab\\tab\\tab (dat|doc)\\tab\\tab e\\expndtw1 i\\expndtw0 t\\expndtw1 h\\expndtw0 er\\expndtw-4 \\expndtw0 t\\expndtw1 h\\expndtw0 e\\expndtw-2 \\expndtw0 stri\\expndtw1 n\\expndtw0 g\\expndtw-2 \\expndtw0\\b dat\\expndtw-2 \\expndtw-1\\b0 o\\expndtw0 r \\expndtw-1 t\\expndtw1 h\\expndtw0 e\\expndtw-2 \\expndtw-1 s\\expndtw0 t\\expndtw-1 ri\\expndtw0 ng\\expndtw-2 \\expndtw0\\b doc\\b0\\par }" DB HelpBox = create "Link editor help" DBE frmButs = frame(HelpBox, "", 360 ,52) DBE lbl = label(HelpBox, "Link Editor V " tempStringOf(Version) " by Jim Ellis") lbl->"left"->"inside"->frmButs; lbl->"top"->"inside"->frmButs DBE HelpTxt = richText(HelpBox,"",tempStringOf(regexpstr), 1000, 450, true) HelpTxt->"top"->"flush"->frmButs; HelpTxt->"bottom"->"form" show HelpBox delete regexpstr ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(DoHelp) of DXL code:") ///---------------------------------------------------------------------------------- } void DoRevert(DB x) { if ( confirm("This script revert all selected link(s) through the newly selected LinkModule.\n\n" //- "It proceeds without further interaction.\n\n" //- "It works by deleting the link then reversing then rationalship between the objects.\n\n" //- "Continue?", msgWarning) ) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(DoRevert) of DXL code:") ///---------------------------------------------------------------------------------- hide(switchDB) Item GlobItmStatus = item fullName(m) if(!open module fullName(m)) {errorBox("Working Module Closed!"); return} UnloadedCallBack() Link l = null ModName_ otherMod = null Object osrc = null Object otgt = null int max = noElems(linkSetListView) int index = 0 bool isManditory = false Buffer linkMod = create (); linkMod = (string get(switchlinkModField)) Buffer tgtMod = create () Buffer ModName = create () if(get(optionsRadioBox) == 0) { isManditory = true } // Out-Links for index in 0:max-1 do { tgtMod = getColumnValue(linkSetListView, index, 2) if (selected(linkSetListView,index)) { if (getColumnValue(linkSetListView, index, 7) "" == "Out {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "In {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "In") { continue } if(find(cLinks, index, l)) { ModName = fullName(m) if(createLinksetPair(tgtMod, ModName, linkMod)) { Linkcreator(l, linkMod, true) } } } } // In-Links for index in 0:max-1 do { tgtMod = getColumnValue(linkSetListView, index, 2) if (selected(linkSetListView,index)) { if (getColumnValue(linkSetListView, index, 7) "" == "In {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "Out {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "Out") { continue } if(find(cLinks, index, l)) { ModName = fullName(m) if(createLinksetPair(ModName, tgtMod, linkMod)) { Linkcreator(l, linkMod, true) } } } } delete linkMod delete tgtMod delete ModName flushDeletions() refresh(m) memoryCleaner(false) //Reset display getLinkSets() cmdDiff(1, false) int cmdlnONOFFChoice = get(cmdlnONOFF) if (cmdlnONOFFChoice == 1) infoBox("Done!") ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(DoRevert) of DXL code:") ///---------------------------------------------------------------------------------- } } void doUpdateLinks(DB x) { if ( confirm("This script transfer all selected link(s) to the newly selected LinkModule.\n\n" //- "It proceeds without further interaction.\n\n" //- "It works by deleting the link then creates the same link via a new LinkModule.\n\n" //- "Continue?", msgWarning) ) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(doUpdateLinks) of DXL code:") ///---------------------------------------------------------------------------------- Item GlobItmStatus = item fullName(m) if(!open module fullName(m)) {errorBox("Working Module Closed!"); return} hide(editDB) UnloadedCallBack() Link l = null ModName_ otherMod = null Object osrc = null Object otgt = null int max = noElems(linkSetListView) int index = 0 bool isManditory = false Buffer linkMod = create (); linkMod = (string get(linkModField)) Buffer tgtMod = create () Buffer ModName = create () if(get(optionsRadioBox) == 0) { isManditory = true } // out-Links for index in 0:max-1 do { tgtMod = getColumnValue(linkSetListView, index, 2) oldLinkMod = getColumnValue(linkSetListView, index, 5) if (selected(linkSetListView,index)) { if (getColumnValue(linkSetListView, index, 7) "" == "Out {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "In {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "In") { continue } if(find(cLinks, index, l)) { ModName = fullName(m) if((tempStringOf(linkMod) != oldLinkMod) && (createLinksetPair(ModName, tgtMod, linkMod))) { Linkcreator(l, linkMod, false) } } } } // In-Links for index in 0:max-1 do { tgtMod = getColumnValue(linkSetListView, index, 2) oldLinkMod = getColumnValue(linkSetListView, index, 5) if (selected(linkSetListView,index)) { if (getColumnValue(linkSetListView, index, 7) "" == "In {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "Out {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "Out") { continue } if(find(cLinks, index, l)) { ModName = fullName(m) if((tempStringOf(linkMod) != oldLinkMod) && (createLinksetPair(tgtMod, ModName, linkMod))) { Linkcreator(l, linkMod, false) } } } } delete linkMod delete tgtMod delete ModName flushDeletions() refresh(m) memoryCleaner(false) //Reset display getLinkSets() cmdDiff(1, false) int cmdlnONOFFChoice = get(cmdlnONOFF) if (cmdlnONOFFChoice == 1) infoBox("Done!") ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(doUpdateLinks) of DXL code:") ///---------------------------------------------------------------------------------- } } void closeCallback (DB x) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(closeCallback) of DXL code:") ///---------------------------------------------------------------------------------- if (!null firstrun) { if (fileExists_(firstrun)) { results = deleteFile(firstrun) if(!null results) errorBox(results) } } if (!null continuousruns) { if (fileExists_(continuousruns)) { results = deleteFile(continuousruns) if(!null results) errorBox(results) } } if (!null rtmHtml) { if (fileExists_(rtmHtml)) { results = deleteFile(rtmHtml) if(!null results) errorBox(results) } } if(open module fullName(m)) { getLinkParingVsLinks() } memoryCleaner(false) delete tSKP delete cLinks delete LinkPairings delete ModuleList delete Version delete textBuff delete skipTabs delete skipFrame1 delete skipFrame2 release(printDB) release(switchDB) release(editDB) release(mainDB) destroy(iconInLinkIndicator) destroy(iconOutLinkIndicator) destroy(iconWaringIndicator) destroy(printDB) printDB = null destroy(switchDB) switchDB = null destroy(editDB) editDB = null destroy(mainDB) mainDB = null ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(closeCallback) of DXL code:") ///---------------------------------------------------------------------------------- } void editLinkset(DBE x) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(editLinkset) of DXL code:") ///---------------------------------------------------------------------------------- inactive(ButRevert) inactive(ButDelete) int sel = get(linkSetListView) oldLinkMod = getColumnValue(linkSetListView, sel, 3) oldTgtMod = getColumnValue(linkSetListView, sel, 1) set(sourceModField, fullName(m) "") set(targetModField, getColumnValue(linkSetListView, sel, 2)) set(linkModField, getColumnValue(linkSetListView, sel, 5)) //future code.... /* if(getColumnValue(linkSetListView, sel, 2) == "Manditory") { set(optionsRadioBox, 0) } else { set(optionsRadioBox, 1) } */ set(optionsRadioBox, 0) // Change for future code.... inactive(optionsRadioBox) // Change for future code.... inactive(targetModField) // Change for future code.... inactive(targetBrowseButton) // Change for future code.... inactive(okButton) show editDB ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(editLinkset) of DXL code:") ///---------------------------------------------------------------------------------- } void switchLinkset(DBE x) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(switchLinkset) of DXL code:") ///---------------------------------------------------------------------------------- inactive(editButton) inactive(ButDelete) int sel = get(linkSetListView) oldLinkMod = getColumnValue(linkSetListView, sel, 3) oldTgtMod = getColumnValue(linkSetListView, sel, 1) set(switchlinkModField, getColumnValue(linkSetListView, sel, 5)) //future code.... /* if(getColumnValue(linkSetListView, sel, 2) == "Manditory") { set(optionsRadioBox, 0) } else { set(optionsRadioBox, 1) } */ set(switchoptionsRadioBox, 0) // Change for future code.... inactive(switchoptionsRadioBox) // Change for future code.... inactive(switchokButton) show switchDB ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(switchLinkset) of DXL code:") ///---------------------------------------------------------------------------------- } void openTrgMod(DB x) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(openTrgMod) of DXL code:") ///---------------------------------------------------------------------------------- Item GlobItmStatus = item fullName(m) if(!open module fullName(m)) {errorBox("Working Module Closed!"); return} UnloadedCallBack() Link l = null int index = get(linkSetListView) if (getColumnValue(linkSetListView, index, 7) "" == "In" || getColumnValue(linkSetListView, index, 7) "" == "In {DELETED}") { if(find(cLinks, index, l)) { if(!null l) { ModuleVersion otherVersion = sourceVersion l noError() gotoObject(sourceAbsNo(l), load(otherVersion, true)) err = lastError() delete otherVersion if (!null err) { errorBox(err) } } } else { errorBox("Could no find Updated Link refernece!") } } else if (getColumnValue(linkSetListView, index, 7) "" == "Out" || getColumnValue(linkSetListView, index, 7) "" == "Out {DELETED}") { if(find(cLinks, index, l)) { if(!null l) { ModuleVersion otherVersion = targetVersion l noError() gotoObject(targetAbsNo(l), load(otherVersion, true)) err = lastError() delete otherVersion if (!null err) { errorBox(err) } } } else { errorBox("Could no find Updated Link refernece!") } } else { errorBox("Error on {'Status'}") } err = null ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(openTrgMod) of DXL code:") ///---------------------------------------------------------------------------------- } void switchtargetPathCB (DBE) { Item i = item fnMiniExplorer(switchDB,MINI_EXP_FORMAL_MODS,null,null) if(!null i) { set(targetModField, fullName(i) "") } } void switchlinkPathCB (DBE) { Item i = item fnMiniExplorer(switchDB,MINI_EXP_LINK_MODS,null,null) if(!null i && type (i) == "Link") { active(switchokButton) set(switchlinkModField, fullName(i) "") } else { inactive(switchokButton) warningBox("{Null/Invalid} entry!") } } void targetPathCB (DBE) { Item i = item fnMiniExplorer(editDB,MINI_EXP_FORMAL_MODS,null,null) if(!null i) { set(targetModField, fullName(i) "") } } void linkPathCB (DBE) { Item i = item fnMiniExplorer(editDB,MINI_EXP_LINK_MODS,null,null) if(!null i && type (i) == "Link") { active(okButton) set(linkModField, fullName(i) "") } else { inactive(okButton) warningBox("{Null/Invalid} entry!") } } void FixSoftDeleted(DBE x) { if ( confirm("This script deletes all outgoing/incoming links from selected soft-deleted object(s).\n" //- "Using this will allow objects with the corresponding incoming link(s) to be deleted.\n\n" //- "It proceeds without further interaction.\n\n" //- "It works by undeleting the source object, deleting the link, and soft-deleting the object again.\n\n" //- "Continue?", msgWarning) ) { ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at Start(FixSoftDeleted) of DXL code:") ///---------------------------------------------------------------------------------- Item GlobItmStatus = item fullName(m) if(!open module fullName(m)) {errorBox("Working Module Closed!"); return} UnloadedCallBack() Object othero = null Link l = null ModName_ otherMod = null int max = noElems(linkSetListView) int index = 0 Module xMod = null for index in 0:max-1 do { if (selected(linkSetListView, index)) { if (getColumnValue(linkSetListView, index, 7) "" == "In {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "Out {DELETED}") { if(find(cLinks, index, l)) { ModuleVersion otherVersion = sourceVersion l otherMod = module(otherVersion) if (null otherMod || isDeleted otherMod) {delete otherVersion; continue} xMod = edit(fullName(otherVersion) "", false) if (!isEdit(xMod) and !isShare(xMod)) { xMod = edit(fullName(otherVersion) "", false) if (isRead (xMod)) { warningBox("Source module '" fullName(otherVersion) "' must be open editable!") delete otherVersion continue } } delete otherVersion if (null xMod) { errorBox("{Null} Module") } else { noError() delete l err = lastError() if (!null err) { errorBox(err) } set(linkSetListView, index, 7, "{Fixed}") err = null } } } } } flushDeletions() refresh(m) memoryCleaner(false) //Reset display getLinkSets() cmdDiff(1, false) inactive(SoftdeletedButton) for index in 0:max-1 do { if(getColumnValue(linkSetListView, index, 7) "" == "In {DELETED}" || getColumnValue(linkSetListView, index, 7) "" == "Out {DELETED}") { active(SoftdeletedButton) } } int cmdlnONOFFChoice = get(cmdlnONOFF) if (cmdlnONOFFChoice == 1) infoBox("Done!") ///---------------------------------------------------------------------------------- PrintAllocs("Allocated Objects at End(FixSoftDeleted) of DXL code:") ///---------------------------------------------------------------------------------- } } void tabsShow(Skip skp) { // show all the DBEs in the skip list DBE element for element in skp do { show element } } void tabsHide(Skip skp) { // hide all the DBEs in the skip list DBE element for element in skp do { hide element } } void showSelected(int selectedTab) { int index Skip elementsSkip for elementsSkip in skipTabs do { index = (int key skipTabs) if (index == selectedTab) { tabsShow(elementsSkip) } else { tabsHide(elementsSkip) } } } void tabCb(DBE clicktab) { int i = get clicktab showSelected(i) } bool writeConfig() { string cmd = get(commandline) Stat s = create CONF_DIR string res = null if (null s) { // add directory noError mkdir(CONF_DIR, "") res = lastError if (!null res) errorBox(res) } if(null res) { Stream logBuf = write(fName) logBuf << cmd close(logBuf) return true } return false } string readConfig() { string configData = readFile(fName) if(!null configData) set(cmdlnONOFF, 0) if (fileExists_ fName) { set(commandline, configData) } return "" } void linkSelectionMade(DBE lstv, int sel) { //future code.... active editButton active ButDelete active ButRevert rowcount++; setRowCnt() } // linkSelectionMade void linkDeselection(DBE lstv, int sel) { //future code.... inactive editButton inactive ButDelete inactive ButRevert rowcount--; setRowCnt() } // linkDeselection void linkActivated(DBE lstv, int sel) { openTrgMod(null) } // linkActivated void resetCallback(DBE x) { active(ApplyFilterButton) } void cmdlineCallback(DBE x) { writeConfig() } void reapplyCallback(DBE x) { inactive(ApplyFilterButton) getLinkSets() } //printDB printDB = create("Printing...", styleCentered) printtextbox = richText(printDB, "RTM", "", 1350, 400, true) //editDB editDB = create("Edit Links/Linsets...", styleCentered) sourceModField = field(editDB, "Source module:", "", 30, true) sourceModField -> "top" -> "form"; sourceModField -> "left" -> "form"; sourceModField -> "right" -> "unattached"; sourceModField -> "bottom" -> "unattached" targetModField = field(editDB, "Target module:", "", 30, false) targetModField -> "top" -> "flush" -> sourceModField; targetModField -> "left" -> "unattached"; targetModField -> "right" -> "aligned" -> sourceModField; targetModField -> "bottom" -> "unattached" targetBrowseButton = button(editDB, "Browse...", targetPathCB) targetBrowseButton -> "top" -> "aligned" -> targetModField; targetBrowseButton -> "left" -> "flush" -> targetModField; targetBrowseButton -> "right" -> "unattached"; targetBrowseButton -> "bottom" -> "unattached" linkModField = field(editDB, "Link module:", "", 30, false) linkModField -> "top" -> "flush" -> targetModField; linkModField -> "left" -> "unattached"; linkModField -> "right" -> "aligned" -> targetModField; linkModField -> "bottom" -> "unattached" linkBrowseButton = button(editDB, "Browse...", linkPathCB) linkBrowseButton -> "top" -> "aligned" -> linkModField; linkBrowseButton -> "left" -> "flush" -> linkModField; linkBrowseButton -> "right" -> "unattached"; linkBrowseButton -> "bottom" -> "unattached" string choices[2] = {"Manditory","Overrideable"} optionsRadioBox = radioBox(editDB, "", choices, 0) optionsRadioBox -> "top" -> "flush" -> linkModField; optionsRadioBox -> "left" -> "form"; optionsRadioBox -> "right" -> "unattached"; optionsRadioBox -> "bottom" -> "form" okButton = ok(editDB, "OK", doUpdateLinks); inactive(okButton) close (editDB, true, closeEditCallback) //switchDB switchDB = create("Reverse Linkset and Update Links...", styleCentered) switchlinkModField = field(switchDB, "Link module:", "", 30, false) switchlinkBrowseButton = button(switchDB, "Browse...", switchlinkPathCB) switchlinkBrowseButton -> "top" -> "aligned" -> switchlinkModField; switchlinkBrowseButton -> "left" -> "flush" -> switchlinkModField; switchlinkBrowseButton -> "right" -> "unattached"; switchlinkBrowseButton -> "bottom" -> "unattached" switchoptionsRadioBox = radioBox(switchDB, "", choices, 0) switchoptionsRadioBox -> "top" -> "flush" -> switchlinkModField; switchoptionsRadioBox -> "left" -> "form"; switchoptionsRadioBox -> "right" -> "unattached"; switchoptionsRadioBox -> "bottom" -> "form" switchokButton = ok(switchDB, "OK", DoRevert); inactive(switchokButton) close (switchDB, true, closeReverseCallback) //mainDB // https://www.ibm.com/developerworks/community/forums/html/topic?id=0fe02de7-3f6f-4ce1-bc1d-d82297242acf#89f4a396-971a-4f25-bcae-f472e9726c19 //mainDB = create(m, "Show Module Links..." , styleCentered); modDB_tie(mainDB) mainDB = create("Show Module Links..." , styleCentered) frmButs = frame(mainDB, "V " tempStringOf(Version) " by Jim Ellis", 700, 52) SoftdeletedButton = button(mainDB, "Soft-Deletions (Fix)", FixSoftDeleted); inactive(SoftdeletedButton) SoftdeletedButton->"left"->"inside"->frmButs; SoftdeletedButton->"top"->"inside"->frmButs ButDelete = button(mainDB, "Delete", DoDelete); inactive(ButDelete) ButDelete->"left"->"spaced"->SoftdeletedButton; ButDelete->"top"->"inside"->frmButs ButRevert = button(mainDB, "Reverse", switchLinkset); inactive(ButRevert) ButRevert->"left"->"spaced"->ButDelete; ButRevert->"top"->"inside"->frmButs editButton = button(mainDB, "Edit", editLinkset); inactive(editButton) editButton->"left"->"spaced"->ButRevert; editButton->"top"->"inside"->frmButs ButPrint = button(mainDB, "Print (RTM)", printRTM) ButPrint->"left"->"spaced"->editButton; ButPrint->"top"->"inside"->frmButs ButHelp = button(mainDB, "Help", DoHelp) ButHelp->"left"->"spaced"->ButPrint; ButHelp->"top"->"inside"->frmButs curRow = field(mainDB, "Selected:", "", 12, true) curRow->"left"->"spaced"->ButHelp; curRow->"top"->"inside"->frmButs theTab = tab(mainDB, tabStrings, 30, 30, tabCb) theTab->"left"->"form" theTab->"right"->"form" theTab->"top"->"form" theTab->"top"->"flush"->frmButs //theTab->"bottom"->"form" Frame1 = frame(mainDB, "(Hint: Hit 'Enter' to activate 'Apply')", 50, 50) put(skipFrame1, Frame1, Frame1) Frame1->"left"->"inside"->theTab Frame1->"right"->"inside"->theTab Frame1->"top"->"inside"->theTab Frame1->"bottom"->"inside"->theTab RegularExpression = field(mainDB, "Reg Exp:", ".*", 40, false) put(skipFrame1, RegularExpression, RegularExpression) RegularExpression->"left"->"inside"->Frame1; RegularExpression->"top"->"inside"->Frame1 set(RegularExpression, resetCallback) string ModuleorLink[] = {"Module", "LinkModule"} ModuleorLinkONOFF = radioBox(mainDB, "Filter on:", ModuleorLink, 0) put(skipFrame1, ModuleorLinkONOFF, ModuleorLinkONOFF) ModuleorLinkONOFF->"left"->"spaced"->RegularExpression; ModuleorLinkONOFF->"top"->"inside"->Frame1 set(ModuleorLinkONOFF, resetCallback) string filteringLinks[] = {"Out", "In", "All"} FilterLinkTypes = radioBox(mainDB, "", filteringLinks, 0) put(skipFrame1, FilterLinkTypes, FilterLinkTypes) FilterLinkTypes->"left"->"spaced"->ModuleorLinkONOFF; FilterLinkTypes->"top"->"inside"->Frame1 set(FilterLinkTypes, resetCallback) ApplyFilterButton = button(mainDB, "Apply", reapplyCallback) put(skipFrame1, ApplyFilterButton, ApplyFilterButton) ApplyFilterButton->"left"->"spaced"->FilterLinkTypes; ApplyFilterButton->"top"->"inside"->Frame1 inactive(ApplyFilterButton) Frame2 = frame(mainDB, "Compare cmd", 50, 50) put(skipFrame2, Frame2, Frame2) Frame2->"left"->"inside"->theTab Frame2->"right"->"inside"->theTab Frame2->"top"->"inside"->theTab Frame2->"bottom"->"inside"->theTab commandline = field(mainDB, "Commandline Syntax (Hint: Hit 'Enter' to activate 'Save')", "", 150, false) put(skipFrame2, commandline, commandline) commandline->"left"->"inside"->Frame2; commandline->"top"->"inside"->Frame2 set(commandline, cmdlineCallback) string cmdONOFF[] = {"On", "Off"} cmdlnONOFF = radioBox(mainDB, "", cmdONOFF, 1); readConfig() put(skipFrame2, cmdlnONOFF, cmdlnONOFF) cmdlnONOFF->"left"->"spaced"->commandline; cmdlnONOFF->"top"->"inside"->Frame2 linkSetListView = listView(mainDB, listViewOptionMultiselect|listViewOptionSortText, 1180, 30, dummy) //listViewOptionSortText, listViewOptionMultiselect linkSetListView->"top"->"flush"->theTab; linkSetListView->"bottom"->"form" set(linkSetListView, linkSelectionMade, linkDeselection, linkActivated) put(skipTabs, 0, skipFrame1) // key must match the tab index returned by get(theTab) put(skipTabs, 1, skipFrame2) close (mainDB, true, closeCallback) realize(mainDB) setExtraWidthShare(commandline, 1.0) set(theTab, 0) showSelected(0) insertColumn(linkSetListView, 0, "ID", 60, iconNone); set(linkSetListView, 0, doSortInt) // Allow sorting this column insertColumn(linkSetListView, 1, "Object Heading/Text", 150, iconNone) insertColumn(linkSetListView, 2, "Source/Target Module", 300, iconFormal); set(linkSetListView, 2, doSortString) // Allow sorting this column insertColumn(linkSetListView, 3, "ID", 60, iconNone); set(linkSetListView, 3, doSortInt) // Allow sorting this column insertColumn(linkSetListView, 4, "Object Heading/Text", 150, iconNone) insertColumn(linkSetListView, 5, "Link Module", 250, iconLink); set(linkSetListView, 5, doSortString) // Allow sorting this column insertColumn(linkSetListView, 6, "Baseline", 90, iconNone); set(linkSetListView, 6, doSortStringReverse) // Allow sorting this column insertColumn(linkSetListView, 7, "Status", 90, iconNone); set(linkSetListView, 7, doSortStringReverse) // Allow sorting this column if(writeConfig()) { getLinkSets() cmdDiff(0, true) if(FoundSoftdeletedLinks) { active(SoftdeletedButton) } } else { errorBox("Error: Config File!") } show(mainDB)