begin
    recordformat fubar(integer a,b, (bytearray c(1:10) or string(9) s), short d)
    record(fubar) snafu = 0
    integer i,l,u

    snafu_s = "fubar"

    { Using the SIZEOF and TYPEOF+typename functions for each record field }
    printstring("SIZEOF(snafu)=");write(sizeof(snafu),0);newline
    printstring("TYPEOF(snafu)=");printstring(typename(typeof(snafu)));newlines(2)

    printstring("SIZEOF(snafu_a)=");write(sizeof(snafu_a),0);newline
    printstring("TYPEOF(snafu_a)=");printstring(typename(typeof(snafu_a)));newlines(2)

    printstring("SIZEOF(snafu_b)=");write(sizeof(snafu_b),0);newline
    printstring("TYPEOF(snafu_b)=");printstring(typename(typeof(snafu_b)));newlines(2)

    printstring("SIZEOF(snafu_c)=");write(sizeof(snafu_c),0);newline
    printstring("TYPEOF(snafu_c)=");printstring(typename(typeof(snafu_c)));newlines(2)

    printstring("SIZEOF(snafu_c(1))=");write(sizeof(snafu_c(1)),0);newline
    printstring("TYPEOF(snafu_c(1))=");printstring(typename(typeof(snafu_c(1))));newlines(2)

    printstring("SIZEOF(snafu_s)=");write(sizeof(snafu_s),0);newline
    printstring("TYPEOF(snafu_s)=");printstring(typename(typeof(snafu_s)));newlines(2)

    printstring("SIZEOF(snafu_d)=");write(sizeof(snafu_d),0);newline
    printstring("TYPEOF(snafu_d)=");printstring(typename(typeof(snafu_d)));newlines(2)

    { Accessing via %name }
    record(fubar)name bilbo == snafu
    { Using the SIZEOF and TYPEOF+typename functions for each record field }
    printstring("SIZEOF(bilbo)=");write(sizeof(bilbo),0);newline
    printstring("TYPEOF(bilbo)=");printstring(typename(typeof(bilbo)));newlines(2)

    printstring("SIZEOF(bilbo_a)=");write(sizeof(bilbo_a),0);newline
    printstring("TYPEOF(bilbo_a)=");printstring(typename(typeof(bilbo_a)));newlines(2)

    printstring("SIZEOF(bilbo_b)=");write(sizeof(bilbo_b),0);newline
    printstring("TYPEOF(bilbo_b)=");printstring(typename(typeof(bilbo_b)));newlines(2)

    printstring("SIZEOF(bilbo_c)=");write(sizeof(bilbo_c),0);newline
    printstring("TYPEOF(bilbo_c)=");printstring(typename(typeof(bilbo_c)));newlines(2)

    printstring("SIZEOF(bilbo_c(1))=");write(sizeof(bilbo_c(1)),0);newline
    printstring("TYPEOF(bilbo_c(1))=");printstring(typename(typeof(bilbo_c(1))));newlines(2)

    printstring("SIZEOF(bilbo_s)=");write(sizeof(bilbo_s),0);newline
    printstring("TYPEOF(bilbo_s)=");printstring(typename(typeof(bilbo_s)));newlines(2)

    printstring("SIZEOF(bilbo_d)=");write(sizeof(bilbo_d),0);newline
    printstring("TYPEOF(bilbo_d)=");printstring(typename(typeof(bilbo_d)));newlines(2)

    { Accessing using the Dope Vector }
    printstring("Dimensions of bilbo_c=");write(array dimensions(bilbo_c),0);newlines(2)
    printstring("Array Entry Size of bilbo_c=");write(array entry size(bilbo_c),0);newline
    printstring("Array Entry Type of bilbo_c=");printstring(type name(array entry type(bilbo_c)));newline
    for i = 1,1,array dimensions(bilbo_c) cycle
        l = array lower bound( bilbo_c, i )
        u = array upper bound( bilbo_c, i )
        printstring("Dimension(");write(i,0);printstring(")=(");
        write(l,0);printstring(":");write(u,0);printstring(")");newline
    repeat
    
endofprogram