06-08-2003, 07:56 AM
Hello again
I was able to get my program to write the information to a file the way that I want. I appreciate the help on my other post. Now I have a new problem. I want to write a number to the file, but I want the number to be determined by the number of records in the file. So, the first time that I run the program and enter information the number would be 1. Then if I keep adding information, the number would grow depending on the number of records that I add. So if I enter 5 records worth of information, I want the program to assign the number 6 to the 6th record. I need to print this on the screen for each record.
Here is the code that I have for the writing of the records to file.
Any and all help is appreciated.
I was able to get my program to write the information to a file the way that I want. I appreciate the help on my other post. Now I have a new problem. I want to write a number to the file, but I want the number to be determined by the number of records in the file. So, the first time that I run the program and enter information the number would be 1. Then if I keep adding information, the number would grow depending on the number of records that I add. So if I enter 5 records worth of information, I want the program to assign the number 6 to the 6th record. I need to print this on the screen for each record.
Here is the code that I have for the writing of the records to file.
Code:
WRITE.NEW:
OPEN "A:\LOG.DAT" FOR BINARY AS #1
LG.PNO = LG.PNO + 1
PUT #1, LOF(1) + 1, LG
CLOSE #1
PRINT
PRINT
PRINT "YOUR NEW PART NUMBER IS : "; LG.PROIDN$; LG.PNO
PRINT
PRINT
PRINT "PRESS M TO RETURN TO MAIN MENU OR E TO EXIT"
Any and all help is appreciated.