I have to say that the GW-BASIC code is somewhat strange: I think I have managed to puzzle most of it out. I don't quite see why you declare two string arrays: X$, and A$, with sizes of 3900 and 4900 respectively, but you only ever use the first element (0) of each one (e.g. you read the each file line in turn into A$(I) and I is never assigned a value so is zero by default) You also have an numerical array called R which is never declared but you only ever use R(I). Luckily GW-BASIC is forgiving about unassigned variables (they are deemed to be single precison and value zero) and undimensioned arrays (gives them 10 elements). Also, there is a variable N which I don't think is used for anything, though it is dutifully incremented once around each loop.
I can't quite get my head around what this is meant to do
120 X$= RIGHT$(A$(I),1)
130 J = VAL(X$)
140 Y$=RIGHT$(A$(I),2)
150 Z=VAL(Y$)
160 IF Z>0 THEN Z=9-Z
170 J = 9-J
180 IF J = 9 THEN J = 0
190 R(I) = R(I) +J+Z
It looks like you are using VAL to coerce the substring X$ which is the last character of the input line into a numeric variable J, then the last 2 characters Y$ into numeric variable Z, then taking 9 away from Z (if it is greater than zero), and then doing the same to J (whatever its value) then finally adding them together. Could you help me understand the reason for this? Is this some kind of special score calculation?
You see, while I am fairly experienced with GW-BASIC, I used it around 1985 - 1992, I know absolutely nothing about horseracey stuff like handicapping so I want to make sure I understand what is going on.