I also used the huge dungeon tutorial as a starting point for my dungeon game, so I know what you are trying to do.
This code works fine...
dim map$(100,100)
map$(10,10)="#"
curposx=10.6
curposz=10.1
mapchar$ = map$(curposx,curposz)
If mapchar$ = "#" then print "Wall"
if mapchar$ = ":" then print "Floor"
wait key
As you can see, you don't need to use int() on the cursorposx or cursorposz values, because array index values are always integers. DBPro converts them as needed.
But you cannot use mapchar instead of mapchar$. I suspect you are NOT doing this, but simply mis-typed it in the code box.
Arrays default to being global, so unless you explicitly defined map$ as local, scope is not your problem, as illustrated in this code...
dim map$(100,100)
map$(10,10)="#"
curposx=10.6
curposz=10.1
mapchar$=showmapchar(curposx,curposz)
if mapchar$ = "#" then print "Wall"
if mapchar$ = ":" then print "Floor"
wait key
end
function showmapchar(xpos as integer,zpos as integer)
a$ = map$(xpos,zpos)
endfunction a$
If you had used a value that was outside your array dimensions, the error would have been just that - "Runtime Error 118 - Array does not exist or array subscript out of bounds at line xx", so that's probably not your problem.
An error indicating an undefined array would suggest you look for an array that you have not defined, either in the line indicated, or as often happens in DBPro, look in the lines just before what the error code says. Either way, without seeing your code, we're all just guessing.
EDIT: looking at the code in your other thread, I didn't notice any undefined arrays, but I can't check it until I get home from work. Post your cleaned up code, and I *can* look at it while I'm at work.