ZZPRINT a handy way to view routine lines from the command line
Often when debugging COS code you get an error message such as '<UNDEFINED>test^routine *test' so the first thing you want to do is to take a look at this code and see what it is doing. From the command line you can:
ZLOAD routine ZPRINT test
Which means splitting the $zerror information into the routine name and the line and adding the zload/zprint commands. Also you often want to view the lines above the one where the error happened as this gives you some context of how you got to this line, using ZPRINT you could 'ZPRINT +1:test' but that may display hundreds of lines.
Since 2013.1 you can use ZZPRINT as follows:
Which will print the 10 lines before the 'test^routine' line, so here you can cut/paste the line reference directly into the command and you can specify the number of lines before or after using this syntax where both the before or after can be blank:
ZZPRINT "<entry+offset^routine>":<before lines>:<after lines>
Also since 2015.2 you can display the current $zerror line with and the ten lines before with:
Also if you are in the command line debugger then you can display the current break point location with:
Will display the current location and 5 lines previous and 5 lines after.