the form that wont die...

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2007
Posts: 100
Reputation: squidd is an unknown quantity at this point 
Solved Threads: 2
squidd squidd is offline Offline
Junior Poster

Re: the form that wont die...

 
0
  #11
Nov 21st, 2008
ok i have been busy redoing a lot of the code....

the form intermittently does the aforementioned initial problem now. VERY strange indeed.

I will attempt to redo the entire code for the form that is looping for no apparent reason in the next day or two.

Now to answer a few questions....

the "1" was used before when I was actually looking to see if a file that held the encrypted password was there or not. If it wasnt there, then "goto 1," which ended the procedure. But now I'm not using a file to store the encrypted password. I am writing it to the registry instead (also encrypted). Much better this way imho.

the Pause in the code was (and still is used) if a password has been previously entered in to load the next form. The reason i used the Pause was because the GUI looks kinda cool and it allowed for a little time for the user to see what is actually happening. The Pause is now set at 2 instead of 1.5.

Also, the Pause is a valid command since I have code to actually count (in seconds instead of milliseconds) in a separate procedure/subroutine.

Lastly, I have tried an 'unload form' already to no avail because as it loops, it simply reopens the form that was unloaded. I tried that before i posted this problem here. Good suggestion however.

Hope that clears some things up. The problem is still not solved though. :\

Thanks for the help very much. Im sure eventually it will get it figured out. Hopefully sooner than later.
Last edited by squidd; Nov 21st, 2008 at 1:29 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 13
Reputation: BigSeckC is an unknown quantity at this point 
Solved Threads: 0
BigSeckC's Avatar
BigSeckC BigSeckC is offline Offline
Newbie Poster

Re: the form that wont die...

 
0
  #12
Nov 21st, 2008
NP.... as I said before, I'm learning too so I'm having to use 'logic' to try and decode the code

I'm hoping to find an answer too because I have a project in mind that could run into the same type of situation. Solve it now, less headache later
I am who I am...I do what I do
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 100
Reputation: squidd is an unknown quantity at this point 
Solved Threads: 2
squidd squidd is offline Offline
Junior Poster

Re: the form that wont die...

 
0
  #13
Nov 22nd, 2008
Good thinking.

Just to let you know... I tried to completely redo the code and that dide work either. Since there is 3 different if then statements, and it DOES repeat 3 times, I started thinking that the number of IF-Then statements is the reason for the number of repeats. They are all inside one subroutine/procedure.

The problem is, I cant really simplify it. I suppose i could use a "Case" statement instead, but I haven't ever seen a case argument that has multiple lines after it in any examples of source that i have looked at. Logically, it "could" work. But, I just dont know about "Case" coding that well to say for sure right now.

I will go on the premise that because in this one sub/procedure that there are 3 if..then statements. It is the only thing that makes sense at the moment for the number of repeats I am getting. Where in the heck are the experienced coders for VB? I am pretty sure that a several of them, at the very least, have enough knowledge to easily fix this little problem.

Patiently awaiting a reason why this thing repeats when it swhouldnt.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 24
Reputation: kain_mcbride is an unknown quantity at this point 
Solved Threads: 3
kain_mcbride's Avatar
kain_mcbride kain_mcbride is offline Offline
Newbie Poster

Re: the form that wont die...

 
0
  #14
Nov 22nd, 2008
Originally Posted by BigSeckC View Post
I'm assuming that the program is being told to wait 1.5 seconds before continuing. Is 'pause' not a valid command?

It makes sense 'logically'...but if it's not a command - it's not a command.
not a command as far as i know, there use to be a sleep command in qbasic (i think)... but writing a pause sub is doable to say the least... assuming one was written for use with this program, how its set up could be part of the problem i guess...

funny, i've never used form.visible = true / false to show or hide forms... always just used .show or .hide... didn't even know it worked until now... well there's my new thing for the day

[edit]ok... so i probably shouldn't be posting at 6:30 am with no sleep... sorry, didn't notice the second page [/edit]
Last edited by kain_mcbride; Nov 22nd, 2008 at 7:37 am. Reason: ... unseen preceeding posting...
... there is no bug that enough coffee cannot fix...
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 29
Reputation: arghasen is an unknown quantity at this point 
Solved Threads: 4
arghasen arghasen is offline Offline
Light Poster

