Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,628 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,027 people online right now. Registration is fast and FREE... Join Now!




How to block user to enter something?

 
Reply to this topicStart new topic

How to block user to enter something?, Just want to know....

henry
post 9 Mar, 2006 - 03:48 AM
Post #1


D.I.C Head

**
Joined: 3 Jan, 2006
Posts: 96


My Contributions


How to block user to enter something?
Let me take example:

User: <user can key in 6 char only>
--------------------------------------------------------------------------------
User:Henry1 (after the 1 the user cannot keyin any char but can use "backspace" and "Enter" key)

How this create?
User is offlineProfile CardPM

Go to the top of the page

Voodoo Doll
post 9 Mar, 2006 - 08:39 AM
Post #2


D.I.C Head

Group Icon
Joined: 24 Jan, 2006
Posts: 107



Thanked 2 times

Dream Kudos: 175
My Contributions


You can do it, but not with standard C or C++. You need to have more control over the terminal than the languages proper have. What OS and compiler are you using?
User is offlineProfile CardPM

Go to the top of the page

henry
post 9 Mar, 2006 - 06:59 PM
Post #3


D.I.C Head

**
Joined: 3 Jan, 2006
Posts: 96


My Contributions


Actually not command......

It is "code"

Example like
int = integer
char = character

I want the code to block the user from key in the more space from limitation that programmed

I should I add to the code?
Can you give me the simplest example?

smile tongue.gif

Thanks
User is offlineProfile CardPM

Go to the top of the page

henry
post 9 Mar, 2006 - 07:06 PM
Post #4


D.I.C Head

**
Joined: 3 Jan, 2006
Posts: 96


My Contributions


I use WINDOW ME (Home edition)
I use C++ programming language

Anyway thank from your reply...

Smile tongue.gif
User is offlineProfile CardPM

Go to the top of the page

henry
post 12 Mar, 2006 - 07:23 PM
Post #5


D.I.C Head

**
Joined: 3 Jan, 2006
Posts: 96


My Contributions


Example
This is program only allow user to input 6 character only to create a password

The user want to input password as Micheal

Password:

He type Micheal

Passwoord:Michea

He cannot input the letter "l"
Except he can press "Enter" and "Backspace"

If he press "Enter" mean his password is "Michea"
Or otherwise He got to change his password

How it can be don't?
Help
This is quite interest......To add my assignment mark in special feature
HAha.....
So need you all help....
Love you
Smile tongue.gif
User is offlineProfile CardPM

Go to the top of the page

poke_blade
post 17 Mar, 2006 - 07:03 AM
Post #6


New D.I.C Head

*
Joined: 26 Feb, 2006
Posts: 21



Dream Kudos: 10
My Contributions


I dont think by using turbo c++ compiler u can do that
User is offlineProfile CardPM

Go to the top of the page

henry
post 17 Mar, 2006 - 07:56 PM
Post #7


D.I.C Head

**
Joined: 3 Jan, 2006
Posts: 96


My Contributions


condition:
Just use the simple knowledge about C++

Anyone know it?
Can u all give me hint to do that?
Thank tongue.gif
User is offlineProfile CardPM

Go to the top of the page

henry
post 26 Mar, 2006 - 07:28 PM
Post #8


D.I.C Head

**
Joined: 3 Jan, 2006
Posts: 96


My Contributions


Why no people got the idea to do it?
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 26 Mar, 2006 - 07:35 PM
Post #9


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,176



Thanked 33 times

Dream Kudos: 25
My Contributions


If you are talking about stopping the actual physical keyboard characters from appearing within the command window while the user is typing, then please refer to Voodoo Doll's post above...I don't believe it can be dome with C++, you would need to access the command window application itself to modify it's behaviour.

If, however, you are talking about duplicating that behaviour in a windows type application that you built yourself, then it is easier.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/23/08 03:40AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month