I dim the array at the top of the code outside of all functions and loops, but am trying to access array within a function.
Here is entire function if it helps:
Function checkToolbar()
if mbutton(953,1010,720,768) = 1 then num=1
if mbutton(870,934,720,768) = 1 then num=2
if mbutton(7,80,720,768) = 1 then num=3
SELECT num
CASE 1:
paste image 130,0,718
ENDCASE
CASE 2:
paste image 131,0,718
if mouseclick() = 1
if infoscreen = 0
infoscreen = 1
wait 200
else
infoscreen = 0
wait 200
endif
endif
ENDCASE
CASE 3:
paste image 132,0,718
if mouseclick() = 1
if invenscreen = 0
invenscreen = 1
wait 200
else
invenscreen = 0
wait 200
endif
endif
ENDCASE
CASE DEFAULT:
paste image 129,0,718
ENDCASE
ENDSELECT
if infoscreen = 1
paste image 133,100,100,100
controls = 0
endif
if invenscreen = 1
paste image 134,5,100,100
controls = 0
for x = 0 to 29
if iinventory(x) > 0
`paste image iinventory(x),10,10
endif
next x
endif
if infoscreen = 0 and invenscreen = 0 then controls = 1
ENDFUNCTION