#pragma rtGlobals=1 // Use modern global access method // author: Thomas Braun thomas.braun@byte-physics.de // 3/2014 Function copyListToWave(list, textWave, col) string &list Wave/T textWave variable col variable numEntries = ItemsInList(list,";") variable i for(i=0; i < numEntries; i+=1) textWave[i][col] = StringFromList(i,list,";") endfor End // Gather all data for one igor version Function gatherData() string opList = OperationList("*",";","internal") string funcList = FunctionList("*",";","KIND:5") string info = IgorInfo(3) string version = StringByKey("IGORFILEVERSION",info) string list = opList + funcList string wvName = "v" + ReplaceString(".",version,"") Make/O/T/N=(ItemsInList(list),1) $wvName Wave/T wv = $wvName Note wv, "Platform:" + StringByKey("OS",info) Note wv, "IgorFileVersion:" + version printf "Writing wave \"%s\"\r", wvName copyListToWave(list,wv,0) End // Merge all data from multiple igor versions // allData layout // row dimension labels: named after all functions/operations known to the most recent version of IP // colum dimension labels: IP version string // entries: one if known, zero otherwise // Look at the table with Edit root:allData.ld Function assembleData() SetDataFolder root: string df = "root:FuncOpData" variable numDataWaves = CountObjects(df,1) Make/O/T/N=(numDataWaves) names variable index = 0 variable maxEntries = 0 do string objName = GetIndexedObjName(df, 1, index) if (strlen(objName) == 0) break endif names[index] = df + ":" + objName Wave/T wv = $names[index] maxEntries = max(DimSize(wv,0),maxEntries) index += 1 while(1) // we have note as function and Note as operation // as dim labels are case insensitive, we can not distinguish them so we cheat be renaming variable j for( j=0 ; j < numDataWaves; j+=1 ) Wave/T wv = $names[j] FindValue/TXOP=5/TEXT="Note" wv wv[V_Value] = "Note_" endfor Sort/R names, names Make/O/I/N=(maxEntries,numDataWaves) allData allData = 0 // labelData is the wave with the highest version data // and which has by our assumption the most entries Duplicate/O/T $names[0], labelData Sort/C labelData, labelData // Set row labels to the function and operation names variable i for( i=0 ; i < maxEntries; i+=1 ) string lbl = labelData[i] SetDimLabel 0, i, $lbl, allData endfor for( j=0 ; j < numDataWaves; j+=1 ) Wave/T wv = $names[j] // column labels to the igor version string version = StringByKey("IgorFileVersion",note(wv),":","\r") SetDimLabel 1, j, $version, allData // and mark all occurences of a specific function/operation with 1 for( i=0 ; i < DimSize(wv,0); i+=1 ) variable row = FindDimLabel(allData,0,wv[i]) // dim labels are case insensitive so we have to check the case here if( row >= 0 && cmpstr(wv[i],GetDimLabel(allData,0,row),1) == 0 ) allData[row][j] = 1 else // we are not interested in upward compatibility // so we do nothing here endif endfor endfor KillWaves names, labelData End // Returns a list of all functions/operations which are unknown in more recent Igor versions Function/S getUnknownFuncOps(allData, lastValidCol) Wave allData variable lastValidCol if(lastValidCol <= 0) return "" endif if(lastValidCol >= DimSize(allData,1)) print "Invalid column" return "" endif variable row string list = "" for(row = 0; row < DimSize(allData,0); row+=1) // The function or operation in lastValidCol is unknown if( allData[row][lastValidCol] == 0 ) string funcOp = GetDimLabel(allData,0,row) list = AddListItem(funcOp,list,";",inf) endif endfor return list End // Checks a procedure for unknown operations/functions Function CheckProcedure(procFile, highestPossibleVersion) string procFile string highestPossibleVersion string procList = WinList("*",";","WIN:128") if(WhichListItem(procFile,procList) == -1) printf "Unknown procedure %s\r", procFile return 1 endif Wave/T allData = root:allData variable lastValidCol = FindDimLabel(allData,1,highestPossibleVersion) if(lastValidCol < 0) printf "Could not find the requested version data %s\r", highestPossibleVersion return 1 endif string procText = ProcedureText("",0,procFile) string unknownFuncOpList = getUnknownFuncOps(allData, lastValidCol) // printf "Unknown operations/functions in %s\r", highestPossibleVersion variable numItems = ItemsInList(unknownFuncOpList) variable i for(i=0; i < numItems; i+=1) string unknownFuncOp = StringFromList(i,unknownFuncOpList) printf "\t%s\r", unknownFuncOp if( strsearch(procText,unknownFuncOp,0,2) != -1 ) printf "Found %s!\r", unknownFuncOp return 1 endif endfor return 0 End Function outputUnknownFunctions(highestPossibleVersion) string highestPossibleVersion Wave/T allData = root:allData variable lastValidCol = FindDimLabel(allData,1,highestPossibleVersion) if(lastValidCol < 0) printf "Could not find the requested version %s\r", highestPossibleVersion return 1 endif string unknownFuncOpList = getUnknownFuncOps(allData, lastValidCol) printf "Unknown operations/functions in %s\r", highestPossibleVersion variable numItems = ItemsInList(unknownFuncOpList) variable i for(i=0; i < numItems; i+=1) string unknownFuncOp = StringFromList(i,unknownFuncOpList) printf "\t%s\r", unknownFuncOp endfor return 0 End Function outputAll() outputUnknownFunctions("6.3.4.1") outputUnknownFunctions("6.2.2.2") outputUnknownFunctions("6.1.2.1") outputUnknownFunctions("6.0.6.0") if( CheckProcedure("Procedure", "6.0.6.0") == 0) printf "\rMain procedure window is likely compatible to IP 6.0\r" endif End