- 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
0 Replies

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