[Coco] a new problem with decode

Wayne Campbell asa.rand at gmail.com
Wed Apr 16 17:28:44 EDT 2014


The fix is done. It turned out to be a boolean not set properly. To
elaborate, I use booleans to determine which files are open and which are
closed. When a file gets opened, the corresponding boolean is set TRUE.
When the file is closed, the boolean gets set to FALSE. In this case, I set
the boolean FALSE, but in the wrongf place, so as far as the error trap was
concerned, that file should have been open and it was repeatedly erroring
when trying to close the file.

In addition, I was able to solve the 67 error that ErrorCodes has been
returning from within decode. I had neglected to change the parameters to
strings when calling ErrorCodes from the shell. I learned some time ago
that, when the shell passes parameters to Basic09, it makes them all
strings. When you would think that:

OS9:errorcodes 216 1

(216 and 1 being INTEGERS) would work, but the shell turns them into "216"
"1". BOOLEANs also are affected. You would think TRUE or FALSE could be
passed and B09 would resolve which token to use, but no. The shell turns
them into "TRUE" and "FALSE". If you want to pass numbers or booleans, you
*MUST* use the syntax:

OS9:procedure("string",integer,TRUE)

and it should work. This defeats the purpose of the shell being able to
pass parameters using the form:

OS9:procedure string integer TRUE

I started using only string parameters when calling from the shell, and
errorcodes and decode are no exception. However, this means that if I want
to pass those types, I have to do so using some other delimiter between
types and accepting it as one big string, then parse the string for its
contents.

Wayne

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

decode
http://cococoding.com/wayne/



More information about the Coco mailing list