Is there a library function for placing cursor position in the cosole?

M

Mark McIntyre

I guess the question is whether program output is output if it can't be
observed.

And if a tree falls when there's no-one to hear it?
That depends on whether MS C compilers claim to provide a hosted
environment for console apps. Probably not but not impossible.

They do, but for console apps fprintf(stderr, works perfectly. Its for GUI
apps that there's an issue.
 
M

Michael Wojcik

That depends on whether MS C compilers claim to provide a hosted
environment for console apps.

Did you mean whether they claim to provide a hosted environment for
GUI apps? Otherwise, I don't see how that would be relevant to
whether they provide a freestanding implementation for GUI apps.

If that is what you meant, then yes, I agree that if MS claims that
it provides a conforming hosted implementation for GUI apps, that
claim appears to be invalid. For one thing, GUI apps use a different
form for the function called at program startup.

For the record, I couldn't find any such claim in the MS documentation
I have at hand.

--
Michael Wojcik (e-mail address removed)

This is a "rubbering action game," a 2D platformer where you control a
girl equipped with an elastic rope with a fishing hook at the end.
-- review of _Umihara Kawase Shun_ for the Sony Playstation
 
R

Richard Bos

Not true. For years I used X Windows with various window managers
that did not waste screen real estate on pointless decorations like
window titles.

And this shows the risk of off-topic discussion: it isn't actually true
for M$ Windows, either. By far most M$ windows have a title bar, of
course, but they don't have to. Details would be off-topic.

Richard
 
L

Lawrence Kirby

Did you mean whether they claim to provide a hosted environment for
GUI apps?

Not really, since as you mention below they don't use a valid program
startup mechanism for a hosted implementation.
Otherwise, I don't see how that would be relevant to
whether they provide a freestanding implementation for GUI apps.

Console apps can use GUI facilities, so that's really the only
area combination that could be relevant.
If that is what you meant, then yes, I agree that if MS claims that
it provides a conforming hosted implementation for GUI apps, that
claim appears to be invalid. For one thing, GUI apps use a different
form for the function called at program startup.

For the record, I couldn't find any such claim in the MS documentation
I have at hand.

Then of course they can do what they like, but we know that anyway. :)

Lawrence
 
R

Roger Leigh

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris Croughton said:
I won't ask for a Linux API call that positions the cursor, as that is
beyond the scope of the comp.lang.c group. But if someone knew it off
the top of their head, I won't stop you from writing it in a post! ;)
;)

<ESC>[a;bH

a and b are the row and column number in decimal ASCII (1,1 is the top
LH corner). That's the VT100/ANSI cursor control sequence, which works
with xterms, but of course is not guaranteed to work on anything else.

It should work on any terminal implementing ISO-6429 (ECMA-48;
http://www.ecma-international.org/publications/files/ecma-st/ECMA-048.pdf)

BTW, while the escape sequence is correct for the VT-100, strictly
speaking it's defined as

CSI Pn1;Pn2 04/08

where CSI (control sequence inducer) is typically 01/11 05/11 (ESC [),
but this could equally be 09/11 (0x9B) for 8-bit character sets with
the C1 control set designated as CR (0x80 to 0x9F). 04/08 is "H".

Best to just use curses and have it do all this stuff for you ;-)


Regards,
Roger

- --
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
Debian GNU/Linux http://www.debian.org/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFByIWlVcFcaSW/uEgRAmoHAJ9mHa1kc6QBg9bt+n/4bkzhwhv/XACgp4dZ
DHlgRajFeH+N2xCsxyy65nM=
=CJnX
-----END PGP SIGNATURE-----
 
D

Dave Thompson

Which console? What cursor? An ASR33 teletype doesn't have a
cursor. (I suspect C was originally developed on this kind of
terminal, although maybe something older than the ASR33.)
Not officially, but practically the little ribbon-guide thingies
functioned well enough to let you position the carriage w.r.t.
something on the paper, or more often vice versa. (On any model 33 of
course, not just ASR which is irrelevant to the print mechanism.)

The 33 was the first ASCII machine from Teletype, and I think at all,
so it wouldn't have been older. More likely newer; by 1970 I think at
least VT05's were out from DEC and maybe VT50's. And definitely
Teletype model 35's, and I think 38's, which would support the
lowercase that Unix and C strongly prefer.

- David.Thompson1 at worldnet.att.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top