04.03.2013 Views

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

Basic Micro Studio Syntax Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Commands<br />

Example<br />

Connect to the following program with the terminal window set to 9600 baud. The program will start<br />

counting down from 100 until it equals 0. Once index = 0, the program will quit because the condition<br />

is no longer true since 0 = false. In programming, 0 is always considered false. If a condition is tested<br />

and the results equal 0 then a false is returned.<br />

Index var word<br />

Main<br />

End<br />

Index = 100<br />

Do<br />

index = index - 1<br />

serout s_out, i9600,[0, “Counting: “, dec index]<br />

pause 75<br />

While index ;repeat until index is 0, which is a false expression<br />

serout s_out, i9600, [13,13, “Index = “, dec index]<br />

serout s_out, i9600, [13, “My condition is no longer true.”]<br />

serout s_out, i9600, [13, “Index is now false”]<br />

100

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!