BCX Console Demonstration Program s29.bas

 DIM a
 DIM b
 
 WHILE a < 20
 
   a = a + 1
 
   IF a = 10 THEN
     b = b + 21
   END IF
 
   ?  "This is line no. ", a
 
 WEND
 
 ?  "The value of b = ", b

Result:


 This is line no.  1
 This is line no.  2
 This is line no.  3
 This is line no.  4
 This is line no.  5
 This is line no.  6
 This is line no.  7
 This is line no.  8
 This is line no.  9
 This is line no.  10
 This is line no.  11
 This is line no.  12
 This is line no.  13
 This is line no.  14
 This is line no.  15
 This is line no.  16
 This is line no.  17
 This is line no.  18
 This is line no.  19
 This is line no.  20
 The value of b =  21