PC-BASIC Documentation
Total Page:16
File Type:pdf, Size:1020Kb
PC-BASIC documentation Version 2.0.3 1. PC-BASIC 2.0.3 A free, cross-platform emulator for the GW-BASIC family of interpreters. PC-BASIC is a free, cross-platform interpreter for GW-BASIC, Advanced BASIC (BASICA), PCjr Cartridge Basic and Tandy 1000 GWBASIC. It interprets these BASIC dialects with a high degree of accuracy, aiming for bug-for-bug compatibility. PC-BASIC emulates the most common video and audio hardware on which these BASICs used to run. PC-BASIC runs plain-text, tokenised and protected .BAS files. It implements floating-point arithmetic in the Microsoft Binary Format (MBF) and can therefore read and write binary data files created by GW-BASIC. This is the documentation for PC-BASIC 2.0.3, last updated 2020-09-26 19:20:46. It consists of the following documents: • Quick Start Guide, the essentials needed to get started • User's Guide, in-depth guide to using the emulator • Configuration Guide, settings and options • Language Guide, overview of the BASIC language by topic • Language Reference, comprehensive reference to BASIC • Technical Reference, file formats and internals • Developer's Guide, using PC-BASIC as a Python module 2 PC-BASIC Table of Contents PC-BASIC 2.0.3 ...................................................................................................................... 2 Quick Start Guide................................................................................................................. 14 Installation.............................................................................................................................. 15 BASIC survival kit .................................................................................................................. 16 Program location.................................................................................................................... 17 External resources................................................................................................................. 18 User's guide ......................................................................................................................... 19 The working environment ...................................................................................................... 20 Special keys........................................................................................................................... 21 Keyboard shortcuts................................................................................................................ 24 Alternative keys ..................................................................................................................... 25 Clipboard operations.............................................................................................................. 25 Emulator control keys ............................................................................................................ 25 Compatibility .......................................................................................................................... 26 Programs and files................................................................................................................. 27 Accessing your drives............................................................................................................ 29 Compatible BASIC files ......................................................................................................... 30 Packages ............................................................................................................................... 31 Cassette tapes....................................................................................................................... 31 Security.................................................................................................................................. 32 Connecting to peripherals...................................................................................................... 33 Printing................................................................................................................................... 33 Serial and parallel ports ......................................................................................................... 33 Changing the interface........................................................................................................... 34 Emulation targets................................................................................................................... 35 Codepages ............................................................................................................................ 36 Fonts...................................................................................................................................... 40 Table of Contents 3 Redirecting I/O....................................................................................................................... 41 Command-line interface......................................................................................................... 41 Text-based interface .............................................................................................................. 42 Configuration guide............................................................................................................. 43 Changing settings .................................................................................................................. 44 Synopsis ................................................................................................................................ 46 Positional arguments ............................................................................................................. 47 Options .................................................................................................................................. 48 Examples ............................................................................................................................... 59 Language guide ................................................................................................................... 61 Working with programs .......................................................................................................... 62 Control flow............................................................................................................................ 63 Arrays and variables .............................................................................................................. 66 Type conversion .................................................................................................................... 67 String operations.................................................................................................................... 68 Text and the screen ............................................................................................................... 69 The printer ............................................................................................................................. 70 Keyboard input....................................................................................................................... 71 Function-key macros ............................................................................................................. 72 Calculations and maths ......................................................................................................... 73 Mathematical functions .......................................................................................................... 73 Random numbers .................................................................................................................. 73 Devices and files.................................................................................................................... 74 File operations ....................................................................................................................... 74 Devices .................................................................................................................................. 74 Graphics ................................................................................................................................ 77 Sound .................................................................................................................................... 78 Joystick and pen .................................................................................................................... 79 Disks and DOS ...................................................................................................................... 80 Serial communications........................................................................................................... 81 4 PC-BASIC Event handling ....................................................................................................................... 82 Error handling ........................................................................................................................ 83 User-defined functions........................................................................................................... 84 Date and time ........................................................................................................................ 85 Including data in a program ..................................................................................................