The order that Blitz calls ReadLine for each of the 4 arguments for the Graphics3D command like other programming languages is not guaranteed (you are incorrectly assuming blitz will evaluate your 4 arguments from left to right).
You must ReadLine into variables in order to guarantee the correct order as in the following (note blitz's automatic string to int conversion):
w%=ReadLine(gfile)
h%=ReadLine(gfile)
d%=ReadLine(gfile)
m%=ReadLine(gfile)
Graphics3D w,h,d,m
You must ReadLine into variables in order to guarantee the correct order as in the following (note blitz's automatic string to int conversion):
w%=ReadLine(gfile)
h%=ReadLine(gfile)
d%=ReadLine(gfile)
m%=ReadLine(gfile)
Graphics3D w,h,d,m