Please help. I am not a grand programmer, but then I've heard that bumblebees are not supposed to be able to fly either! I'm tying to delete a portion of a random access file. The only way I could figure out how to do it is to convert it to an array, KILL the file, ARRAY DELETE the column, and then write it back to the file. Everything is cool except the ARRAY DELETE. It scrambles everything. Anyway, here is the code for anyone who is interested in helping.
(DIM and all the other stuff has already been done)
FOR X=1 TO END_OF_FILE 'fill the array with the contents of the UPS file
GET #8,X
FOR Y=1 TO 8
TEMP$(Y,X)=UPS$(Y)
NEXT Y
NEXT X
CLOSE #8
CALL CLEAR_UPS ' kills the UPS file
CALL UPS_OPEN ' opens the UPS file
FOR Y=1 TO 8
ARRAY DELETE TEMP$(Y,SE) 'delete the dealer at index SE
NEXT Y
FOR X=1 TO END_OF_FILE-1 'put it back in the file
FOR Y=1 TO 8
LSET UPS$(Y)=TEMP$(Y,X)
NEXT Y
PUT #8,X
NEXT X
CLOSE #8
[This message has been edited by Bill Franke (edited April 13, 2002).]
(DIM and all the other stuff has already been done)
FOR X=1 TO END_OF_FILE 'fill the array with the contents of the UPS file
GET #8,X
FOR Y=1 TO 8
TEMP$(Y,X)=UPS$(Y)
NEXT Y
NEXT X
CLOSE #8
CALL CLEAR_UPS ' kills the UPS file
CALL UPS_OPEN ' opens the UPS file
FOR Y=1 TO 8
ARRAY DELETE TEMP$(Y,SE) 'delete the dealer at index SE
NEXT Y
FOR X=1 TO END_OF_FILE-1 'put it back in the file
FOR Y=1 TO 8
LSET UPS$(Y)=TEMP$(Y,X)
NEXT Y
PUT #8,X
NEXT X
CLOSE #8
[This message has been edited by Bill Franke (edited April 13, 2002).]
Comment