473,765 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Screen Editing

I was just wondering if there is any way of editing anything already
printed on the screen with out using the system("cls") command.

Aug 17 '06
51 3937
Tak-Shing Chan <t.****@gold.ac .ukwrote:
On Thu, 17 Aug 2006, Thomas Dickey wrote:
>Thomas Dickey <di****@saltmin e.radix.netwrot e:
>>Tak-Shing Chan <t.****@gold.ac .ukwrote:
On Thu, 17 Aug 2006, Thomas Dickey wrote:
>>>>Andrew Smallshaw <an*****@sdf.lo nestar.orgwrote :
>
>Most terminals, particularly modern ones, will clear the screen if
>you simply send them a formfeed. It's not guaranteed, but it's a
>
you're confused. Whether you've observed a particular terminal driver,
or a user application is probably irrelevant.
>>> I don't think Andrew is confused. I think you are.
>>hmm. I have a list in mind. Which "modern" one clears the screen
when you send a form-feed to it?

It occurs to me that you don't know
(googling to get a sense of your background makes that apparent).

A quick check shows putty doing this. vt100/etc don't. putty, of course,
is not a vt100 emulator (or xterm, etc). xterm and anything that emulates
vt100 will simply move the cursor to the next line.

There's some useful information on vt100.net which you might read before
wasting more bandwidth.
All irrelevant to my point. By the way, PuTTY is more
"modern" than vt100, but I suppose you are not aware of this
(judging from what you wrote above).
not at all. The statement was that

"most terminals, particularly modern ones",

fall into this category. Offhand, I know that xterm, gnome-terminal,
konsole, mlterm, rxvt (and kindred) all emulate this feature of vt100.
Even Linux console, now that I think of it.

Now again - where's your list?

I'll give a hint: one is smaller than six (even lumping together rxvt,
Eterm, aterm, wterm, mterm and rxvt-unicode). There are of course
other terminal emulators running only in Windows - but most of those
emulate vt100 reasonably well (and it's unlikely that many of them would
have such an easily observed defect). Still, you're welcome to make a
list, and (for the edification of _your_ peers), convince them that
a list of one item makes a general case.

bye

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Aug 17 '06 #21
On Thu, 17 Aug 2006, Thomas Dickey wrote:
Tak-Shing Chan <t.****@gold.ac .ukwrote:
> I don't need to know the answer, since Steve Summit's C-FAQ

rofl...
>19.4 covered this (``for clearing the screen, a halfway portable
solution is to print a form-feed character ('\f'), which will
cause some displays to clear''). Presumably, those displays that
would clear are still in use.

The faq does contain some archaisms (and outright errors).

p.s: appeals to authority are generally regarded as inferior to direct
observation - something to consider if you choose to pursue a
technical career ;-)
Direct observations aren't always statistically significant.

Tak-Shing
Aug 17 '06 #22
Tak-Shing Chan <t.****@gold.ac .ukwrote:
On Thu, 17 Aug 2006, Thomas Dickey wrote:
>The faq does contain some archaisms (and outright errors).

p.s: appeals to authority are generally regarded as inferior to direct
observation - something to consider if you choose to pursue a
technical career ;-)
Direct observations aren't always statistically significant.
You forgot to cite an authority for that claim.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Aug 17 '06 #23
On Thu, 17 Aug 2006 22:40:44 +0100, in comp.lang.c , Tak-Shing Chan
<t.****@gold.ac .ukwrote:

(stuff to some guy called Dickey).

Chan, given that my kill filters automatically picked this guy up, I
suspect "Dickey" is a sock puppet for an existing troll. I suggest you
killfile him.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Aug 17 '06 #24
Mark McIntyre <ma**********@s pamcop.netwrote :
On Thu, 17 Aug 2006 22:40:44 +0100, in comp.lang.c , Tak-Shing Chan
<t.****@gold.ac .ukwrote:
(stuff to some guy called Dickey).
hmm - this seems to be your usual level, so I won't follow your lead.
Chan, given that my kill filters automatically picked this guy up, I
suspect "Dickey" is a sock puppet for an existing troll. I suggest you
killfile him.
not at all.
Unlike present company, I happen to know what I'm talking about.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Aug 17 '06 #25
"Ancient_Hacker " <gr**@comcast.n etwrites:
[...]
and it's not clear terminal control falls under the baliwick of the C
language or th standard C libraries..
In fact, it's perfectly clear that terminal control does *not* fall
under the bailiwick of the standard C language and library.
The most portable way is dorky, but works most every place I can think
of:
for( i=1; i <= 66 + 24 /* for those TALL full page displays,plus
lagniappe */; i++ )
puts( "\n" );
There's no reason to assume that the terminal window is no taller than
66 rows. I'm typing this in a 65-row window, and I could easily
expand it.

