[Coco] How to use runb?

Wayne Campbell asa.rand at gmail.com
Sun Apr 5 10:48:03 EDT 2020


I was just about to send a message when yours showed up, Greg. That is
exactly the issue. The name of the procedure cannot be piper. I changed it
to thru2 and it worked just fine from the command line. Didn't even have to
type runb, just:

[TERM|02]:thru2

Why thru2? Because I wrote a slightly different version and called it thru,
and that's how I discovered it was the name piper that was causing the
problem. I renamed Walter's piper to thru2 and it worked fine.

The problem with yours, Walter, is that there's no way to exit the loop
since EOF never occurs on stdin. Here's my solution, but because of the PUT
statement I couldn't add the line reference without going to extra steps:

PROCEDURE thru
DIM in:BYTE
DIM lcnt:INTEGER
DIM out$:STRING[3]

lcnt:=0
out$:=""

LOOP
  GET #0,in
  IF in>$1F THEN
    IF LEN(out$)=3 THEN
      out$:=RIGHT$(out$,2)
    ENDIF
    out$:=out$+CHR$(in)
  ENDIF
EXITIF out$="end" THEN
ENDEXIT
  lcnt:=lcnt+1
  PUT #1,in
ENDLOOP
END

Wayne

The Structure of I-Code
http://www.cocopedia.com/wiki/index.php/The_Structure_of_I-Code



On Sun, Apr 5, 2020 at 7:13 AM Greg <glaw at live.com> wrote:

> Do you also have the piper device driver loaded in your OS9Boot file? If
> you do, runb is trying to link and execute the piper device driver and this
> is not a Basic09 I-Code module.
>
> I seem to recall checking for EOF on stdin for an SCF device works fine
> but it requires setting the EOF character in the device descriptor (I think
> the default is 1B or escape) and providing this character at the end of the
> input.
>
> On 4/5/2020 2:08:03 AM, "Walter Zambotti" <zambotti at iinet.net.au> wrote:
>
> >That's weird.
> >
> >If I run the packed version with basic09 like so:
> >
> >$ basic09 piper
> >
> >It works
> >
> >$ runb piper
> >ERROR #051
> >
> >So not sure!
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list