Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Unanswered: Strange behavior of my application

    Hi everyone,

    I'm working on an application to test people of their knowledge. The concept is simple :
    The application shows a question, the user shouls answer it.
    If the answer is wrong, the correct answer will be shown during a few seconds (can be changed by a slider).

    If I open my application in combination with SHIFT-key and I start my autoexec manually, the correct answer will be displayed during 0 seconds (debugging the code also shows tthe value of my variable is 0).

    If I open my application in combination with SHIFT-key and I switch to Visual Basic-view first (by using Alt + Fn11 before starting my autoexec manually, it works correct.

    Does anyone have any idea why my app is behaving different?


    Thanks in advance

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    are you initialising your variables in a consistent manner?
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243
    I have a module modGlobals.
    Code:
    Private TIMERINTERVAL_CORRECT As Integer
    
    Public Sub SetTimerIntervalCorrect(ByVal timeInMs As Integer)
        TIMERINTERVAL_CORRECT = timeInMs
    End Sub
    
    Public Function GetTimerIntervalCorrect() As Integer
        GetTimerIntervalCorrect = TIMERINTERVAL_CORRECT
    End Function
    I have a Form Form_frmLearn with a slider on it. During initialising the form I change the slider to a value of 3. This is what happens :

    Code:
    Private Sub sldTimerCorrect_Change()  
        Call modGlobals.SetTimerIntervalCorrect(sldTimerCorrect.Value * 1000)
    End Sub

    The strange thing is : I have a form with a subform in it. The last line of the code in the Form_Load module of my mainform is :
    Code:
    lblTest.Caption = modGlobals.GetTimerIntervalCorrect
    and it shows the correct value.
    In my subform I have a treeview. As soon as I click a node, I intercept the MouseDown event and the very first line is again
    Code:
    lblTest.Caption = modGlobals.GetTimerIntervalCorrect
    and this time the value is set back to 0.

    There is absolutely no code of mine between the Form_Load and the MouseDown and absolutely no code to change the value of the timerinterval.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •