- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This code produces an unallocated result. I tried using
/assume:realloc_lhs but it also failed.
[bash]pure function strFromReal(a) result(str) real, intent(in) :: a character(25) temp character(:), allocatable :: str write(temp, *) a str = trim(adjustl(temp)) end function[/bash]
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using IVF 11.1.65 with VS 2008.
Actually I think it is Visual studio integration that is failing. When I watch variable str at the end of the function I get an Index out of bounds error.
However, if I assign str back to temp again I get a good result for temp.
Actually I think it is Visual studio integration that is failing. When I watch variable str at the end of the function I get an Index out of bounds error.
However, if I assign str back to temp again I get a good result for temp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think that we know about deferred-length character variables not displaying properly in the debugger. I tried your code with an internal build of our next major release and I could see the value once it was allocated and assigned. Your code should work in the 11.1.065 compiler.

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