James,
Since I have no way of testing it, all I can figure is to eliminate a section of code and see where the breaking point is.
The test.txt file is correct. I can only assume that it's working correctly up to that point.
So, I'd comment-out this entire block:
'    CLEAR
'
'    OPEN "R", #1, "test.txt", 34
'    FIELD #1, 4 AS A$, 4 AS B$, 8 AS C1$, 8 AS D$, 10 AS E$
'    GET 1, 1
'
'    az# = CVD(D$)
'    bz! = CVS(C1$)
'    cz% = CVI(B$)
'    dz =  CVI(A$)
'    PRINT "az#="; az#
'    PRINT "bz!="; bz!
'    PRINT "cz%="; cz%
'    PRINT "dz ="; dz
'    CLOSE 1
and see if it compiles end executes correctly.
Then, little by little, uncomment lines until we find the one that breaks.
I can't tell if it's a win7 issue or a 64-bit issue.
Steve