Also, depending on what kind of terminal or emulator you're using, the
"erased" lines can just be scrolled off the top of the screen/window,
where they can be recovered. If I clear the screen, it's often
because I want to erase some sensitive information, and scrolling it
out of sight isn't good enough.

And, of course, it leaves the cursor at the bottom of the window.

Clearing the screen, or, more generally, controlling cursor position,
is one of those things that can *almost* be done in standard C with
some really ugly tricks, but there's almost always a much cleaner
system-specific solution. Don't waste your time trying to do it
portably.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Aug 17 '06 #26
Andrew Smallshaw <an*****@sdf.lo nestar.orgwrite s:
[...]
Most terminals, particularly modern ones, will clear the screen if
you simply send them a formfeed. It's not guaranteed, but it's a
similar kind of assumption to backspace will move the cursor left
which seems pretty much standard these days.
I haven't found that to be the case for any of the terminal emulators
I use. I've just tried xterm, dtterm, gnome-terminal, a Windows
command window, the GNU "screen" program, and rxvt; none of them clear
the screen in response to a formfeed character.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Aug 17 '06 #27
On Thu, 17 Aug 2006, Thomas Dickey wrote:
Mark McIntyre <ma**********@s pamcop.netwrote :
>On Thu, 17 Aug 2006 22:40:44 +0100, in comp.lang.c , Tak-Shing Chan
<t.****@gold.a c.ukwrote:
>(stuff to some guy called Dickey).

hmm - this seems to be your usual level, so I won't follow your lead.
>Chan, given that my kill filters automatically picked this guy up, I
suspect "Dickey" is a sock puppet for an existing troll. I suggest you
killfile him.

not at all.
Unlike present company, I happen to know what I'm talking about.
Really? Do you know anything about these 120 terminals?
According to my termcap (yes, appealing to authority again), they
all respond to form feeds by clearing the screen:

