Highlighted
Contributor.
Contributor.
1463 views

Newbie needs help debugging

The executable I want to debug is in C:\PSMJ\bin\Release, but the data files the program accesses are in c:\Surveys\Bonus\2011.  When I start debugging it immediately tells me it can't find the files referenced in the program.  How can I tell the debugger where to look for the data files?

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Newbie needs help debugging

If you are debugging you should have your build type set to debug and your executable should be in C:\PSMJ\bin\Debug not Release.

What do your select/assign statements look like for your files?

You can include the full path to the filename in the ASSIGN clause like:
       select my-file assign to "c:\Surveys\Bonus\2011\myfile.dat"

If you are only specifying the base filename without a path then you could change your working folder to be:
        c:\Surveys\Bonus\2011 on the properties page-->Debug tab.

There are many different optons to use including assigning to environment variables or to data items or using MFEXTMAP.

Please look at the docs under the File Handler section here:

Thanks.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Newbie needs help debugging

One other thing that you can try is to set the environment variable COBDATA to point to the folder where your files are.

Right click on your project name and choose add->New Item and then select Application Configuration file.

Then right click on app.config under your project name and select Edit.

Set variable name to COBDATA and value to c:\Surveys\Bonus\2011

Now if your program is opening myfile.dat it will search for it in your data folder.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.