CompuServe Thread

console.device

14 messages in this thread
#20472From: Steven ParkFeb 17, 1992 6:44 PM
There must be standard routines for inputing data while using console.device analogous to scanf. Can anybody help me out here? Thanks.
#20514From: John Toebes/SYSOPFeb 18, 1992 10:00 PM
You can always do a buffered read and call sscanf to process the data. In fact, you could create a routine called cscanf that does just that.
#20577From: Steven ParkFeb 20, 1992 12:02 AM
Thanks John, I'm trying to learn C and the Amiga at the same time and it's quite a big chew. I've copied several examples from RKM.Lib&Dev as practice, which isn't too bad but (naturally) some of their C style is pretty advanced and consequently hard to follow. I have several books on the subject but none walk ya through each step. It's especially frustrating when the examples in RKM don't work [eg. Lines.c on pg 66 doesn't free mem coretly]. I've stepped through Lines.c with Lattice codeprobe (CPR) and it crashes on the second iteration of FreeMem (BigOne->Plalnes[Loop],Rastersize); (two open).
#20589From: John Toebes/SYSOPFeb 20, 1992 6:18 AM
Which RKM version? I know that the latest one is supposed to have had extensive example testing by CATS. They like to keep track of these types of problems.
#20616From: Steven ParkFeb 20, 1992 9:21 PM
It's ISBN 0-201-18187-8 Copyright 1990, I'm still running 1.3. BTW, is there a C text that you recommend?
#20635From: John Toebes/SYSOPFeb 21, 1992 5:57 AM
I just looked at the example and it appears to be correct in what it is freeing. It is possible that something else is getting trashed in the process. As for C books, Rob Peck's book – programming the Amiga in C is a pretty good one.
#20673From: Steven ParkFeb 21, 1992 10:07 PM
I'm pretty sure that I copied it exactly, I've proofed a hard copy several times, but I'll have another look. Thanks for the tip on Peck's book.
#20678From: Steven ParkFeb 21, 1992 10:49 PM
Opps, just found a typo and Lines.c works fine….
#20720From: John Toebes/SYSOPFeb 23, 1992 9:17 AM
Great. I am glad to hear that the example is ok. Feel free to continue asking questions as you get into programming in C.
#21034From: Steven ParkMar 2, 1992 1:46 AM
OK, thanks; it's kind of intimidating to have to ask such basic questions from a past master of the subject. I origonally wanted to learn assembly (following Transactor articles) realised that C is a necessity and only found the time for it all now. I just plunked the new 2.x chip in a few days ago and spent a lot of time getting the old (series I) SCSI to work with the new chip. Now I'll have to get the new RKM's.
#21040From: Black Belt SystemsMar 2, 1992 9:35 AM
Ok, here's another piece of advice: Forget being "intimidated" and ASK those questions. There are people on here who are really quite good at using the language, lots of experience on this particular machine and all that… and that experience is yours for the asking. If you don't ask, you've just kicked yourself in the head for reasons only you will consider worthwhile. No one here will think the less of you for asking anything… we all started sometime, and I think you'll find that the vast majority here remember those *very* painful days all too well. You'll get the help you need 99% of the time, or we'll ALL learn something – and no one will mind either way. –Ben
#21288From: John Toebes/SYSOPMar 8, 1992 2:13 PM
There is nothing wrong with asking questions. The people at Commodore will be the first to admit that I asked tons of questions (at least those who are left). In my opinion, the only way to learn is to ask questions. I have a co-worker that preceeds every conversation with me with 'I have a stupid question…' and we go through the 'There's no such thing as a stupid question routine' every time. Actually, we have both gotten to enjoy the banter. Fortunately he continues to ask me questions (and they are starting to get difficult). What I really enjoy is questions that are real stumpers to think on. It helps to keep the brain processes working.
#21314From: SyndesisMar 8, 1992 9:20 PM
I have a friend who talks and lunches with Don Knuth now and then. He is working on the next volume, and in it, he includes several computing problems he's dreamed up that should tax everyone's brain… my friend tried to explain one, I think it went like this: take the set of all the five-letter words in English. You can permute from one word to another by changing one letter at a time. Find the shortest path between the words "blood" "sweat" and "tears." (I think I've forgotten some twist on the way you permute from one word to another…)
#21533From: Vic WagnerMar 12, 1992 9:01 PM
John, There IS such a thing as a 'stupid question'. It's the one that DOESN'T get asked.