473,326 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Scan input - But only if something has been typed

Hello all,

I would like to do a simple input scan from the command line, but only if
the user has typed something...

I have had a look at the select() method, but am still having trouble.

Basically, I want to treat stdin as a textField. Having a GUI would solve
this problem of course, but a gui is not required, and I'm after an easier
way.

Ta

Chris

Nov 14 '05 #1
4 1698
"macuser55" <ma********@nospam.hotmail.com> wrote in
news:68******************************@localhost.ta lkaboutprogramming.com:
Hello all,

I would like to do a simple input scan from the command line, but only
if the user has typed something...
Please read the C-FAQ.
I have had a look at the select() method, but am still having trouble.
Of course, select() not being part of ISO C.
Basically, I want to treat stdin as a textField. Having a GUI would
solve this problem of course, but a gui is not required, and I'm after
an easier way.


Then you are off to the land of the Platform-specific. ISO C cannot do
what you require.

--
- Mark ->
--
Nov 14 '05 #2
macuser55 wrote:
Hello all,

I would like to do a simple input scan from the command line, but only if
the user has typed something...

I have had a look at the select() method, but am still having trouble.

Basically, I want to treat stdin as a textField. Having a GUI would solve
this problem of course, but a gui is not required, and I'm after an easier
way.

Alas, there's no way to do this in ISO standard C; you'll need platform
specific extensions.

HTH,
--ag

[If you are, in fact, a Mac user (running some flavor of OS X)
news:comp.unix.programmer may be an appropriate place to ask.]

--
Artie Gold -- Austin, Texas

"If you don't think it matters, you're not paying attention."
Nov 14 '05 #3
Ta guys, I'll shoddy it up with a GUI.

Chris

Nov 14 '05 #4
In <27******************************@localhost.talkab outprogramming.com> "macuser55" <ma********@nospam.hotmail.com> writes:
Ta guys, I'll shoddy it up with a GUI.


No need to do that: if your code need not be portable, there are
system specific solutions that are, usually, much simpler than
throwing in a GUI.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Currently looking for a job in the European Union
Nov 14 '05 #5

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

Similar topics

5
by: Gregg | last post by:
Hello all, I have been banging my head over a problem that I am having reading a comma seperated file (CSV) that can contain from 1 to 10,000 records. My code snipit is as follows: **Start...
3
by: coffee_man | last post by:
Hi, I have a page with a form. This form has an input field <textarea>. I use it to have my users enter text and on form submit it gets inserted into a db. Initially there is some standard text...
2
by: Corepaul | last post by:
As input is typed into a text box, I would like to search a recordset for the first record that matches what has been typed so far. I would like to update the text box to display the letters typed...
1
by: Luke Wu | last post by:
I have been using the getline function from K&R2 for simple character input. The prototype is int getline(char *s, int limit); /* returns 0 to signal EOF */ This function simply calls...
4
by: smshahriar | last post by:
Hi, I want to scan from the following string all the hex numbers and populate an array of integers: 0x27 0x00 0x30 0x00 0x33 0x00 0x36 0x00
1
by: John Chorlton | last post by:
I've been attempting to pass a chunk of data back from a child Windows form using public properties on the form and have been getting some odd errors. I wanted to return a row of data to avoid...
9
by: chuck | last post by:
I need some help with validating user input. I am writing a C computer program for an intro to C course. Here is the situation. I am creating an application that will do currency conversions. ...
11
by: C.W.Holeman II | last post by:
I what to hide an input element and the following text. I have the selector for the input working and just need to grab the text following it. CSS: form{ display:table; text-align:center; }
3
by: Deano | last post by:
I use this code from http://support.microsoft.com/kb/210047 to stop more than 50 characters being input into a textbox. ****code start**** Sub LimitFieldSize (KeyAscii, MAXLENGTH) Dim C As...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.