473,748 Members | 2,611 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 #1
51 3929
someone <ra************ @gmail.comwrote :
I was just wondering if there is any way of editing anything already
printed on the screen with out using the system("cls") command.
Not portably, since a standard-conformant implementation need not
involve anything resembling a "screen". There are a number of choices
available depending on your needs and platform, but none of them are
topical here.

--
C. Benson Manica | I *should* know what I'm talking about - if I
cbmanica(at)gma il.com | don't, I need to know. Flames welcome.
Aug 17 '06 #2
"someone" <ra************ @gmail.comwrite s:
I was just wondering if there is any way of editing anything already
printed on the screen with out using the system("cls") command.
There is no portable way to do this.

The comp.lang.c FAQ is at <http://www.c-faq.com/>. You have asked
question 19.4.

--
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 #3
printf("\033[2J"); /* clear screen */
printf("\033[%d;%dH", 10, 20); /* move cursor (row 10, col 20) */
printf("Hello, ");
printf("\033[7mworld\033[0m!"); /* inverse video */

I tried upper commands. Seems does not work proper as the explanations.

printf("\033[2J"); display"<-2j"
...........
could anyone tell me his results?
------------------------------------------------------
"Keith Thompson" <ks***@mib.org? ?????:ln******* *****@nuthaus.m ib.org...
"someone" <ra************ @gmail.comwrite s:
>I was just wondering if there is any way of editing anything already
printed on the screen with out using the system("cls") command.

There is no portable way to do this.

The comp.lang.c FAQ is at <http://www.c-faq.com/>. You have asked
question 19.4.

--
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 #4
Chen Shusheng wrote:
printf("\033[2J"); /* clear screen */
printf("\033[%d;%dH", 10, 20); /* move cursor (row 10, col 20) */
printf("Hello, ");
printf("\033[7mworld\033[0m!"); /* inverse video */
flush the output, stdout might be buffered.
I tried upper commands. Seems does not work proper as the explanations.

printf("\033[2J"); display"<-2j"
..........
could anyone tell me his results?
Perhaps your output device doesn't understand these ansi escape
codes, read its documentation.

Aug 17 '06 #5

someone wrote:
I was just wondering if there is any way of editing anything already
printed on the screen with out using the system("cls") command.
There is no "C" way to do this, as C precedes most CRT terminals,

Even the few that existed back then cost about $3 to $15 THOUSAND
dollars each, and each had its own quirky control sequence for clearing
the screen. The first one I ever saw was in 1969, at a trade show,
made by Univac, and cost $15,000, retail.

and it's not clear terminal control falls under the baliwick of the C
language or th standard C libraries..
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" );
If your intended terminal has some alleged "ANSI" control code
capability, there's something gross, like puts( "\033;2J" ) that does
the trick, google for "termcap vt100" or ANSI and see the "cl" entry.

Aug 17 '06 #6
On 2006-08-17, Ancient_Hacker <gr**@comcast.n etwrote:
>
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" );

If your intended terminal has some alleged "ANSI" control code
capability, there's something gross, like puts( "\033;2J" ) that does
the trick, google for "termcap vt100" or ANSI and see the "cl" entry.
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'd agree looking at the termcap manual would be a good idea, though,
at least if the OP is talking about a serial terminal or an emulation
of one.

--
Andrew Smallshaw
an*****@sdf.lon estar.org
Aug 17 '06 #7
Ancient_Hacker wrote:
someone wrote:
>I was just wondering if there is any way of editing anything already
printed on the screen with out using the system("cls") command.

There is no "C" way to do this, as C precedes most CRT terminals,
Strange. Those CRT terminals that I was using regularly for more than
10 years before C existed. In fact, the first PDP-1 of 1957 had a CRT
display (which is iconized in the DECUS logo). I used plenty of VT05s
and VT52s (the later are still 4 years before C). Even the ANSI
standard X3.64 predates the publication of K&R1, although Heath's
implementation and DEC's VT100 were not yet out at K&R1's publication date.
Aug 17 '06 #8
On Thu, 17 Aug 2006 00:33:37 UTC, "someone" <ra************ @gmail.com>
wrote:
I was just wondering if there is any way of editing anything already
printed on the screen with out using the system("cls") command.
No, because C does know nothing about a screen, TTY, printer or other
devises. So you may ask in a group related to POSIX or to your OS to
get a solution beside standard C.

--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2 Deutsch ist da!
Aug 17 '06 #9
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.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Aug 17 '06 #10

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
4228
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
1617
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
8630
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
4748
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
8995
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
8832
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
9381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9332
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
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
6078
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
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.