Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stuck again on the Loops

 
Fitz Herbert
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a loop will definitely not run due to an argument of false say ? is any compilation errors thrown
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have some sample code as an example of what you're asking?
It's easier to help you with concrete code examples to talk about.
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For loops, you will get an "Unreachable statement" compilation error if you use the false literal

If statements (which aren't loops) do accept the literal false as an argument:

Both of these will compile; this is used to mimic C/C++'s conditional compilation:

[ May 29, 2003: Message edited by: Joel McNary ]
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes yes, sometimes no. Take a look at this thread for a discussion on the subject.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic