View previous topic :: View next topic |
Author |
Message |
brucebowler Guest
|
Posted: Tue Jun 19, 2007 4:19 pm Post subject: weird result passing character array to subroutine |
|
|
Imagine if you will the following simple bit of code
Code: | program test
character (len=80) :: array(25)
call sub(array)
end program test
subroutine sub(a)
character (len=*) :: a(*)
a(1) = 'abc'
return
end subroutine sub |
Run it in the debugger. Step into sub. open the 'vars' window, if it's not already open. Notice that the dimension of a is shown as (*Invalid*). Why? What can be done to make it show the correct value? I don't care so much about the debugger, but because it's "wrong" the size intrinsic returns an incorrect value, which makes allocating similarly sized arrays "problematic".
This is version 5.01. Don't know if it happens with 5.1 |
|
Back to top |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2554 Location: Sydney
|
Posted: Wed Jun 20, 2007 3:48 am Post subject: |
|
|
Bruce,
FTN95 Version 4.9.1 provides the correct array dimension and size in the Vars window.
John |
|
Back to top |
|
|
|