code tested for Scilab 5.3.3
basic code execution implemented.

thanks to prathamesh920 for mode(2)
thanks for jayparikh111 for reporting syntax error bug
thanks to saketkc for !--error-2 suggestion