CompuServe Messages

#using DevPac

    09-Sep-95 15:24:01
Sb: #48046-#using DevPac
Fm: Bart Mathias 72017,1005
To: Phillip Wooller 100024,2227
Phill, I'm really glad to hear from you. I knew another user (in England) but he joined a monastery last spring (no connection with computing). I was wondering if I should try readargs, but haven't gotten around to it yet. It didn't exist when I wrote the working version of the program. If I give the program below (I hope it's short enough to send) a fake name ("none") in the Arguments requester, and run it in the debugger, I get a window with the following message: Cannot find such a file as none If I run it from the Edit screen, I get messages (varying) like the following: Cannot find such a file as noneba#"\ "a@#o"aa"aa"aD"aI (I don't know how those Alt characters will come through on CompuServe, but there are 23 characters after the "none" in this case, copied with Amiga^C into this file. I had to run it twice. Left the copy in the Clipboard and closed Devpac, and crashed with an 81000005. Next time I moved it into this file before quitting Devpac. And then quit Devpac to the tune of another 81000005!) The relevant parts of the program: include /system use the pre-assembled header include diskfont/diskfont.i include diskfont/diskfont_lib.i start: movem.l a2-a6/d2-d7,-(sp) movea.l a0,a2 {At this point I open dos.library, intuition.library, graphics.library, and {diskfont.library, with no problems. I also use the standard procedure {to get and save the console handle, with branch-to-close on failure. {I delete as irrelevant here. move.l a2,a0 Put name ptr back in A0 lea textname,a1 Address storage space for name move.b (a0)+,d0 First byte to D0 for examination cmpi.b #$0a,d0 bne.s 3$ lea nofilstr,a0 {irrelevant–this part works} bsr cliout bra close 3$ move.b d0,(a1)+ Add character to title addi.b #1,wrngfstr move.b (a0)+,d0 and get the next cmpi.b #$0a,d0 bne.s 3$ go add to title move.b #0,(a1)+ Null to end of file name move.b $0a,(a1) and a LF addi.b #2,wrngfstr bsr infile {a routine to read the requested file to a buffer} tst.l d0 bne.s two {branches if successful file read. Not relevant} lea wrngfstr,a0 bsr cliout bra close {to an ordinary, problem-free close procedure} cliout: move.l conshndl,d1 moveq #0,d3 move.b (a0)+,d3 move.l a0,d2 CALLDOS Write away: rts {All irrelevant material deleted here} wprngfstr: dc.b 41,$9b,'33;40mCannot find such a file as ',$9b,'31;40m' textname: ds.b 126 ;textname must follow wrngfstr!