4Misc_Start(#4Platform@9VersionCheck xHH@Rg(HHdh xHH@Rg(HHdh x HH@Rg(HHdh ^Graph*]WDashSettings#  !4 4 4 4 4 4 jhome66djhd:Work:For Igor Users:]RecentWindows)Igor Reference.ihfPanel0Subwindows.ihf 4Misc_End(#XOPState_Start(#SQL64eference.ihfPanel0VISA64 Input.pxpXTest3-64Input.pxpXTestStructs64XTest7-64owser.ipfWaveRefTest-644XOPState_End(#\t•NewPanel •Button DoItButton title="Do It",proc=DoItButtonProc •Make/O/N=5 jack = p •Edit/HOST=# jack.id !yT``jack?????@@@@*// Platform=Macintosh, IGORVersion=9.000, architecture=Intel, systemTextEncoding="MacRoman", historyTextEncoding="UTF-8", procwinTextEncoding="UTF-8", recreationTextEncoding="UTF-8", build=37840 #pragma TextEncoding = "UTF-8" Silent 101 // use | as bitwise or -- not comment. DefaultFont "Helvetica" MoveWindow/P 11,45,1048,747 Panel0() MoveWindow/C 4,758,1211,1022 KillStrings/Z root:gWMSetNextTextFilesTextEncoding Window Panel0() : Panel PauseUpdate; Silent 1 // building window... NewPanel /W=(828,45,1182,291) Button DoItButton,pos={1.00,1.00},size={50.00,20.00},proc=DoItButtonProc Button DoItButton,title="Do It" Edit/W=(36,36,324,215)/HOST=# jack.xy ModifyTable format(Point)=1 RenameWindow #,T0 SetActiveSubwindow ## EndMacro #pragma TextEncoding = "UTF-8" #pragma rtGlobals=3 // Use modern global access method and strict wave access #pragma DefaultTab={3,20,4} // Set default tab width in Igor Pro 9 and later Function HandleDoItButtonClicked(String panelName) String tablePath = panelName + "#" + "T0" GetSelection table, $tablePath, 1 int startRow = V_StartRow int endRow = V_EndRow int startCol = V_StartCol int endCol = V_EndCol Printf "Table selection = (%d,%d),(%d,%d)\r", startRow, startCol, endRow, endCol GetSelection table, $tablePath, 2 String columnNameList = S_selection GetSelection table, $tablePath, 4 String dataFolderPathList = S_dataFolder String firstColumnName = StringFromList(0, columnNameList) // wave0.d, wave0.x, wave0.i, wave0.l int len = strlen(firstColumnName) String firstColumnNameSuffix = firstColumnName[len-2,len-1] // .d, .x, .i, .l String firstWaveName = firstColumnName[0,len-3] // wave0 // Print firstColumnName, firstColumnNameSuffix, firstWaveName if (CmpStr(firstColumnNameSuffix,".d") != 0) Print "The first selected column is not a data column" return -1 endif String firstDataFolderPath = StringFromList(0, dataFolderPathList) String firstWavePath = firstDataFolderPath + firstWaveName WAVE/Z w = $firstWavePath if (!WaveExists(w)) Print "No wave is selected" return -1 endif Printf "First wave selected = %s\r", firstWavePath // This assumes that the first selected wave is 1D numeric double value = w[startRow] Printf "First selected value = %g\r", value return 0 End Function DoItButtonProc(ba) : ButtonControl STRUCT WMButtonAction &ba switch (ba.eventCode) case 2: // mouse up // Print "Do It Button Clicked" HandleDoItButtonClicked(ba.win) break endswitch return 0 End