From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Debug Fortran 90 code in Emacs with arguments.
Date: Tue, 5 Apr 2022 10:27:41 +0800 [thread overview]
Message-ID: <CAGP6POLBR1anOiagmpzeJ_EGmPsFg08YVHHP1gH2rKuEHOTS7w@mail.gmail.com> (raw)
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
next reply other threads:[~2022-04-05 2:27 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-05 2:27 Hongyi Zhao [this message]
2022-04-05 11:18 ` Debug Fortran 90 code in Emacs with arguments 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGP6POLBR1anOiagmpzeJ_EGmPsFg08YVHHP1gH2rKuEHOTS7w@mail.gmail.com \
--to=hongyi.zhao@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.