module myfunction();
    function [31:0] myfunction;
            input [31:0] a;
            localparam bytes = 4;
            begin
              for(i=0; i<4;i= i+1)
              begin
                myfunction[8*i + 7: 8*i] = input[(3 - i*8) + 7 :   (3 -i)*8];
              end
    endfunction
endmodule
I am getting error of malformed statement on line myfunction in for loop. I am very new to verilog. Please help me with the error