It seems i'm stuck here somewhat (fileaccess)
I need to read the last line of a .dat file (txt based).
But only the last line, it must be in a sub.
I currently have this :
Quote:
code:
Do
starten:
Open plaats For Input As #1
Input #1, klantnummer, Text, foto, video
If klantnummer = "Leeg" Then GoTo starten
If klantnummer = "leeg" Then GoTo starten
Do
Open "c:\erdatmp.dat" For Input As #2
Input #2, klantnrtemp
Close #2
Loop Until EOF(2)
Loop Until Not klantnrtemp = klantnummer
Close #1
Open "c:\erdatmp.dat" For Append As #2
Write #2, klantnummer
Close #2
-------
My intention :
It's all about a datafile downloaded from the internet, but the file is variable.
So that is the problem, i can't include it in the program.
If its downloaded, it must open the first 'record' (in on other perfectly working rountine at the time).
But when the user hits an other command button it needs to load the data of the second line and change the variables so the user sees the second line in the program.
And, no, i haven't used access database files because 0 or 1 things are url's where or a small movie or a picture needs to be downloaded.
So what i tried now :
From every read there is from the datafile, the first varaiable will be saved in another file, and the next time the user hits the command button it reads both files and should continue at the right position, but that doesn't happen.
What happens is the first thing (other sub routine in the prog) works good, and the second line (first time this routine) works good too, but the third time he gives exactly the same data of the first.
So, if anyone can help me with this routine, i really suck at these routines...
I've been trying different approaches for over 3 months now... and the friend i'm writing it for really wants it... (he's been bugging me for 4 weeks about when its done)
So please help.
thanks in advance,
Sebastian