Re: the form that wont die...

 
0
  #15
Nov 22nd, 2008
yes it seems so, but i think it will not do any problem for the pause command
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 100
Reputation: squidd is an unknown quantity at this point 
Solved Threads: 2
squidd squidd is offline Offline
Junior Poster

Re: the form that wont die...

 
0
  #16
Nov 22nd, 2008
the code for pause goes as follows and I am fairly certain that it is not part of the problem:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Sub pause(interval)
  2. Current = Timer
  3. Do While Timer - Current < Val(interval)
  4. DoEvents
  5. Loop
  6. End Sub
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 24
Reputation: kain_mcbride is an unknown quantity at this point 
Solved Threads: 3
kain_mcbride's Avatar
kain_mcbride kain_mcbride is offline Offline
Newbie Poster

Re: the form that wont die...

 
0
  #17
Nov 23rd, 2008
looking at that, wouldn't think so...

alright, unrelated to the form not disapearing... i have a question about your code...

what happens if someone uses presetpass as their password? (or some random combination of alphanumeric characters that happens to contain the string reset in the somewhere inside of it..?

as a note... with the code provided; i can see no reason that the form would keep coming back...
... there is no bug that enough coffee cannot fix...
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 100
Reputation: squidd is an unknown quantity at this point 
Solved Threads: 2
squidd squidd is offline Offline
Junior Poster

Re: the form that wont die...

 
0
  #18
Nov 23rd, 2008
I'm not sure I understand what you mean. But as far as the password goes, if there is no password at all, it asks if you want to make one. If not, then the password form does not come up. If you do want to. then it does.

After that, it saves the password to the registry (encoded). There is no preset pass to check. It won't look for a password until one has been created, but if it has been saved already in a prior running of the program, then the program checks for the password.

If it is there, the program will start. If not, then it wont. Simple as that.

I dont really understand the question. I hope this answers it.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 24
Reputation: kain_mcbride is an unknown quantity at this point 
Solved Threads: 3
kain_mcbride's Avatar
kain_mcbride kain_mcbride is offline Offline
Newbie Poster

Re: the form that wont die...

 
1
  #19
Nov 23rd, 2008
was just wondering about the check for reset... instr will check within String1 for an instance of String2, string2 being reset, if String1 is set to anything including reset, it'll come back as true...

so reset will come back as saying, yes... it says reset...
preset will come back as saying that it says reset...
and 324resetas351 will come back as saying that it says reset...

might want to use
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. if pass <> "reset" then
  2. 'your valid password code
  3. elseif pass = "reset" then
  4. 'your reset password code
  5. end if

better yet, might want to use a string of charaters they can't use as a password... for instance
stReset = chr$(13) & chr$(13) & chr$(13)
Last edited by kain_mcbride; Nov 23rd, 2008 at 1:27 am. Reason: a different method..?
... there is no bug that enough coffee cannot fix...
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 100
Reputation: squidd is an unknown quantity at this point 
Solved Threads: 2
squidd squidd is offline Offline
Junior Poster

Re: the form that wont die...

 
0
  #20
Nov 23rd, 2008
That particular portion of code has nothing to do with a password in the way you are describing at all. That piece of code has to do with a database check for something else entirely. And it doesnt "reset" to the best of my knowledge as it is pulling an HDD volume ID.

However, that information will certainly prove to be quite valuable in the future. Thank you very much for it.

There are many things happening in this particular "sub." I am beginning to think that it is repeating itself due to the placement of certain lines of code OR how many times i run the code consecutively without restarting VB6. Because it is an intermittent problem sometimes as well. It either doesn't happen at all, or repeats once after the initial run, or twice after the initial run. It is REALLY frustrating. Crazyness for sure.

Even the compiled code will do the same "redo" even when it didn't in the testing phase of the code. So whatever is causing it is not fixed for sure. But, I just recently made another chg to the code (tonight) and I haven't seen it happen at all lately. That means exactly nothing though because i have had that happen before since posting this problem only to see the "redo" return.

As Always,

Thank you for the help and comments. It is certainly appreciated.
Last edited by squidd; Nov 23rd, 2008 at 3:14 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC