DefFnreport%(a$,no%,type%,buttons%,progname$)
local flag%,r1%,eblock%,q$
eblock%=allocate(5+len(a$))
flag%=0
Case buttons% of
     when 1
        flag%=flag% or %1
     when 2
        flag%=flag% or %11
     otherwise
        error 1,"Unknown number of buttons"
endcase
case type% of
    when 0
           
    when 1
        flag% = flag% or %001100010000
    when 2
        flag% = flag% or %010100000000
     when 3
        flag% = flag% or %011100010000
    when 4
        flag% = flag% or %100100010000
 otherwise
 error 1,"Unknown number type"
endcase
storeint eblock%,no%
storestring eblock%+4,a$
sys "Wimp_ReportError",eblock%,flag%,progname$ to ,r1%
free eblock%
=r1%

     
     


