[Coco] Basic09 Whats Wrong.

Wayne Campbell asa.rand at gmail.com
Fri Oct 19 15:13:57 EDT 2018


I will look at them more closely this evening, but I can tell you the first
one errors because you can't pass numbers from the command line as numbers.
Shell+ treats all parameters as strings. You have to convert the strings to
numbers before you operate on them.

PARAM x,y:STRING
DIM a,b:INTEGER

a:=VAL(x)
b:=VAL(y)

I have to look up the error codes but I think the second is seeing a
garbage string and can't process it.

On Fri, Oct 19, 2018, 11:58 AM <coco at jechar.ca> wrote:

>
>   Two simple programs but neither correct
>
>   program a.b089 results in an error 27 when loading is attempted.
>   program t.b089 results in an error 69 when loading is attempted.
>
>    Code for a.b089 follows:
> PROCEDURE a
> PARAMETER a,b:INTEGER
> PRINT a+b
> END
>    Code for t.b089 follows:
> PROCEDURE t
>
> PARAM x,y:STRING
>
> IF y="" THEN
>     PRINT"Two parameters required."
> ENDIF
>
> IF y<>"" THEN
>     PRINT "X=",x
> ENDIF
>
> IF y<>"" THEN
>     PRINT "Y=",y
> ENDIF
>
> END
>
> Why ?
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list