[RESOLVED] multiple statements and conditions
Hello people,
Could someone help me
I need a code which loops through 3 different statements
EN=lang1
DE=lang2
FR=lang3
lang1=test1
lang2=test2
lang3=test3
if myVar = EN then
msgbox(lang1)
else
if myVar =DE then
msgbox("lang2)
else
if myVar=FR then
msgbox (lang3)
if myVar="" then
msgbox ("something else")
Re: multiple statements and conditions
unclear what you're after. please explain more fully.
Re: multiple statements and conditions
I got 4 different variables
myVar= (can are EN or DE or FRA) depends on case to case.
EN= run function 1
DE= run function 2
FRA= run function 3
if myVar=EN run function 1
if myVar=DE run function 2
if myVar=FRA run function 3
Thank you in advance
Re: multiple statements and conditions
Code:
Select Case myVar
Case "EN"
Call sub1
Case "DE"
Call sub2
Case "FRA"
Call sub3
Case Else
MsgBox "Invalid country code"
End Select
Re: multiple statements and conditions
its solved thank you sir!
Re: [RESOLVED] multiple statements and conditions
what are you expecting?
The code was an example showing you how to do it, you still need to edit to fit your needs.
For it to work you need to have a variable called MyVar that is set somewhere to one of you status's - (EN,DE or FRA) and you would need 3 subs called - sub1, sub2 & sub3.
Heres what i mean
Code:
private Sub Run()
'Run Test sub passing "EN" Will call sub1, change this to DE to run sub2!
test "EN"
End Sub
Private Sub test(myVar as String)
Select Case myVar
Case "EN"
Call sub1
Case "DE"
Call sub2
Case "FRA"
Call sub3
Case Else
MsgBox "Invalid country code"
End Select
End Sub
Private Sub sub1()
MsgBox "sub1"
End Sub
Private Sub sub2()
MsgBox "sub2"
End Sub
Private Sub sub3()
MsgBox "sub3"
End Sub