Why doesn't this code work?

Blitz3D Forums/Blitz3D Programming/Why doesn't this code work?

Amanda Dearheart(Posted 2009) [#1]
For some strange reason this code brings up an" expected END FUNCTION" call.



I've doublechecked the code with the Blitz3d docs. It looks like all the syntax is entered correctly. The reason why I know it is the PositionMesh command that is causing the problem is that I remmed it out with ; and I get an Memeory access error. I removed the instruction entirely and the program ran fine, a perfect black screen.


Matty(Posted 2009) [#2]
Not sure if this is something you've forgotten in the code posted above but "info" should either be a global variable or passed into the other functions that write to that stream, otherwise it will have a zero value in the other functions and writing to the stream won't work.

I'm sure you would have checked that the mesh is a valid mesh file and that it exists in the folder you've changed to. What happens if you run it in debug mode?


Amanda Dearheart(Posted 2009) [#3]
Thanks for the advice about info. Maybe that is what is causing the Memory access. BTW, now that I know that DebugLog exists, I've decided to use that instead of reinventing the wheel.

If by checking a valid mesh, you mean

If DIE = 0 then ; mesh didn't load

yes, I've done that, but the program crashes before it reaches that line, or it doesn't compile?


Floyd(Posted 2009) [#4]
Despite the misleading message the syntax error has been correctly located, as indicated by the position of the cursor. It is a missing comma.


Amanda Dearheart(Posted 2009) [#5]
Floyd, you're fantastic, you're groovy, you're uncanny.
You like Pizza or Carl's jr Famous Stars.
Your next meal is on me!!!


John Blackledge(Posted 2009) [#6]
Yeah - we've all done that. Doh!


Kryzon(Posted 2009) [#7]
Your next meal is on me!!!

He's going to eat food off your body?


Amanda Dearheart(Posted 2009) [#8]
Aww, come on guys, you've been logging on too many adult sites!!
Hehe