[Coco] Run Time Error 203 "Illegal Mode"

coco at jechar.ca coco at jechar.ca
Mon Aug 10 15:33:40 EDT 2020


On 2020-08-10 16:10, Wayne Campbell wrote:
> OK. I had to refresh my memory and make sure I was remembering the 203
> error correctly. 203 is an input/output error. Generally, it means you 
> are
> attempting to operate in a file in a manner not consistent with the way 
> you
> opened or created it. Usually, it means you are attempting to write to 
> a
> read only file (:READ) or read from a write only file (:WRITE). If it 
> isn't
> a file, then you are operating on a module as input that should be 
> output
> or vice-versa.
> 
> I agree with what Curtis wrote. You should provide some code here that 
> can
> help us determine where the problem is occuring.
> 
> Wayne
> 
> 
> On Mon, Aug 10, 2020 at 10:51 AM <coco at jechar.ca> wrote:
> 
>> 
>> I have a basic09 module the source compiles fine but when
>> I try to run it it gives an error 203.
>> 
>> Not sure where to even start to figure out what's wrong.
>> Would anyone know what are the most common sources of a 203 error ?
>> 
>> Charlie
>> 
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> https://pairlist5.pair.net/mailman/listinfo/coco
>> 

The Code two related GOSUB subroutines.

(* Subroutines *)
100 (* CAPS last setup tem-file *)
SHELL "touch /dd/TEMP/dirlist.tmp"
SHELL "del /dd/TEMP/dirlist.tmp"
SHELL "ls > /dd/TEMP/dirlist.tmp"
RETURN
200 (* CAPS last *)
GOSUB 100
OPEN #fp,"/dd/TEMP/dirlist.tmp":READ
WHILE NOT EOF(#fp) DO
    READ #fp,line$
    tc=ASC(MID$(line$,1,1))
    cv=LEN(line$)
    IF cv<25 THEN
       IF tc<97 THEN
          SHELL"RENAME "+line$+" zzz"+line$
       ENDIF
    ENDIF
ENDWHILE
CLOSE #fp
SHELL "DIRSORT"
GOSUB 100
OPEN #fp,"/dd/TEMP/dirlist.tmp":READ
WHILE NOT EOF(#fp) DO
    READ #fp,line$
    c$=MID$(line$,1,3)
    cv=LEN(line$)
    IF c$="zzz" THEN
       c$=RIGHT$(line$,(cv-3))
       SHELL "RENAME "+line$+" "+c$
    ENDIF
ENDWHILE
CLOSE #fp
RETURN




More information about the Coco mailing list