The Visual Studio Integrated Development Environment (IDE) is so jam packed full of features for COBOL developers, you’d be forgiven for not knowing them all. To make life easier, we've listed the top 5 features for COBOL development you didn't already know about:
1. Quick Browse
The Quick Browse feature is a powerful tool for searching COBOL programs. Not only can you search for fields and data names, you can also search for use of specific COBOL verbs within your program. For example, to find all the places in your code you’re performing file I-O, just type I-O as the search term to find all open, read, write, close and other I-O verbs your code.
How do I find it? COBOL Toolbar or ALT-Q
Results of the Quick Browse query showing where a field is used in your program
2. Code Definition Window
This is a handy little window which gives you live information about whatever is at the cursor in the main editor windows.
If your cursor is on a field, the Code Window will show you its definition and the code and around that area. If the cursor is on a paragraph or section name, say perform my-section, you’ll see the definition of my-section.
It’s a simple tool but saves you switching gear and navigating somewhere else in the code.
How do I find it? CTRL W D
The code definition window (bottom) showing us the details of whatever is at the cursor is the main editor window (top)
3. Navigate To
Quick Browse showed us how to quickly find points of interest in our code but what if we can’t quite remember the full name of the thing we’re looking. With COBOL data names running to 31 characters it’s no surprise you need some help from time to time.
Bring up the Navigate To dialog and start typing whatever you can remember of the name.
Navigate To shows you a matching list of symbols which you can further refine till you find what you’re looking for. Double-click to go straight to the location.
Where do I find it? Ctrl ,
Navigate To – performs a fuzzy search to help you find what you need
4. Find All References
Hesitating about that edit you’re just about to make? Where else might that field be used?
Find all references shows you at a glance, all the locations in the program a particular field is being used and it also lets you know if that line of code is modifying the value or just referencing it.
Where do I find it? Context menu on a field in the editor and choose Find All References
The results of a find all references query
5. Column Block Marking
Sometimes regular block selection won’t cut the mustard and what you really need to do is mark a group of columns. No problem. Better still, there’s a neat copy and paste trick you can do.
Where do I find it? Just press the Alt key whilst selecting some text
Before and after screenshots using column block selection with copy and paste
Of course we couldn’t just stop at 5, here’s a few more you should know about too...
6. View Whitespace
What to see whitespace such as tabs and space characters?
Where do I find it? Edit Advanced View White Space
7. Go To Definition
Want to see the definition of a field? Place the cursor over the item and just hit F10 to go straight to the definition of a field or section. You can even use this command to open a copybook .
Where do I find it: F10
8. Navigate Backward and Forward Keys
Just navigated somewhere in your program and want to go back to where you came from? Use the navigate forward and backward keys to take you back to where you’ve just come from.
Where do I find it? On the standard tool bar. Look for the blue arrows
Try it out
Get started - Visual COBOL 2.2 for Visual Studio has just been launched and you can try these top 5 tips for yourself by taking a free trial.
Thanks to Product Manager Scot Nielsen for posting this.