Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about handling arrays...

Status
Not open for further replies.

GWhiz

Programmer
Dec 16, 1999
49
US
Hi, folks!

As I understand it, arrays don't scope quite the same way that non-arrayed variables do. So.....even with an array declared as "Public", an array that gets its values in one procedure doesn't necessarily carry those values into another procedure, even in the same module.

Is that correct? I have a two-dimensional dynamic array declared "Public". It gets Redim Preserve in one procedure, goes to another procedure (in the same module) in which the array gets its values.....but when I try to use to those array values in a 3rd procedure (in the same module), my array values seem to get re-set to 0.

I'm not sure why this is happening because there are no intervening lines of code that cause the array to be re-set.

Any suggestions on how to hold on to array values so they can be accessed like regular Public or Global variables?

Thanks so much, folks. You've been so helpful in the past.

Respectfully,

GWhiz
 
can you post the code?
Good Luck
------------
Select * from Users where Clue > 0
0 rows returned
 
Ahhhhhh.......ty for your response, Cajun.

Have beat my head against the wall here for the last 24 hours trying to solve this. I didn't realize that setting the value (true/false) property of a togglebutton on the fly caused the on_click event for that togglebutton to be executed -- even if you don't specifically call the on_click event.

I simply wanted the button to return to a certain way of looking without executing the on_click code. In the on_click event, there was code which caused my array to be re-set.......but I "assumed" that that couldn't be happening because I was only changing the property.....not invoking the on_click event.

This stuff sure gets aggravating sometimes.

Thanks for your help.....and you DID help by forcing me to look at some areas of my code that I thought had nothing to do with the problem.

Respectfully,

GWhiz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top