- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I asked a question before dealing with declaring arrays, and 'wilkinson' gave me this example code....
module data
integer max_element
integer, allocatable :: global_array(:)
end module data
prog.f90
program main
use data
integer i
max_element = 1000
allocate (global_array(max_element))
do i = 1, max_element
global_array(i) = i
end do
call sub
end subroutine sub
use data
type *, global_array(max_element/2)
return
end
I used the idea of the code and it worked perfectly. But on the line...
type *, global_array(max_element/2)
what exactly does the ' *, ' do? and how could this line be changed so it wont be prompted in MSDos mode. (I mean...when I run the program, the DOS window fills with zeros every time this line is run, how could I avoid this)
module data
integer max_element
integer, allocatable :: global_array(:)
end module data
prog.f90
program main
use data
integer i
max_element = 1000
allocate (global_array(max_element))
do i = 1, max_element
global_array(i) = i
end do
call sub
end subroutine sub
use data
type *, global_array(max_element/2)
return
end
I used the idea of the code and it worked perfectly. But on the line...
type *, global_array(max_element/2)
what exactly does the ' *, ' do? and how could this line be changed so it wont be prompted in MSDos mode. (I mean...when I run the program, the DOS window fills with zeros every time this line is run, how could I avoid this)
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just remove it, I just included it to show that indeed there was data in the newly allocated array, but it doesn't add any functionality.
James
James

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