有没有办法在 Fortran 的控制台中隐藏游标 运行 时间?
Is there possible way to hide cursor inter run time in console In Fortran?
我写了一个特定的软件,这个运行可以生成6个随机数在不同范围内的文件。
但是,我想在 运行.[=24 时隐藏 光标=]
• Is there any possible way to do this?
• Update •
:: 答案 来自 @Daniel R Livingston
• Solve the case with something minors adaptation on 1st post: ::
"首先,打印转义码\e[?25l
会隐藏你的光标。
\e[?25h
"will re-enable it."
write (*,*)char(27)//char(91)//char(63)//char(50)//char(53)//char(108)
! For some reason, by using the 'result = systemqq'
! May force the screen to "apply" the line above, only
! After this, that escape gone works in Windows!
result = systemqq('@cls &@%windir%'//char(92)//'system32'//char(92)//'chcp.exe 850 2>nul >nul 1<&2&@color 0a')
write (*,*)char(27)//'[37;41;4m'//char(255)//char(250)//char(255)//'Generating',x,' Random Numbers!',char(27)
&//'[0m'//char(10)//char(10)
! Obs.: --------------------------------------------------------------------
! Turn the cursor back by adding:
! write (*,*),char(27)//'[?25h' before end program (latest line)
! \e[?25l == char(27)//char(91)//char(63)//char(50)//char(53)//char(108)
有两种方法。
首先,打印转义码 \e[?25l
将隐藏您的光标。 \e[?25h
将重新启用它。
其次,通过调用 Windows API:
BOOL WINAPI SetConsoleCursorInfo(
_In_ HANDLE hConsoleOutput,
_In_ const CONSOLE_CURSOR_INFO *lpConsoleCursorInfo
);
我写了一个特定的软件,这个运行可以生成6个随机数在不同范围内的文件。
但是,我想在 运行.[=24 时隐藏 光标=]
•
Is there any possible way to do this?
• Update •
:: 答案 来自 @Daniel R Livingston
• Solve the case with something minors adaptation on 1st post: ::
"首先,打印转义码\e[?25l
会隐藏你的光标。
\e[?25h
"will re-enable it."
write (*,*)char(27)//char(91)//char(63)//char(50)//char(53)//char(108)
! For some reason, by using the 'result = systemqq'
! May force the screen to "apply" the line above, only
! After this, that escape gone works in Windows!
result = systemqq('@cls &@%windir%'//char(92)//'system32'//char(92)//'chcp.exe 850 2>nul >nul 1<&2&@color 0a')
write (*,*)char(27)//'[37;41;4m'//char(255)//char(250)//char(255)//'Generating',x,' Random Numbers!',char(27)
&//'[0m'//char(10)//char(10)
! Obs.: --------------------------------------------------------------------
! Turn the cursor back by adding:
! write (*,*),char(27)//'[?25h' before end program (latest line)
! \e[?25l == char(27)//char(91)//char(63)//char(50)//char(53)//char(108)
有两种方法。
首先,打印转义码 \e[?25l
将隐藏您的光标。 \e[?25h
将重新启用它。
其次,通过调用 Windows API:
BOOL WINAPI SetConsoleCursorInfo(
_In_ HANDLE hConsoleOutput,
_In_ const CONSOLE_CURSOR_INFO *lpConsoleCursorInfo
);