SINCLAIR ZX SPECTRUM BASIC Programming By Steven Vickers Edited by Robin Bradbeer Converted to electronic text by Chris Owen (Internet email:
[email protected]) _______________________________________________ Original edition published in 1982-83 by Sinclair Research Limited This version published in 1995 by Chris Owen on behalf of Amstrad plc Cover illustration by John Harris of Young Artists ________________________________________________ © Amstrad plc 1995 - all rights reserved ________________________________________________ This manual is freely distributable but may not be distributed without this notice. CONTENTS Chapter 1: Introduction A guide to the ZX Spectrum keyboard and a description of the display. Chapter 2: Basic programming concepts Programs, line numbers, editing programs using , and EDIT, RUN, LIST, GO TO, CONTINUE, INPUT, NEW, REM, PRINT, STOP in INPUT data, BREAK Chapter 3: Decisions IF, STOP, =, <, >, <=, >=, <> Chapter 4: Looping FOR, NEXT, TO, STEP. Introducing FOR-NEXT loops Chapter 5: Subroutines GO SUB, RETURN Chapter 6: READ, DATA, RESTORE Chapter 7: Expressions Mathematical expressions using +, -, *, /, scientific notation and variable names. Chapter 8: Strings Handling strings and slicing. Chapter 9: Functions User-definable functions and others readily available on the ZX Spectrum using DEF, LEN, STR$, VAL, SGN, ABS, INT, SQR, FN Chapter 10: Mathematical functions Including simple trigonometry: PI, EXP, LN, SIN, COS, TAN, ASN, ACS, ATN Chapter 11: Random numbers Using RANDOMIZE and RND. Chapter 12: Arrays Strings and numeric arrays - DIM. Chapter 13: Conditions Logical expressions: AND, OR, NOT. Chapter 14: The character set A look at the ZX character set including graphics and how to construct your own graphic characters: CODE, CHR$, POKE, PEEK, USR, BIN Chapter 15: More about PRINT and INPUT Some more complicated uses of these commands using separators: , ; ' , TAB, AT, LINE and CLS.