glasstty|classi c glass tty interpreting ASCII control characters:\
pmcons|pmconsol e|PMAX console:\
ibmpcx|xenix|ib mx|IBM PC xenix console display:\
ofcons:\
rcons|BSD rasterconsole:\
rcons-color|BSD rasterconsole with ANSI color:\
bsdos-sparc|Sun SPARC BSD/OS Console:\
mterm|mouse-sun|Der Mouse term:\
mgr|Bellcore MGR (non X) window system terminal emulation:\
mgr-sun|Mgr window with Sun keyboard:\
mgr-linux|Mgr window with Linux keyboard:\
oldsun|Sun Microsystems Workstation console:\
sun-il|Sun Microsystems console with working insert-line:\
sun-cgsix|sun-ss5|Sun SparcStation 5 console:\
sun|sun1|sun2|S un Microsystems Inc. workstation console:\
sun-s|Sun Microsystems Workstation window with status line:\
sun-e-s|sun-s-e|Sun Microsystems Workstation with status hacked for emacs:\
sun-48|Sun 48-line window:\
sun-34|Sun 34-line window:\
sun-24|Sun 24-line window:\
sun-17|Sun 17-line window:\
sun-12|Sun 12-line window:\
sun-1|Sun 1-line window for sysline:\
sun-e|sun-nic|sune|Sun Microsystems Workstation without insert character:\
sun-c|sun-cmd|Sun Microsystems Workstation console with scrollable history:\
sun-type4|Sun Workstation console with type 4 keyboard:\
psterm|psterm-basic|NeWS psterm-80x34:\
psterm-96x48|NeWS psterm 96x48:\
psterm-90x28|NeWS psterm 90x28:\
psterm-80x24|NeWS psterm 80x24:\
psterm-fast|NeWS psterm fast version (flaky ctrl chars):\
next|NeXT console:\
wyse-vp|Wyse 50 in ADDS Viewpoint emulation mode with "enhance" on:\
rbcomm|IBM PC with RBcomm and EMACS keybindings:\
rbcomm-nam|IBM PC with RBcomm without autowrap:\
rbcomm-w|IBM PC with RBcomm in 132 column mode:\
att5620-s|tty5620-s|layer|vitty|5 620 S layer:\
aas1901|Ann Arbor K4080 w/S1901 mod:\
regent|Adds Regent Series:\
regent100|Adds Regent 100:\
regent20|Adds Regent 20:\
regent25|Adds Regent 25:\
regent40|Adds Regent 40:\
regent40+|Adds Regent 40+:\
regent60|regent 200|Adds Regent 60:\
viewpoint|addsv iewpoint|adds viewpoint:\
screwpoint|adds viewpoint with ^O bug:\
vp60|viewpoint6 0|addsvp60|adds viewpoint60:\
cdc721|CDC Viking:\
cdc721ll|CDC Vikingll:\
cdc721-esc|Control Data 721:\
dg-generic|Generic Data General terminal in DG mode:\
dg200|data general dasher 200:\
dg211|Data General d211:\
dg450|dg6134|da ta general 6134:\
dg6053-old|dg100|data general 6053:\
dg6053|6053|605 3-dg|dg605x|605x| 605x-dg|d2|d2-dg|Data General DASHER 6053:\
d200|d200-dg|Data General DASHER D200:\
d210-dg|d214-dg|Data General DASHER D210 series in DG mode:\
d211-dg|d215-dg|Data General DASHER D211 series in DG mode:\
d216-dg|d216e-dg|d216+dg|d216 e+dg|d217-dg|Data General DASHER D216 series in DG mode:\
d220-dg|Data General DASHER D220 color terminal in DG mode:\
d230c-dg|d230-dg|Data General DASHER D230C in DG mode:\
d400|d400-dg|d450|d450-dg|Data General DASHER D400/D450 series:\
d410-dg|d460-dg|d411-dg|d461-dg|Data General DASHER D410/D460 series in DG mode:\
d412-dg|d462-dg|d462e-dg|d412+dg|d462 +dg|d413-dg|d463-dg|Data General DASHER D412/D462 series in DG mode:\
d430c-dg|d430-dg|Data General D430C in DG mode:\
d430c-dg-ccc|d430-dg-ccc|Data General D430C in DG mode with configurable colors:\
d470c-dg|d470-dg|Data General DASHER D470C in DG mode:\
d555-dg|Data General DASHER D555 series in DG mode:\
d577-dg|d578-dg|Data General DASHER D577/D578 series in DG mode:\
dm1520|dm1521|d atamedia 1520:\
dt80-sas|Datamedia DT803/DTX for SAS usage:\
hz1000|hazeltin e 1000:\
ibm-apl|apl|IBM apl terminal simulator:\
i100|gt100|gt10 0a|General Terminal 100A (formerly Infoton 100):\
addrinfo:\
infoton:\
prism9|p9|P9|MD C Prism-9 in ANSII mode:\
prism9-w|p9-w|P9-W|MDC Prism-9 in 132 column mode:\
prism12|p12|P12 |MDC Prism-12 in ANSI mode:\
prism12-w|p12-w|P12-W|MDC Prism-12 in 132 column mode:\
prism14|p14|P14 |MDC Prism-14 in ANSII mode:\
prism14-w|p14-w|P14-W|MDC Prism-14 in 132 column mode:\
p8gl|prism8gl|M cDonnell-Douglas Prism-8 alternate definition:\
mime314|mm314|m ime 314:\
ncr7900i|ncr790 0|ncr 7900 model 1:\
ncr7900iv|ncr 7900 model 4:\
ncr7901|ncr 7901 model:\
uts30|sperry uts30 with cp/m@1R1:\
vc415|volker-craig 415:\
ibm-pc|ibm5051|5051 |IBM Personal Computer (no ANSI.SYS):\
appleIIgs|apple IIe|appleIIc|Ap ple 80 column firmware interface:\
apple-ae|ASCII Express:\
appleII|apple ii plus:\
apple-uterm-vb|Videx Ultraterm for Apple micros with Visible Bell:\
apple-uterm|Ultraterm for Apple micros:\
lisa|apple lisa console display (black on white):\
liswb|apple lisa console display (white on black):\
mac|macintosh|M acintosh with MacTerminal:\
mac-w|macterminal-w|Apple Macintosh with Macterminal in 132 column mode:\
trs2|trsII|trs8 0II|Radio Shack Model II using P&T CP/M:\
trs16|trs-80 model 16 console:\
minitel1|minite l 1:\
minitel1b|minit el 1-bistandard (in 40cols mode):\
blit|jerq|blit running teletype rom:\
cbblit|fixterm| blit running columbus code:\
oblit|ojerq|fir st version of blit rom:\
cg7900|chromati cs|chromatics 7900:\
intertube|inter tec|Intertec InterTube:\
intertube2|inte rtec data systems intertube 2:\
rca|rca vp3301/vp3501:\
swtp|ct82|south west technical products ct82:\
t3700|dumb teleray 3700:\
t3800|teleray 3800 series:\
apollo|apollo console:\
aws|Convergent Technologies AWS workstation under UTX and Xenix:\
awsc|Convergent Technologies AWS workstation under CTOS:\
aj510|Anderson-Jacobson model 510:\
d132|datagraphi x|datagraphix 132a:\
teletec|Teletec Datascreen:\

