Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Need help with a Varible problem in a Program  (Read 922 times)
Magnum357jhp
Community Member
*
Posts: 128


« on: May 28, 2009, 04:09:42 PM »

I'm having problems with a program that I'm working on that I think (?) might be related to varibles and scope.  Basically, the program works like this.  Its a text based game were you enter what perameters you want and then click a button to see what the result is.  The program does this ok, but I built in the option for the user to click another button to open up another window to see what statistics and data has been recorded. 

This other window simply displays the data recorded, but the problem I'm having shows up when I close the window (with an exit button I created), run another cycle of the program, then open up the window again to see the next set of data being recorded.  This time, the window does not display the data that was recorded the for next cycle for some reason.  The really strange part though is when I close the data recording window with the "X" button in the top right had corner of the window, the data DOES display properly after the next cycle of data is recorded in the program. 

So basically, the window has two ways to close the window, you can either press the "Exit" button (which will not display the next series of cycled data) or you can use Windows "X" button to close the data and the window WILL display the data properly for the next cycle of data.  So I must ask, what is the difference between using my "Exit" button I created and Windows "X" close button to close the window properly?  I have tried using ".hide" with my user created "Exit" button and I have tried setting the ".Visible" property to "False" to make the window close, but both of these methods still won't update the varibles in the data window, only by pressing the "X" button will the program record and display the data properly with the next cycle of data.  What does the "X" close button do that is different in this case?

I'm using VB6 with Windows 98 and XP to work on this program.  Any info would be most appreciated.
« Last Edit: May 28, 2009, 04:12:03 PM by Magnum357jhp » Logged

"There is no such thing as the ultimate programming language.  Every language has its weaknesses."
uncasid
Community Member
*
Posts: 109


« Reply #1 on: May 28, 2009, 05:02:50 PM »

sounds like a state issue.. Post your code so I can find the problem.
Logged
rootsage
Customers
Community Member
*****
Posts: 444

Gamer Enthusiast


WWW
« Reply #2 on: May 29, 2009, 01:58:34 AM »

So I must ask, what is the difference between using my "Exit" button I created and Windows "X" close button to close the window properly?

The difference lays in the code your using behind your button. Like uncasid said, post the code for that stats window, so we can see what is happening when your 'Exit' button is hit.
Logged

while( !( succeed = try_again()) );
------
10 print "Is this recursive?"
20 goto 10
pabloescobar
Customers
Community Member
*****
Posts: 150


WWW
« Reply #3 on: May 29, 2009, 08:31:04 AM »

Inside your "Exit Button", just put the command "Unload Me" instead "Form.Visible=False".
Logged

-----------------------------
http://www.cristianocouto.com.br
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks