- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I finally found lnblnk in libpepcf90mt.lib. When i tried to use it it promptly blew up. So i pasted the "interface" from the intel manual:
INTERFACE
INTEGER(4) FUNCTION LNBLNK(STRING)
!MS$ATTRIBUTES ALIAS:'lnblnk_'::LNBLNK
CHARACTER(LEN=*), INTENT(IN) :: STRING
END FUNCTION
END INTERFACE
Into my code. It doesn't blow anymore but it returns the length of the string instead of the position of the last non-blank character. I looked at the string in hex, there is no null at the end, it's definitely got blanks from character 12 to the end of the string.
Please help, i don't want to have to go back to writing my own routines for stuff that ought to just work. I really don't understand why i had to find these in a library, they are *inline* functions, no?
Thanks,
Greg
PS i'm using Intel fortran 7.0.
Message Edited by gregr@scientech.com on 07-28-2004 09:30 AM
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No - LNBLNK is a "Portability Library" routine, it is not a compiler intrinsic.
I tried the following code in 7.1 and 8.0 and got 7 returned in both cases:
Code:
use iflport character*10 string integer i string = 'A B C D' i = lnblnk(string) write (*,*) i end
I note that in 7.1, I needed to build with /4Yportlib to pull in the portability library - that is not needed in 8.0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You meant:
use ifport
use ifport
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, I didn't. In 7.1, one had to say "use iflport". 8.0 accepts either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, thanks, i'll keep thrashin with it.
Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, here's what the deal was. The string i was lnblnking came from another of my C routines. I had a get_environment routine which called the C getenv which filled in that string i was lnblnking. I swear, there was no null (that the debugger showed me, i looked at it in hex) in that string, but something about it confused the Fortran support lib.

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