Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INI File or Registry 1

Status
Not open for further replies.

coboldave

MIS
Dec 20, 2001
41
US
Running RM/Cobol version 7.00.03, what is the most efficient way to specify data paths? Presently I am using the following method and mapping the drive. What I would like to do is create a shortcut to the menu object file and the data path is known from the ini file or registry.

Batch file:
@echo off
@c:\rmc\RUNCOBOL e:\apl\MUSRUN K X=..\WINDOWS.CFG
@call JCLEXE00.bat

Line code:
012400 01 EF-NAME.
012600 03 FILLER PICTURE X(7) VALUE "../apl/".
012600 03 FILLER PICTURE X(6) VALUE "IVEXPL".
012800 03 EFGG PICTURE 99 VALUE ZERO.
013000 03 FILLER PICTURE XXXX VALUE ".dat".

All help appreciated
 
I'm not quite sure what you are asking. The most efficient way to access files is by their complete pathname. If you know their complete pathname you can enter them into the registry by using the ini2reg.exe utility.

For example: ini2reg.exe c:\mydata\runcobol.ini
where runcobol.ini includes something like:

[DEFAULT SYNONYMS]
RUNPATH=<Your Runpath>

[PROGRAM-A]
OPTIONS=K X=WINDOWS.CFG
[PROGRAM-A SYNONYMS]
FILE-A=e:\appl\inxfa.dat

Hope this helps.

-Rob

 
If you ever wrote a multi-user database app, you wouldn't be asking this question...[dazed]
So, put the ini-file in the same place as the executable is, and read the ini from there. Then open any path relative from the application directory. You'll then have accieved:
a) Every user is using the same data...
b) The app is portable between OS's
c) If you move the app to another place (dir) or another server you won't even have to change the ini-file, only the way(path) to start the app has to change

There are more advantages, but you must by now understand what I'm trying to say ;-)

Ok, I'll also give you a disadvantage:
a) Everyone has access to the settings and can change them :-(

HTH,
TonHu
 
Thanks xyzzy! That's what I was looking for. Unfortunately, Liant does not provide very good documentation on this subject. My app is now working from the ini imported into the registry. It now enables me to provide a unique datapath and no one can change it without registry editing permissions.
 
I use this its similar to your way but you do not need to map the drive you only need to know the names of the networked computers

select some-file assign to disk
\\somecomputername\apl\whaterfilename.txt

the batch file can also contain
@\\mycomputer\c\rmc\runcobol.exe \\othername\d\folder\prog

then you can run from any computer and nobody has to map drives Hope I wasn't having a Senior moment when I read
your post.
Enjoy Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top