Question : What does "if False Then" mean? How does the compiler check this condition?

hi,

In my code if I put the below line, will it be ever executed? How does the compiler check this?

if False then
    'some statements
end if

Thank you.

Answer : What does "if False Then" mean? How does the compiler check this condition?

In this code:

if False then
    'some statements
end if


>>>> How does the  compiler check this?

if (.....) then

the (......) part checks to see what is the result of the condition and result can be TRUE or FALSE.

some statement will never execute. The IF block checks the (............) part. In this case you have defined yourself what will be the result of condition evaluation.

In the sample code no code within IF-Then block will execute because condition will always treat as False condition.

In this case:

if False then
    'some  statements
else
   'some other part
end if


some other part will always execute. Due to the nature of the if-then block, when condition results false else part executes.
Random Solutions  
 
programming4us programming4us