- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I am trying to compile a big Fortran program (about 1000 subroutines)that used to be compiled with Lahey under Windows. The code uses Lahey extension of OFFSET() function, which according to Lahey manual:
OFFSET() - Get the DOS offset portion of the memory address of a variable, substring, array reference, or external subprogram.
The particular function is actually very simple:
OFFSET() - Get the DOS offset portion of the memory address of a variable, substring, array reference, or external subprogram.
The particular function is actually very simple:
FUNCTION MEML(ARRAY)
DIMENSION ARRAY(1)
MEML=OFFSET(ARRAY)
RETURN
END
Originally, I used LOC to replace OFFSET function in the above function. HOwever, that results in memory access violation error when running the program. Can somebody give me a hint as to how to convert this particular Lahey fortran extension?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When a nonstandard function such as OFFSET or LOC is seen in a program, it may be suspected that the result returned by such a function is also used in a nonstandard way. Therefore, merely replacing one nonstandard function by another, while allowing the program to be compiled and linked, may not give one a correctly functioning program.
Therefore, it becomes necessary to ask what is done with MEML. The misty reference to DOS offset suggests that OFFSET may return a 16-bit integer, whereas LOC may return a 32 or 64 bit integer.
Therefore, it becomes necessary to ask what is done with MEML. The misty reference to DOS offset suggests that OFFSET may return a 16-bit integer, whereas LOC may return a 32 or 64 bit integer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help. I will look further into the code.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page