NEED HELP WITH BEGINNER CODE "Expecting end file"
BlitzPlus Forums/BlitzPlus Beginners Area/NEED HELP WITH BEGINNER CODE "Expecting end file"
| ||
I cant figure out why i continually recieve an "end of file" error every time i go to launch the code. Please let me know if you can find out what is wrong. Graphics 640.480.0.1 SetBuffer BackBuffer() Global backgroundimage = LoadImage("background.png") While Not KeyHit(1) Cls Flip Wend End Function fdrawimage() DrawImage(backgroundimage.0.0) End Function |
| ||
background.png Is corrupt? You need to call fdrawimage between while and wend |
| ||
in functions, each reference/variable needs to be separated by a comma, not by a dot. |
| ||
in functions, each reference/variable needs to be separated by a comma, not by a dot. And just to be clear, Graphics is also a function. |
| ||
"Expecting end of file" really just means the compiler can't make sense of your code. If you look carefully when the compile fails the cursor is located just after Graphics 640.480 The Graphics command expects some numerical values separated by commas. 640.480 is a number, albeit a strange one for Graphics. But as soon as the compiler reaches Graphics 640.480. the code has become meaningless. |
| ||
lol dumb me |
| ||
should be Graphics 640,480,0,1 SetBuffer BackBuffer() Global backgroundimage = LoadImage("background.png") While Not KeyHit(1) Cls fdrawimage() Flip Wend End Function fdrawimage() DrawImage(backgroundimage,0,0) End Function That should have your background on :) |
| ||
Does using the drawimage Inside of a function do something to improve the program flow? From what I can see, that program should work when using DrawImage(backgroundimage,o,o) in the spot where fdrawimage() is being called. |
| ||
Umm..why are you using "." instead "," between parameters? |
| ||
Sorry about that ! Matty Correction done ! |