Page 1 of 1

Array handling errors...

Posted: Tue Aug 09, 2005 11:53 pm
by tlsuess
Hi everyone!

I'm writing a GUI library with objects and a nice interface. I am using arrays and TYPEs to define the objects and store them into memory and ease programming.

I am trying to compile this into a QuickLibrary, but when I run a program with all of the DECLAREs, DIMs, COMMONs, and REDIMs as the library, I get these errors. I get "Subscript out of range" errors with messages and CPU handle errors. QBasic usually crashes and returns me to the DOS prompt.

However, when I put the same code from the program in the source of the GUI library and run it, nothing happens. I know it's an array error, and I'd like to ask if you could help me with this error. I'm not sure how to get the arrays to work correctly.

My best definition is that a function in the GUI library writes to an array, but I'm guessing it isn't writing to it correctly in the program's declaration of the same array as defined in the GUI library. Any help is much appreciated.

Thank you. :)

Todd

no problem

Posted: Wed Aug 10, 2005 3:58 am
by mennonite
in the part of your code with the redim problem, do the thing you're not doing and take the last bit out where you've got the array element you shouldn't have.

then in the subroutine in the middle, you've got a place where you're not supposed to do the thing you're doing.

also you're not resetting the variable in the part with the other thing.

and the bit with the part of the other part needs to be changed. in the other if... then.

no offense meant, but it's really obvious if you look at the code. i'm sure you'll spot it as easily as i did. please let us know if we can do anything else to help, and best luck with your project :)