943,741 Members | Top Members by Rank

Ad:
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Nov 21st, 2008
0

Re: the form that wont die...

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.
Reputation Points: 10
Solved Threads: 2
Junior Poster
squidd is offline Offline
100 posts
since Nov 2007
Nov 21st, 2008
0

Re: the form that wont die...

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
Reputation Points: 12
Solved Threads: 0
Newbie Poster
BigSeckC is offline Offline
13 posts
since Nov 2008
Nov 22nd, 2008
0

Re: the form that wont die...

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.
Reputation Points: 10
Solved Threads: 2
Junior Poster
squidd is offline Offline
100 posts
since Nov 2007
Nov 22nd, 2008
0

Re: the form that wont die...

Click to Expand / Collapse  Quote originally posted by BigSeckC ...
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...
Reputation Points: 22
Solved Threads: 3
Light Poster
kain_mcbride is offline Offline
25 posts
since Nov 2008
Nov 22nd, 2008
0

Re: the form that wont die...

yes it seems so, but i think it will not do any problem for the pause command
Reputation Points: 10
Solved Threads: 5
Light Poster
arghasen is offline Offline
35 posts
since Nov 2008
Nov 22nd, 2008
0

Re: the form that wont die...

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
Reputation Points: 10
Solved Threads: 2
Junior Poster
squidd is offline Offline
100 posts
since Nov 2007
Nov 23rd, 2008
0

Re: the form that wont die...

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...
Reputation Points: 22
Solved Threads: 3
Light Poster
kain_mcbride is offline Offline
25 posts
since Nov 2008
Nov 23rd, 2008
0

Re: the form that wont die...

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.
Reputation Points: 10
Solved Threads: 2
Junior Poster
squidd is offline Offline
100 posts
since Nov 2007
Nov 23rd, 2008
1

Re: the form that wont die...

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..?
Reputation Points: 22
Solved Threads: 3
Light Poster
kain_mcbride is offline Offline
25 posts
since Nov 2008
Nov 23rd, 2008
0

Re: the form that wont die...

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.
Reputation Points: 10
Solved Threads: 2
Junior Poster
squidd is offline Offline
100 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: using of Crviewer component.......
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: help me to fix my counter





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC