asp.net - How to combine these If statement conditions -


i new oop whole let alone vb. i'm trying turn following 4 lines 2 lines combining conditions:

elseif ga_uri.startswith("/home/index")     gacategory = cat_splash  elseif ga_uri = "/games"     gacategory = cat_splash 

i have tried this:

elseif ga_uri.startswith("/home/index") , ga_uri = "/games"     gacategory = cat_splash 

but not working. hugely appreciated

i'd suggest orelse can more efficient short circuiting (don't have eval both expresssions):

elseif ga_uri.startswith("/home/index") orelse ga_uri = "/games"    gacategory = cat_splash 

update:

q: work more 2 expressions? have cases may have 3 or more

sure:

elseif ga_uri.startswith("/home/index") orelse      (ga_uri = "/games" orelse ga_uri = "/foo")       gacategory = cat_splash ... 

you can keep going (parenthetical expressions) @ point select...case way go.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -