- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The documentations states that for a character string of the form
v(e1:e2)
"Both e1 and e2 must be within the range 1,2, ..., len, where len is the length of the parent character string. If e1 exceeds e2, the substring has length zero.
So is it safe to have a substring of length 0? I.e., I have code like:
l=len_trim(string) !where string is all blank
call sub(string(1:L))
where sub is like
subroutine sub(string)
character string*(*)
if (len_trim(string) .gt.0) then
do stuff
endif
end
It works, but can it lead to trouble? Do I have to check for this?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's [supposed to be *] safe. Of course, you can't do much with such a string, but LEN and LEN_TRIM will return 0 and assignment will be a no-op. I don't have Standard handy, but I suppose you shouldn't try internal WRITE on it.
Jugoslav
*) However, the feature in question looks like a fertile ground for compiler bugs -- I'm not saying there is an actual one in CVF or IVF, just that it looks obscure enough that it can be a good candidate for overlooking.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[Doesn't really matter, but for information] "Delete message" option can be found under "Options" "menu" on the blue header of each message. It is active only if it is your message and you're logged in.
Jugoslav
Message Edited by JugoslavDujic on 06-18-2004 10:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dunno -- I've just successfully edited myprevious message from this thread, couple of weeks old.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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