variables

Blitz3D Forums/Blitz3D Beginners Area/variables

jeffmorris(Posted 2007) [#1]
I wish to create a function like this:

createblock(name,x,y)

where name is the name of the mesh handle and the image file.
where x and y are coordinates.

I want to use one variable for mesh and image file but I get an error message while trying to load the image file. For now, I have to create the function like this:

createblock(mesh,"name",x,y)

Is it possible to convert the mesh handle to a string variable?

I rather use

createblock(nyc0001,0,0)

than to use

createblock(nyc0001,"nyc0001",0,0)


Gabriel(Posted 2007) [#2]
No. Blitz3D does not have ( nor is it ever likely to have ) runtime reflection. It compiles your code into assembly language before executing it, so your variable names are no longer there. By the time you run the program, the code has no idea what you named your variables so you're just passing it strings that mean nothing to it.