View previous topic :: View next topic |
Author |
Message |
Abhishek
Joined: 22 Dec 2010 Posts: 28
|
Posted: Thu Dec 23, 2010 7:01 am Post subject: Legacy program exes conversion to dlls |
|
|
Hi
I have some FORTRAN exes which I now want to convert to dlls callable from my VB .NET Code.
At present these exes take input from files on disk and their names are hard coded inside the FORTRAN code. Each program makes some output files which are then used by the subsequent FORTRAN program.
I need to convert these to dll so that each program can in fact become a subroutine. Instead of taking input from files on disk, I intend to pass the file contents as string argument and instead of saving output to disk, I intend to recieve the file contents as string output.
All the programs currently use the FORMATTED READ and WRITE statements heavily and I am thinking of using internal READ/WRITE on character variables instead of files.
The problem I foresee is in the fact that the READ internal statement remains at the beginning of the string and so the subsequent READ statements all fail.
Any advise on above ?
Thanks
Abhishek |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2415 Location: Yateley, Hants, UK
|
Posted: Thu Dec 23, 2010 3:28 pm Post subject: |
|
|
My advice is not to make too many changes at any one time. If all of the subroutines across all of the legacy programs have unique names, then you can simply make all of the PROGRAM routines into subroutines, and call each program in turn.
Indeed, you can keep all of your legacy programs as standalone programs, and start them one after the other with CALL START_PROCESS@ - then it doesn't matter if each program has some routines with non-unique names.
You can also keep writing to and reading from those hard-coded named files. If the writing is immediately followed by reading, the file contents are probably still held in cache, and you will get memory access speeds!
Then, when you are ready, you can tackle each category of change.
It is highly likely if you invoke all of your legacy programs one after the other in the same order each time that they are all very small, and when you roll them into one larger program it will still be small relative to the size of memory in a modern PC. It was when I did something similar!
Eddie |
|
Back to top |
|
 |
Abhishek
Joined: 22 Dec 2010 Posts: 28
|
Posted: Thu Dec 23, 2010 5:03 pm Post subject: |
|
|
Not to make too many changes at one time is precisely the reason I intend to use the internal READ and WRITE statements.
Right now i am calling each one of the programs as separate processes in my VB .NET code and it is leading to a big performance drag due to disk I/O.
Do you think there is a solution to this internal READ/WRITE issue ?
Thanks |
|
Back to top |
|
 |
|