11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

WHEN TO USE THE COLON SHORTCUTUse the shortcut:1. To make the program clearer.Put similar statements on the same line. Example:Instead of10X=012 Y=014Z=0write10X=0:Y=0:Z=02. To make the program shorter.3. To put a REM on the end of the line.Example: 40 H=X+Y/66 : REM H IS THE HEIGHTTHE COLON AFTER AN IF COMMANDYou can make neater IF statements using colons.Without:50 IF A=0 THEN GO TO 8060B=Q62 C=B*D66 PRINT "WRONG"80 FOR...With colons:50 IF A< >0 THEN B=Q:C=B*D:PRINT "WRONG"80 FOR...All the commands in the path "A< >0 is TRUE" are on the line after THEN.CAREFUL!Do not put something on the end of an IF line that doesn't belong.Example: 35 IF A=B THEN PRINT "ALIKE"40Q=Ris not the same as: 37 IF A=B THEN PRINT "ALIKE": Q=Rbecause Q=R in line 40 is always done, no matter if A=B is true or not But Q=R in line37 is done only if A=B is true.91

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

Saved successfully!

Ooh no, something went wrong!