Discussion:
Protected field in DOS
(too old to reply)
Jack
2010-02-18 09:22:56 UTC
Permalink
Hello,
I recall that once I wrote a little program that
could limit the number of characters the field could contain. I vaguely
recall something that looks like "getnline();" But I couldn't find it from
google and MSDN.
Any reminder?
Thanks
Jack
Ulrich Eckhardt
2010-02-18 11:32:54 UTC
Permalink
Post by Jack
I recall that once I wrote a little program that
could limit the number of characters the field could contain.
I have no idea what you're talking about here and what DOS has to do with
Post by Jack
I vaguely recall something that looks like "getnline();" But I couldn't
find it from google and MSDN.
There is fgets() in C. Further, there is gets(), but that should never be
used anyway. In C++, you could also use the std::getline() function and
then truncate the result or use std::istream's readsome() member.

Cheers!

Uli
--
C++ FAQ: http://parashift.com/c++-faq-lite

Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
Jack
2010-02-18 13:25:59 UTC
Permalink
Say I had a textbox Name:_______
The user can type into box, after he has typed up to 6 characters, he would
not be allowed to continue and
the PC starts beeping... etc
Thanks
Jack
Ulrich Eckhardt
2010-02-18 14:08:03 UTC
Permalink
Post by Jack
Say I had a textbox Name:_______
The user can type into box, after he has typed up to 6 characters, he
would not be allowed to continue and
the PC starts beeping... etc
The probably widest-spread library to create graphical UIs in a text screen
is called "curses". There are various flavours and variants of that
library, but you should be able to find one that suits you with that name.

Uli
--
C++ FAQ: http://parashift.com/c++-faq-lite

Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
Continue reading on narkive:
Loading...