我想清除屏幕的一部分 - 如何? [英] I want to clear a portion of screen - How??

查看:106
本文介绍了我想清除屏幕的一部分 - 如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想从当前位置清除以上三行,

以便我可以从那一点开始打印我的结果。简而言之,我想要清除我屏幕的一部分。


注意:我使用gcc编译器在UNIX环境中工作。我不是一个

超级用户。


我想要一个简单的解决方案。


我尝试了\\\的组合。逃逸序列。但是\b不是

带我回到上面一行?

我急需这把钥匙。

请帮我实现这个。


我每天都会访问我的主题,看看我是否得到了答案!

谢谢。

I just want to clear the above three lines from the current position,
so that I can start printing my results from that point. In short I
want to clear a portion of my screen.

Note: I work in the UNIX environment using gcc compiler. And I''m not a
super user.

I want a "simple solution".

I tried the combination of "\r\b" escape sequences. But \b is not
taking me back to the above line?
I urgently need the key for this.
Please help me achieving this.

I daily visit my topic to see whether I got the answer or not!
Thank you.


我只想从当前位置清除以上三行,

/>
这样我就可以从那一点开始打印我的结果了。简而言之,我想要清除我屏幕的一部分。


注意:我使用gcc编译器在UNIX环境中工作。而且我不是一个超级用户。
超级用户。
I just want to clear the above three lines from the current position,
so that I can start printing my results from that point. In short I
want to clear a portion of my screen.

Note: I work in the UNIX environment using gcc compiler. And I''m not a
super user.



标准C无法解决您的问题。 (标准C不提供

全屏寻址。)


我建议你在comp.unix.programmer中提出你的问题,我相信(我相信)

专家将能够为您提供特定于平台的解决方案。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)

Standard C has no solution to your problem. (Standard C does not offer
full-screen addressing.)

I suggest you ask your question in comp.unix.programmer where (I trust) the
experts there will be able to offer you a platform-specific solution.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


Rajendran写道:
Rajendran wrote:

我只想从当前位置清除上面的三行,

以便我可以从那一点开始打印我的结果。简而言之,我想要清除屏幕的一部分。
I just want to clear the above three lines from the current position,
so that I can start printing my results from that point. In short I
want to clear a portion of my screen.



请参阅FAQ中的问题19.4: http://www.c-faq.com


注意:我使用gcc编译器在UNIX环境中工作。而且我不是一个

超级用户。
Note: I work in the UNIX environment using gcc compiler. And I''m not a
super user.



comp.unix.programmer是你的朋友。

comp.unix.programmer is your friend.


我想要一个简单的解决方案。
I want a "simple solution".



(n)curses库非常简单。即使是更简单的解决方案也可能没有多少收益,因为他们不会转移到其他平台,

并且学习它们是浪费时间。

The (n)curses library is pretty simple. There''s probably not much to gain
from even simpler solutions, since they won''t transfer to other platforms,
and learning them is a waste of time.


我尝试了\\\的组合。逃逸序列。但\ b不是

带我回到上面的线路?
I tried the combination of "\r\b" escape sequences. But \b is not
taking me back to the above line?



\ b是退格,它将当前行的活动头寸移动到前一个仓位

。如果活动位置位于

行的初始位置,则未指定显示设备的行为。换句话说,

你不能以这种方式使用退格并期望它能够正常工作。


S.

\b is backspace, which "moves the active position to the previous position
on the current line. If the active position is at the initial position of a
line, the behavior of the display device is unspecified." In other words,
you can''t use backspace that way and expect it to work.

S.


Rajendran在09/02/06 03:00发表以下内容:
Rajendran said the following, on 09/02/06 03:00:

我只想从当前位置清除以上三行,

以便我可以从那一点开始打印我的结果。简而言之,我想要清除屏幕的一部分。
I just want to clear the above three lines from the current position,
so that I can start printing my results from that point. In short I
want to clear a portion of my screen.



C语言没有处理屏幕的标准设施。并且

并非所有实现都有可能如此描述的内容。

请查看FAQ,< http://www.c-faq.com />,特别是

第19节,系统依赖关系。

The C language has no standard facilities dealing with the "screen", and
not all implementations have anything that could be so described.
Please have a look at the FAQ, <http://www.c-faq.com/>, especially
Section 19, "System Dependencies".


注意:我使用gcc编译器在UNIX环境中工作。我不是一个

超级用户。


我想要一个简单的解决方案。
Note: I work in the UNIX environment using gcc compiler. And I''m not a
super user.

I want a "simple solution".



发布这个问题的更好的地方是comp.unix.programmer。


[OT]

在Unix / Linux环境中,你最好的选择可能是使用''ncurses(3)''包中包含的

屏幕处理工具。它们非常简单易用,并允许您的程序使用广泛的

系列显示设备。

[/ OT]


-

Rich Gibbs
ri ** ***@gmail.com

你可以通过观察观察很多。 - Yogi Berra

A better place to post this question would be comp.unix.programmer.

[OT]
In a Unix/Linux environment, your best bet is probably to use
screen-handling tools contained in the ''ncurses(3)'' package. They are
pretty simple to use, and will allow your program to work with a wide
range of display devices.
[/OT]

--
Rich Gibbs
ri*****@gmail.com
"You can observe a lot by watching." -- Yogi Berra


这篇关于我想清除屏幕的一部分 - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