Illegal Memory Address

Blitz3D Forums/Blitz3D Beginners Area/Illegal Memory Address

GeekTeacher(Posted 2005) [#1]
Putting just the name of a picture (and having it in the same directory) in the program code doesn't work for .exe's like it does for running through compiler. Can I put something similar to "../Picture.bmp" in the directory to load images/ textures and have it work (if images are in same directory as .exe).


Ross C(Posted 2005) [#2]
Do you have any code to demonstrate your problem? That shouldn't happen.


GeekTeacher(Posted 2005) [#3]
cube=CreateCube()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cubetex=LoadTexture("C:/Documents and Settings/Owner/My Documents/My Programs/BB/Testing/Water.bmp")
;Using this method works but I'd like to be able to use a shortcut.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
EntityTexture cube,cubetex

plane=CreatePlane()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
planetex=LoadTexture("Water2.bmp")
;This only works when running through Blitz3D compiler and as an executable.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
EntityTexture plane,planetex


Ross C(Posted 2005) [#4]
What version of blitz are you running?


GeekTeacher(Posted 2005) [#5]
The About Blitz Basic in the help menu says:

IDE V1.64 - Linker V1.64 - Runtime V1.64

Is there a way to get updates and stuff?


Perturbatio(Posted 2005) [#6]
There's an Update Forum :)


GeekTeacher(Posted 2005) [#7]
I downloaded and installed V1.90 but I still get the same error.

Does anyone know a shortcut to the directory the executable is in?


Floyd(Posted 2005) [#8]
SystemProperty( "AppDir" )


Ross C(Posted 2005) [#9]
Hmmmm, could you post a zip file with everything in it. So we can test exactly what your doing :o)


big10p(Posted 2005) [#10]
If you're running your exe via a shortcut, you may need to add
ChangeDir SystemProperty("AppDir")

somewhere at the start of your code, which is what Floyd was getting at, I think.