|
Post by DARKNIGHT on Jun 23, 2023 0:55:30 GMT -5
Hey All, Having A new problem, when the program I am working on now, tries to write a line of data to a sequential file. it is just lumping the next entry right onto the prior one. I use a trailing Colon on the end of the write statement also. the problem is in the Entry Reg. the other separate file works fine. it is used to search for a full name, and the entries in the registry file are for searches by Last name and ID#
here is what the Data file looks like when I open it with note Pad to view its contents:Note this is just test data obviously
Hyatt,Alice,Joan,2654 Hyatt,Thomas,Wayne,2655 Jones,James,Michael,2656 Smith,John,Adam,2657 Taylor,Robert,Edward,1465 Thorton,Billy,Bob,6543Burns,George,Allan,2854
you can see what happened when I made my last entry. George Burns and Billy Bob Thornton Had a little Run in
and here is the sub causing the problem:
[Add_New] mainwin 180 80 cls locate 6,8:print" LAST FIRST MID USER ID #" locate 6,9:print"|-----------------|-----------------|-----------------|-----------------|" locate 6,11:print"|-----------------|-----------------|-----------------|-----------------|" locate 10,10:input"";L$ if L$="" then [MMenu] locate 28,10:input"";F$ locate 49,10:input"";M$ locate 66,10:input"";UID
rem * Write Data To a separate file other then the Registry * open L$;",";F$;",";M$ for output as #1 print #1,L$;",";F$;",";M$;",";UID; close #1
rem * write Data to register file open"EntryReg" for Append as #3 print #3,L$;",";F$;",";M$;",";UID; close #3 notice"RECORD STATUS"+chr$(13)+"RECORD HAS BEEN SAVED"
|
|
|
Post by Rod on Jun 23, 2023 1:43:27 GMT -5
You need to leave the last trailing semicolon off. So UID not UID;
That way a CRLF pair will be added by default and cause a line feed. So next time the data line will be broken correctly.
|
|
|
Post by DARKNIGHT on Jun 26, 2023 1:41:47 GMT -5
Thanks Rod! that solved the problem. you are a scholar and a gentleman
|
|