Tak-Shing
Aug 17 '06 #28
On Thu, 17 Aug 2006, Keith Thompson wrote:
Andrew Smallshaw <an*****@sdf.lo nestar.orgwrite s:
[...]
>Most terminals, particularly modern ones, will clear the screen if
you simply send them a formfeed. It's not guaranteed, but it's a
similar kind of assumption to backspace will move the cursor left
which seems pretty much standard these days.

I haven't found that to be the case for any of the terminal emulators
I use. I've just tried xterm, dtterm, gnome-terminal, a Windows
command window, the GNU "screen" program, and rxvt; none of them clear
the screen in response to a formfeed character.
I have just posted a long list elsethread.

Tak-Shing
Aug 17 '06 #29
Keith Thompson writes:
>Andrew Smallshaw <an*****@sdf.lo nestar.orgwrite s:
>Most terminals, particularly modern ones, will clear the screen if
you simply send them a formfeed. It's not guaranteed, but...

I haven't found that to be the case for any of the terminal emulators
I use. I've just tried xterm, dtterm, gnome-terminal, a Windows
command window, the GNU "screen" program, and rxvt; none of them clear
the screen in response to a formfeed character.
I had no idea that \f had fallen into disuse.
I'm updating FAQ 19.4 accordingly.
--
Steve Summit
sc*@eskimo.com
Aug 17 '06 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
400
by: news.microsoft.com | last post by:
This is a cross post.... My problem is when I am using the split screen editor and I copy and paste from the bottom pane to the top pane, the top pane will reposition itself to where the bottom pane is pointed to and I loose my place in the upper pane. Has anyone experiences this, and is there a setting somewhere to change this behavior? Thanks.
3
4229
by: Simon East | last post by:
We recently upgraded from Windows 98 to Windows XP (clean install), but still required to edit Access 97 databases and so have kept Access 97. We installed Word XP and Excel XP, then Access 97. Access frequently crashes with the Win XP blue screen and the message "IRQL_NOT_LESS_THAN_EQUAL". I haven't seen the screen appear from any other program - the computer is otherwise quite stable. It can happen after just a few minutes of having...
1
1618
by: Patrick.O.Ige | last post by:
Hello guys i made a Datagrid with Editing,Update and Cancel using VS.NET. to my surprise nothing is on the screen after compilation .. By code below:- Imports System.Data Imports System.Data.SqlClient Imports System.Web.UI.WebControls Imports System.Web.UI.HtmlControls Public Class datagrid_edit Inherits System.Web.UI.Page
65
8636
by: Leslie Kis-Adam | last post by:
Hi everyone! Does anyone know, if it is possible to clear the screen in ANSI C? If it is,then how? Any help would be appreciated. Laszlo Kis-Adam <dfighter_AT-NOSPAM_freemail.hu
9
4749
by: Ray | last post by:
Hello, We have a requirement that when a user click a button to signify he wants to edit a certain area, everything else on the browser screen but that area will be disabled. In effect, it's analogous to a modal dialog box, the difference being the "dialog box" in this case is within the screen itself, not a separate popup one like a modal dialog box. It's just a certain area of the screen that becomes enabled when the user clicks the...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.