Caché Studio : How to find and record all global variables referenced in routine or collection of routines?
I am looking to run some analysis on existing software to quickly identify global variable references. Ideally you would feed in a "starting routine" and after going through all referenced routines you would end up with a finite set of global variables. So the primary purpose is to take say 10,000 lines of code and map out the referenced global structures without relying on a programmers eye. I found the post on Object Script equivalent to Studio "Find in Files" interesting but the downside is that output is too verbose and would require parsing to extract the global structures. How would you override writing to the terminal so that you could parse the data?
The Find & Replace option in Caché Studio is also interesting as it allows you to filter by Language=Cache ObjectScript and Element=Global Variable. You can also change the scope to Element=Routine to identify routines but unfortunately 'Find What' is mandatory so there appears to be no option to simply find all Routine calls within the current document without a search prefix.
The example below is for finding all references to % Routines within the currently opened document
Could you achieve a similar result from the terminal with the output being a simple collection of either routine names or global variable names?