Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Вопросы программирования на FORTRAN (ФОРТРАН)

Модерирует : ShIvADeSt

 Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

Открыть новую тему     Написать ответ в эту тему

akaGM

Platinum Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

Код:
program echo_command_line
  integer i, cnt, len, status
  character c*30, b*100
  call get_command (b, len, status)
  if (status .ne. 0) then
    write (*,*) 'get_command failed with status = ', status
    stop
  endif
  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)
  enddo
  write (*,*) 'command line processed'
end
   
If the above program is invoked with the command line
" echo_command_line.exe -o 42 -a hello b",
the following is displayed:
 
  command line = echo_command_line.exe -o 42 -a hello b
  command name = echo_command_line.exe
  number of command arguments = 5
  command arg 1 = -o
  command arg 2 = 42
  command arg 3 = -a
  command arg 4 = hello
  command arg 5 = b
  command line processed

Всего записей: 24121 | Зарегистр. 06-12-2002 | Отправлено: 16:41 10-06-2010 | Исправлено: akaGM, 16:53 10-06-2010
Открыть новую тему     Написать ответ в эту тему

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Вопросы программирования на FORTRAN (ФОРТРАН)


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru