Graham Kendall
Various Images

Professor Graham Kendall

Professor Dr. Graham Kendall is the Deputy Vice Chancellor (Research & Quality Assurnace, MILA University, Malaysia

Basic Betting: The Micro Bytes Back (1st Edition)

GWBASIC Emulator

This is a support page for Basic Betting: The Micro Bytes Back (1st Edition). This page provides details of how to install and use a GWBASIC emulator on a PC. If you want to install on a Mac, go to this page.

Installing GWBASIC Emulator on a PC

There are many ways to get the emulator, and then the programs, running. Below I descibe the way I did it (it is probably the minimal actions that you need to do). Purists might want to set up their own environment, but this will get you up and running.

Go to http://robhagemans.github.io/pcbasic/, where you can download and install a GWBASIC (which is called PC-BASIC, but it runs the programs that are supplied with this book) emulator.

If you click on the GWBASIC icon that is now available, it will open the GWBASIC emulator window (see Fig 1).

Fig 1: GWBASIC screen at start up

Once you have the GWBASIC window open, type files and press Enter. This will display your home folder (see Fig 2). On this (Windows) computer the home folder is the Z: drive.

Fig 2: GWBASIC screen showing home directory

We now need to locate where the home folder (Z: drive) is on actually located on the computer. I don't have a Z: drive on my computer, but I suspect that the GWBASIC Z: drive is the C: drive. To confirm that, load Windows Explorer, right click on the C: drive and select properties. This leads to the screen shown in Fig 3.

Fig 3: Windows Explorer Screen, showing how much free space there is on the C: Drive

The two figures, shown in red circles, show the free space available. Whilst not identical, they are similar suggesting the the home folder (Z: drive) and the C: drive are the same.

We can confim this by placing a file one the C: drive, through Windows Explorer, and then see if the GWBASIC files command can see it. My first attempt did not work, but I realised that the correct location is my home directory. This is the folder C:\Users\Graham. If I copy a file there, and issue a files command then I can see the file I have just moved (see Fig 4).

Fig 4: GWBASIC screen showing a file that has been moved to prove the location of the home directory

Setting up your environment

We don't really want to store our files in the home directory, but in a subfolder. I created a folder called BETBOOK. You can either do this through Windows Explorer, or through GWBASIC. Fig 5 shows how to do this through the GWBASIC window. It is worth noting that the folder name will be uppercase and a maximum of eight characters. This is a throwback to the days of MS-DOS.

Fig 5: GWBASIC screen showing how to create a new folder through GWBASIC

Using Windows Explorer (as it is easier) you should now copy all the files associated with this book (see here to download the files) to the BETBOOK folder. That is, copy the following program files.

  1. 001 - ROUL03.TXT
  2. 002 - ROUL04.TXT
  3. 003 - ROUL05.TXT
  4. 004 - ROUL06.TXT
  5. 005 - ROUL07.TXT
  6. 006 - ROUL08.TXT
  7. 007 - FOOT09.TXT
  8. 008 - FOOT10.TXT
  9. 009 - FOOT11.TXT
  10. 010 - RACE12.TXT
  11. 011 - RACE13.TXT

... and the following data files

  1. CH09DATA1.TXT
  2. CH09DATA2.TXT
  3. CH11DATA.TXT
  4. CH13DAT.TXT

Once you have downloaded and copied the program and data files to BETBOOK you need to switch to that folder. You do this with the CHDIR command (see Fig 5). Issuing the files command will validate that the files are there.

Fig 5: GWBASIC screen showing how to change directory and verifying that the files for this book have been copied

Running a GWBASIC Program

You now have the environment to run GWBASIC programs. This page tells you how to run the programs in this book.