// GotoFile.vdm - Check file type and execute a macro // // Typically used in User menu instead of calling UTAGS.VDM // // For C files (default), call utags.vdm (find C function from TAGS) // For SEARCH.TMP, go to file that contains string found Num_Push(80,81) // Save numeric registers used here #80 = Reg_Free() // #80 = T-Reg to hold filename/extension // Check filename to decide operation Reg_Set(#80,FILENAME) if (Reg_Compare(#80,"search.tmp") == 0) { // Wildfile Wizard search result? Goto SEARCH_TMP } // other filenames or extensions can be checked here... // Default: C file, use UTAGS.VDM to find function definitioni Reg_Empty(#80) // Empty T-Regs Num_Pop(80,81) // Restore numeric regs Chain_File(Macro_Num,"utags.vdm") Return // Handle operations for Search.tmp file (Wildfile Wizard search result) :SEARCH_TMP: BOL #81 = 1 Match("|W", ADVANCE) if (Match("|D") == 0) { // line number? #81 = Num_Eval(SUPPRESS) Search("|<|A", REVERSE) // find filename } Reg_Copy_Block(#80,CP,EOL_pos) // @#80 = filename File_Open(@#80) // open the file Goto_Line(#81) // go to line containing the match Update() Reg_Empty(#80) // Empty T-Regs Num_Pop(80,81) // Restore numeric regs Reg_Empty(Macro_Num,EXTRA) // Empty this T-Reg; should return Return // Just in case