- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I declare variables in a module. However I could not "VIEW" the variables' value when I "Step Into" the function defined in module (in debug window of Visual Studio 2003 shows "Undefined variable XXXXXXX"). Do I miss some options?
The following is the Fortran program source code I used to test/debug the module. How could I debug the variable int_a declare in module, when I "Step Into" the function "print_a", for example?
Thanks for answer.
!------Begin Dbg_Module.f90-------
program Dbg_Module
use Mod_Test
implicit none
call print_a()
end program Dbg_Module
!------End Dbg_Module.f90-------
!------Begin Mod_Test.f90-------
module Mod_Test
implicit none
integer :: int_a = 0
contains
subroutine print_a()
implicit none
int_a = 5
print *, "int_a = ", int_a
end subroutine print_a
end module Mod_Test
!------End Mod_Test.f90-------
I declare variables in a module. However I could not "VIEW" the variables' value when I "Step Into" the function defined in module (in debug window of Visual Studio 2003 shows "Undefined variable XXXXXXX"). Do I miss some options?
The following is the Fortran program source code I used to test/debug the module. How could I debug the variable int_a declare in module, when I "Step Into" the function "print_a", for example?
Thanks for answer.
!------Begin Dbg_Module.f90-------
program Dbg_Module
use Mod_Test
implicit none
call print_a()
end program Dbg_Module
!------End Dbg_Module.f90-------
!------Begin Mod_Test.f90-------
module Mod_Test
implicit none
integer :: int_a = 0
contains
subroutine print_a()
implicit none
int_a = 5
print *, "int_a = ", int_a
end subroutine print_a
end module Mod_Test
!------End Mod_Test.f90-------
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is discussed in the Building Applications manual section on using the debugger:
Specifying Module Variables
To view a module variable in a Watch window, specify the module name, followed by "::", followed by the variable name.
For example, to watch variable "bar" of module "foo", specify the following expression:
foo::bar
Specifying Module Variables
To view a module variable in a Watch window, specify the module name, followed by "::", followed by the variable name.
For example, to watch variable "bar" of module "foo", specify the following expression:
foo::bar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
I got it. Thank you for your help.
Yuehfang

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