I'm having VFP problems with code using arrays. On one machine, the following code runs successfully:
DIMENSION array[20]
FOR x = 1 TO 5
array[x] = RAND()
ENDFOR
clear
?? array[1]
?? array[2]
?? array[3]
?? array[4]
?? array[5]
?
FOR i = 1 TO ALEN(array)
?? array && sometime generates an error
ENDFOR
?
However, on my normal development system, I get a "Invalid subscript reference (Error 31)" message any time I refer to array. In the debugger, everything runs correctly; I can see that I get a good value from the ALEN(array) call. But the next line? Error!
One thought that I've had is that there were differences in the configuration or settings. So I deleted FOXUSER.DBF (no change) and compared the output of DISPLAY STATUS (no difference between the two systems).
Both systems running VFP 9.0 SP2, Windows 7 SP 1. So what could be different in VFP between my two systems?
DIMENSION array[20]
FOR x = 1 TO 5
array[x] = RAND()
ENDFOR
clear
?? array[1]
?? array[2]
?? array[3]
?? array[4]
?? array[5]
?
FOR i = 1 TO ALEN(array)
?? array && sometime generates an error
ENDFOR
?
However, on my normal development system, I get a "Invalid subscript reference (Error 31)" message any time I refer to array. In the debugger, everything runs correctly; I can see that I get a good value from the ALEN(array) call. But the next line? Error!
One thought that I've had is that there were differences in the configuration or settings. So I deleted FOXUSER.DBF (no change) and compared the output of DISPLAY STATUS (no difference between the two systems).
Both systems running VFP 9.0 SP2, Windows 7 SP 1. So what could be different in VFP between my two systems?