|
-
Aug 15th, 2014, 03:29 AM
#1
Thread Starter
Lively Member
[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")
-
Aug 15th, 2014, 07:14 AM
#2
Re: multiple statements and conditions
unclear what you're after. please explain more fully.
-
Aug 15th, 2014, 08:45 AM
#3
Thread Starter
Lively Member
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
-
Aug 15th, 2014, 08:57 AM
#4
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
-
Aug 15th, 2014, 09:01 AM
#5
Thread Starter
Lively Member
Re: multiple statements and conditions
its solved thank you sir!
Last edited by elmnas; Aug 15th, 2014 at 09:05 AM.
-
Aug 15th, 2014, 09:28 AM
#6
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
Please Mark your Thread "Resolved",  if the query is solved & Rate those who have helped you
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|