Qbasicnews.com

Full Version: odd error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
anyone remember that problem with making an indexing subroutine for put images? Well, I was doing some more work on it in trying to find the problem, and the problem seems to be right here:

makeindex tiles(), tilesindex()

right there is where I get the "memory could not be read error". Here is code that i believe should be sufficient... I didn't include the "makeindex" sub b/c the error doesn't occur in the sub, but when it tries to access the sub.

Code:
declare sub makeindex (imagearray(), indexarray())

redim shared tiles(1) as short
redim shared tilesindex(1) as short


loadtiles "tiles/set.put", tiles()
makeindex tiles(), tilesindex()

here are some concerns i have about these...

1. could redim sharing do this? I don't think short has anything to do with this.
2. could redimming them with only 1 do this?
3. should i just dim then normally?

anyways, anyone who helps or tries to help, i thank you. Smile [/code]
Another check missed, fixed.. different parameter and argument types, your arrays are shorts (16-bit), but the arguments have no explicit type, so the default one (integer, 32-bit) is assumed.
I was wondering if this was it. I was going to try giving the variables in the dimension name the short symbol, except i didn't know if short had one. Now i can work around that. i'll just use "as short" then in my subs. thanks alot vic. Big Grin

**Edit**

fixed. thanks again!