• Welcome to Valhalla Legends Archive.
 

Stupid Problem

Started by Forged, August 11, 2005, 09:37 PM

Previous topic - Next topic

Forged


Private Sub mnuedit_Click()
intWhich = 1 'The Browser knows to open the edit menu after choosing a file
frmBrowse.Show

End Sub

Private Sub mnuload_Click()
intWhich = 0 'The Browser knows not to open the edit menu after choosing a file
frmBrowse.Show

End Sub



Private Sub Command1_Click(Index As Integer)

Select Case Index

Case Is = 0
strProfile = File1.Path & "\" & File1.FileName

   If intWhich = 0 Then
    Unload Me
   ElseIf intWhich = 1 Then
    Call Load
    frmSetup.Show
    Unload Me
   Else
    MsgBox "?"
   End If

Case Is = 1
Unload Me

End Select

End Sub


in my modDeclare Module.

'Random Variables
Dim intWhich As Integer


For some reason no matter what I do I get the "?" message box, I originally though maybe you were unable to use nested case statements, but when I switched to an if statement I came up with the same error, so I changed my Which variable from an int to a string and it still does not work.  If someone could help me It would be much appreciated.
QuoteI wish my grass was Goth so it would cut itself

K

Um, are you declaring a variable in the global/form scope named "strWhich" ?

Warrior

Additonally why are you storing numerical data as a string?
Just declare the global variable as an integer.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Forged

#3
yes strWhich is declared globally, and it was initally declared as an int, but for some reason or another that did not work either so I changed it to a string to see if that would make it work.

#Edit
I have now replaced strWhich with intWhich and now intwhich is never given a value and simplly closes frmbrowse.
The code from the first post has been changed to match the current situation.
QuoteI wish my grass was Goth so it would cut itself

The-FooL

#4
Quote from: Forged
intwhich is never given a value and simplly closes frmbrowse.

Figure out why it's not being given a value.  Are your methods being called?

Forged

there is no reason for it to not to be given a value, I even added intwhich = 4 in frmBrowse on form_load
still acts like the value is 0
QuoteI wish my grass was Goth so it would cut itself

Warrior

add Option Explicit at the top of the code and make sure your variable is global.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Forged

works fine after adding Option Explicit, thank you sir.
QuoteI wish my grass was Goth so it would cut itself

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?