unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Debug Fortran 90 code in Emacs with arguments.
@ 2022-04-05  2:27 Hongyi Zhao
  2022-04-05 11:18 ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Hongyi Zhao @ 2022-04-05  2:27 UTC (permalink / raw)
  To: help-gnu-emacs

I've the following Fortran 90 code snippet adapted from here [1]:

```
program echo_command_line
  integer i, cnt, len, status
  character c*100, b*100

  call get_command (b, len, status)
  if (status .ne. 0) then
     write (*,*) 'get_command failed with status = ', status
     stop
  end if
  write (*,*) 'command line = ', b (1:len)

  call get_command_argument (0, c, len, status)
  if (status .ne. 0) then
     write (*,*) 'Getting command name failed with status = ', status
     stop
  end if
  write (*,*) 'command name = ', c (1:len)

  cnt = command_argument_count ()
  write (*,*) 'number of command arguments = ', cnt

  do i = 1, cnt
     call get_command_argument (i, c, len, status)
     if (status .ne. 0) then
       write (*,*) 'get_command_argument failed: status = ', status, '
arg = ', i
       stop
     end if
     write (*,*) 'command arg ', i, ' = ', c (1:len)
  end do

  write (*,*) 'command line processed'
  end
```

The above code snippet must be run and debug with some arguments, say,
as follows:

-o 42 -a hello b

So, I want to know how to debug Fortran 90 code in Emacs with arguments.

[1] https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/language-reference/a-to-z-reference/c-to-d/command-argument-count.html#command-argument-count

Regards
-- 
Assoc. Prof. Hongsheng Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-04-07  2:02 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-05  2:27 Debug Fortran 90 code in Emacs with arguments Hongyi Zhao
2022-04-05 11:18 ` Eli Zaretskii
2022-04-05 12:57   ` Hongyi Zhao
2022-04-05 13:00     ` Hongyi Zhao
2022-04-05 13:19       ` Eli Zaretskii
2022-04-05 13:23         ` Eli Zaretskii
2022-04-05 13:52           ` Hongyi Zhao
2022-04-05 14:02             ` Eli Zaretskii
2022-04-05 14:14               ` Hongyi Zhao
2022-04-05 14:19         ` Hongyi Zhao
2022-04-05 15:52           ` Eli Zaretskii
2022-04-06  1:46             ` Hongyi Zhao
2022-04-06  2:32               ` Eli Zaretskii
2022-04-06  3:02                 ` Hongyi Zhao
2022-04-06  2:26             ` Hongyi Zhao
2022-04-06 10:50               ` Eli Zaretskii
2022-04-06 13:05                 ` Hongyi Zhao
2022-04-06 14:12                   ` Eli Zaretskii
2022-04-06 14:42                     ` Hongyi Zhao
2022-04-06 15:42                       ` Eli Zaretskii
2022-04-07  2:02                         ` Hongyi Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).