• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Checking Multiple Variables for One Condition

 
Ranch Hand
Posts: 1938
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am converting a windows based application I created with a web version on it. In this app I could check multiple variable values ot on time to control flow.

Example:
CASE !EMPTY(v1) AND EMPTY(v2) AND EMPTY(v3) AND EMPTY(v4)
Do this...
CASE EMPTY(v1) AND !EMPTY(v2) AND EMPTY(v3) AND EMPTY(v4)
Do that...

How can I do this with Java?
 
Marshal
Posts: 64689
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not using "switch---case."

TrySee whether that is any use to you. You might find you actually have to say "if(v1.isEmpty() && v2.isEmpty() && !v3.isEmpty())".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!