[Coco] Using the Basic09 type statement.

coco at jechar.ca coco at jechar.ca
Sun Apr 4 09:14:55 EDT 2021


I am trying to create a type that consists of a field that is a 21 
character string
followed by a field that is an array of 17 character strings. I read 
some documentation and am not sure it is even possible this was my 
attempt and it's errors,

PROCEDURE ttype
  0000
  0001      TYPE LINE=sline:STRING[17]
  0011      TYPE HEADER=head:STRING[21]
  0021 ERR     TYPE SCREEN=head:HEADER;sline:LINE[6]
  0049      (* Trying to say that type SCREEN is a HEDER followed by an 
array of 6 LINEs s each consisting of up to 17 characters. *)
  00C2
  00C3      DIM aline:LINE
  00CC      DIM ahead:HEADER
  00D5      DIM apage:PAGE
  00DE
  00DF      apage.ahead="This is the Header field of the page"
  010E ERR     apage.aline(1) "This is line ONE of the page."
  013F ERR     apage.aline(2) "This is line TWO of the page."
  0170 ERR     apage.aline(3) "This is line THREE of the page."
  01A3
  01A4      PRINT apage
  01A9
  01AA      END
00DD ERROR #024
00E6 ERROR #066
010D ERROR #071

Can this be fixed or am I trying to do the impossible.

Charlie


More information about the Coco mailing list