Post by pc32402 on Jul 5, 2022 22:35:45 GMT
New to the board.. and its been many many many many many moons since I've done anything in basic so bear with me :-D
Bit off more than I should have with this one..
Have a friends kid that inherited a biz and wants to keep most things status quo...
The basic prog used was set up to use a data file then it delim'd by location i.e. [this is lifted from the code btw]
| | | | | Remarks (program ignores)
| | | | | |
| 0 1 2 3 3 4 4 4
1234567890123456789012345678901234567890123456789012345678901234567890
| | | | | |
| 0 1 2 3 3 4 4 4
1234567890123456789012345678901234567890123456789012345678901234567890
The problem came about when I was asked to help clean up, and add data; the code didn't have a sub to actually provide end user input..ergo the "instructions" in the data file... Unfortunately I can't jump up n down and haze the buddy that wrote it many many years ago. I will be perplexed until I meet him in the great beyond!
Manually imputing the data into the dat file proved to be troublesome and never 'lined up'.. SO I said OOO no big deal We'll just update it to read csv data....urggg
Now I've searched for some decent refreshers.. just a little pushed for time this week..
This is the old code..
Sub ReadCustFile
open theDir$+"\CUSTNAMES.DAT" for input as #f
numCUST=0
while not(eof(#f))
line input #f, dummy$
i=val(left$(dummy$,3))
if i>0 and i<11 and val(mid$(dummy$,43,1))>0 then
numCust=numTrains+1
custname$(i)=mid$(dummy$,5,29)
custcode$(i)=trim$(mid$(dummy$, 35,4))
custcap(i)=val(mid$(dummy$,40,2))
custclass(i)=val(mid$(dummy$,43,1))
' print dummy$
end if
wend
close #f
end sub
Any help in adapting it to read CSV.. ANY help or direction would be Immensely appreciated..