CompuServe Thread

#SAS 6.3 Bug?

14 messages in this thread
#37429From: Troy BarlowOct 23, 1993 12:22 AM
If you are reading this, and have SAS C V6.3, I would like you to try something. Create a simple program as follows: #include <stdio.h> int main( int argc, char **argv ) { printf("Key = %d\n", getch() ); } Then compile and link using the default options! (be sure NOT to use NOSTDIO)! This simple program fails two ways… First, if you run it from the WB, and press a key, it won't allow you to close the window it opens. Second, if you run it from a CLI, and hit a cursor or function key, it exits fine but will corrupt something that causes it to fail the second time (it seems to stuff things into the stdin stream). For instance: RAM:> test<CR> <Then press F1> Key = 155 RAM:> test<CR> 0~test: Unknown command I'm using a Amiga 4000/030 with 6 megs of ram, and nothing unusual in my startup! Just want to know if this is a compiler bug, or my system. -Troy
#37435From: James Du BoisOct 23, 1993 5:26 PM
Troy, I have an Amiga 4000/040 with 6 MB of RAM and SAS/C 5.10. I tried your program: > #include <stdio.h> > > int main( int argc, char **argv ) > { > printf("Key = %d\n", getch() ); > } The C book I have says you need to #include <conio.h> to use getch(). I tried to compile your program, but I can't get it to work because I don't seem to have <conio.h> in my system. I've looked through the SAS/C docs and can't find any function for unbuffered console IO. I know they have to exist, but I can't find them. James Du Bois via AutoPilot Member of the Bermuda Triangle Exploratory Expedition 1992 – 1951
#37446From: Doug WalkerOct 24, 1993 12:42 PM
James, getch() is documented in the SAS/C Version 6 manual. There was no equivalent function in Version 5. Also, look at rawcon() in the V6 manual. conio.h is a PC-ism – it's not portable (for that matter, neither is getch()). You get access to getch() simply by including <stdio.h> with SAS/C. –Doug
#37447From: Troy BarlowOct 24, 1993 1:04 PM
You only need stdio.h.
#37561From: Doug WalkerNov 2, 1993 7:02 AM
James, getch() is documented in the SAS/C Version 6 manual. There was no equivalent function in Version 5. Also, look at rawcon() in the V6 manual. conio.h is a PC-ism – it's not portable (for that matter, neither is getch()). You get access to getch() simply by including <stdio.h> with SAS/C. –Doug
#37573From: Troy BarlowNov 2, 1993 6:51 PM
I wouldn't even reccomend using getch() on the Amiga. I just used it for a quick-n-dirty program for myself. That don't mean getch() shouldn't work though. -Troy
#37437From: Vic WagnerOct 23, 1993 6:42 PM
Troy, I can duplicate your problem easily. I have no explaination why the window won't close from the WB. From the CLI (shell) however, what's happening is fairly straightforward. When you press an FKey or cursor, more than one 'character' is put into the keyboard buffer. Your program only 'eats' one, SO….. when you get back to the CLI (shell) it gobbles up the remaining characters (which you don't see) and then complains that it can't find some 'funny' filename.
#37448From: Troy BarlowOct 24, 1993 1:04 PM
That may be so. I know on the PC if getch() returns 0 or 0x0e, you call getch() again to get the second code. It's not that way on the Amiga for some reason though. It's not all that important since I don't normally use stdio on the Amiga. I was just creating a quick and dirty program to test something, and came across this odity. Also, it seems to happen with other startup code (cres, cback), so I don't think it's the SAS startup code.
#37562From: Doug WalkerNov 2, 1993 7:02 AM
Troy, I believe that Vic has already answered your second question, about the CLI behavior. As to the workbench behavior, I unfortunately don't have a copy of 6.3 here at home, but under both 6.0 and 6.50 it works as expected – you do have to click the close gadget to close the window, but that's normal if you are running 2.0 or higher. If clicking on the close gadget in 6.3 doesn't work, it sounds like a bug. You would need to contact technical support as described in Chapter 3 of your User's Guide, Volume I in order to see if there is a workaround.
#37569From: Troy BarlowNov 2, 1993 5:52 PM
I know how it's supposed to work 😎 The close gadget don't close the window, it's a compiler bug for sure. -Troy
#37599From: Kelly JordanNov 4, 1993 5:23 AM
Doug, How is the SAS 6.50 release coming? Haven't heard (or seen) anything on this in a while. 73, Kelly
#37611From: Doug WalkerNov 4, 1993 4:40 PM
Kelly, It's taking a looong time at the printer. We shipped the diskettes at the end of September. Upgrade letters are going to the mail house tomorrow. They will probably arrive in 7-10 days since the mail house sometimes takes a while to get them in the mail. We will have product in the warehouse when you get your letter, so fill it out and send it in as soon as you get it! You can place a backorder by calling (919)677-8000 in the US and asking for Book Sales. You can get info on the academic discount, competitive upgrade, Version 6 upgrade, Version 5 upgrade, Lattice C++ upgrade, Lattice Version 4 upgrade, etc. by contacting our book sales department either at the above number or as INTERNET:sasdsb@vm.sas.com. Users in Europe should contact INTERNET:eurdoc2@vm.sas.com instead. –Doug –Doug
#37630From: Kelly JordanNov 6, 1993 5:58 AM
Doug, Thanks for the update on the 6.5 release. I can wait for the letter to come out to get the upgrade. Course, I know you went to such detail for others out there reading this too. 73, Kelly
#37702From: Doug WalkerNov 10, 1993 9:15 PM
Kelly, Yes, I've found it's better to dump all info that I have rather than answer just the question asked. It cuts down on mail traffic later 8^). BTW, the release number is 6.50, not 6.5. Pronounce it like "six-fifty", not "six point five". It's Version 6 Release 50. –Doug