# testsuite_if_include section for BASIC256

# Modification History
# date		programmer	description
# 20140203	j.m.reneau	added crazy if structures when if/then/else
#				moved to a statement and not a stand alone line (1010002)

s = 0
for t = 1 to 10
   if t <= 5 then
      if t <=3 then
         s = s + 1
      else
         s = s + 10
      end if
   else
      if t <= 8 then
         s = s + 100
      else
         s = s + 1000
      end if
   end if
next t
call n("multi line if", s, 2323)

# multi line all with :
s = 0:for t = 1 to 10:if t <= 5 then:if t <=3 then:s = s + 1:else:s = s + 10:end if:else:if t <= 8 then:s = s + 100:else:s = s + 1000:end if:end if:next t
call n("multi line if compound (one line :)", s, 2323)


# multi line with ITE
s = 0
for t = 1 to 10
   if t <= 5 then
      if t <=3 then s = s + 1 else s = s + 10
   else
      if t <= 8 then s = s + 100 else s = s + 1000
   end if
next t
call n("multi line if (with single line if then elses)", s, 2323)

# multi line with ITE with :
# cant combine three lines because the compound statement in else clause of the ITE
s = 0:for t = 1 to 10:if t <= 5 then:if t <=3 then s = s + 1 else s = s + 10
else :if t <= 8 then s = s + 100 else s = s + 1000
end if:next t
call n("multi line if compound (with single line if then elses)", s, 2323)


# single line ITE (cant put next on end as part of last else compound
# else is associated with closest then without an else
s = 0:for t = 1 to 10:if t <= 5 then if t <=3 then s = s + 1 else s = s + 10 else if t <= 8 then s = s + 100 else s = s + 1000
next t
call n("single line if then else nested", s, 2323)

# test case
s = 0
for t = 1 to 10
   begin case
      case t <=3
         s+=1
      case t <=5
         s+=10
      case t <=8
         s+=100
      else
         s+=1000
   end case
next t
call n("case", s, 2323)

# test case single line
s = 0:for t = 1 to 10:begin case:case t<=3:s+=1:case t <=5:s+=10:case t<=8:s+=100:else:s+=1000:end case:next t
call n("case compound", s, 2323)

