Path: utzoo!attcan!lsuc!jimomura From: jimomura@lsuc.uucp (Jim Omura) Newsgroups: comp.sys.m6809 Subject: Re: I keep getting a device error Summary: ASCII v. Binary Keywords: OS9 COCO Message-ID: <1988Jul17.131646.3739@lsuc.uucp> Date: 17 Jul 88 17:16:43 GMT References: <674@cbnews.ATT.COM> Reply-To: jimomura@lsuc.UUCP (Jim Omura) Distribution: na Organization: Consultant, Toronto Lines: 47 In article <674@cbnews.ATT.COM> mdk@cbnews.ATT.COM (Shadow) writes: >Recently I tried to write a little basic09 program to spool print a letter >I was writing to my family. It was a pretty simple program, I passed it the >path to the file, and the number of copies I wanted printed and it would print >that number of copies. However, it ran through the first iteration and >returned a device >not ready error. I used a for loop to count the number of iterations and the >shell command to list the file to the printer. My question is this, can >I use the close statement after printing the file without using an open >statement before I run the shell command. Should I do something like: > >for i = 1 to count >shell ("list " file ">" #printer) >close #printer >i=i + 1 >next i The problem here is that you have tried to mix ASCII and binary data. The '#printer' is binary. The best thing to do is to build a character string properly in separate statements and then use it in the shell() call. Something like this: cmd$ = "list " + file + " >/p" shell(cmds$) That's off the top of my head, so there may be a mistake in there, but I doubt it. >In another area, I just got done taking a class in the UNIX(r) system shell. >(the Bourne shell). It is pretty amazing what you can do with a shell that >is also a programming language. I hope I can put some of this to use in >Basic09. It's too bad we don't have something like that for OS9. Well, yeah, but BASIC09 can make up for a lot of it. But like other areas of OS-9 6809, the thing I find disconcerting is that as good as it is, it could stand improving, and Microware seems to have become complacent about fixing bugs and such. Frankly, I haven't used BASIC09 in a long time, having been using C almost exclusively lately, but in the back of my mind I vaguely remember finding a bug or two. -- Jim Omura, 2A King George's Drive, Toronto, (416) 652-3880 ihnp4!utzoo!lsuc!jimomura Byte Information eXchange: jimomura