The Go To First Link command locates the first source link and does the following:
1.It selects the link line in the link source file.
2.It selects the link line in the link target file.
3.It ensures both files are visible on the screen in windows. If the current window was maximized when this command was used, then only the link target file will be made visible.
The Go To Next Link and Go To Previous Link commands do the same thing, except with the next and previous source link, respectively.
The "first source link" is the first link in the link source file with which a Go To Link Location command was used. For example, if you used the Search Files command to create a Search Results file containing source links, and then you used the Go To Link Location command on a line in the Search Results window, the first source link is determined to be the first link in the Search Results window.
The Go To First Link, Go To Next Link, and Go To Previous Link commands are used to quickly skip from link to link, and are especially useful when the source links are connecting compiler error messages and program source lines.
If you spawn the compiler from Source Insight, using a custom command, and the output is captured and parsed for error messages, then you can use Go To First Link and Go To Next Link to view each error in your source files.
When you define the "Compile File" custom command, you should have the "Parse Source Links" option on. Source Insight will then search the compiler output and setup source links for each error message. In this case, the "link sources" are each error message in the compiler output file. The "link target" for each link is the file and line number given in each error message.
To view source lines with errors
To run a build or compile command, and let Source Insight position to each error message:
1.Run the "Compile File" or "Build Project" custom command, which is defined as described at Creating a Compile and Build command.
2.Assuming there are errors, when the compiler finishes the error messages will be in a command output window. Source Insight will automatically setup the source links and run the Go To First Link command. The first error message and the erroneous source line will be selected and made visible.
3.Run the Go To Next Link command. The next error message in the command output window is selected, and the target of that link is shown, as was the first error.
4.Continue to use the Go To Next Link command until all the links (error messages) have been visited. If there are no more links, then Source Insight beeps and the message, "No links." will appear in the status bar.
The Search Files command puts its output into a Search Results window. Along with each line of text in the Search Results window is a source link. In this case, the "link sources" are each line in the Search Results window. The "link target" for each link is the file and line where the search pattern was found.
To view each place where a pattern was found:
To perform a search and then visit each place where the pattern was found:
1.Run the Search Files command.
2.Use the Go To First Link command to see the first match.
3.Use the Go To Next Link command to see successive matches.
4.Continue using the Go To Next Link command until the "No Links." message appears.