I am a brand new user and just getting started but have had experience with other development software like VB and NSB. I am re-doing my application now with basic4ppc. Here is the problem:
When my app starts I want the list box on the first form to populate with the files the user has chosen previously so he can select from that list. He can also enter a new file in a textbox, press the OK button, and it should be appended to that list box. Here is what I have so far:
Sub App_Start
If Not (FileExist ("filelist.txt")) Then
FileOpen (f,"filelist.txt",cAppend,,cASCII) 'this seems to work
FileClose(f)
End If
frmstart.show 'this is the form with the listbox, textbox and OK button
FileOpen(f,"filelist.txt",cRead)
s=FileRead(f)
Do Until s=EOF
lstStart.Add(s)
s=FileRead(f)
Loop
FileClose (f)
End Sub
'the above will only add the last name entered in the listbox (see below)
'here is what happens when the OK button is pressed on the start form
Sub cmdStartOK_Click
strfilename=txtstartfilename.Text 'the textbox where user enters a new name
FileOpen(f2,"filelist.txt",cWrite) 'cAppend throws a syntax error
FileWrite(f2,txtstartfilename.Text )
lststart.Add(strfilename)
FileClose(f2)
End Sub
I know each time OK is pressed that the file starts over because it was opened with 'cWrite' and why only the last name is shown when the app starts again. How do I append the files to the list? It can't be that hard but I am not seeing it right now.
How is a screen shot shown? I could send a file to my web site and then include the url but there must be an easier way. Thanks for any help.
Jim Schuchert
When my app starts I want the list box on the first form to populate with the files the user has chosen previously so he can select from that list. He can also enter a new file in a textbox, press the OK button, and it should be appended to that list box. Here is what I have so far:
Sub App_Start
If Not (FileExist ("filelist.txt")) Then
FileOpen (f,"filelist.txt",cAppend,,cASCII) 'this seems to work
FileClose(f)
End If
frmstart.show 'this is the form with the listbox, textbox and OK button
FileOpen(f,"filelist.txt",cRead)
s=FileRead(f)
Do Until s=EOF
lstStart.Add(s)
s=FileRead(f)
Loop
FileClose (f)
End Sub
'the above will only add the last name entered in the listbox (see below)
'here is what happens when the OK button is pressed on the start form
Sub cmdStartOK_Click
strfilename=txtstartfilename.Text 'the textbox where user enters a new name
FileOpen(f2,"filelist.txt",cWrite) 'cAppend throws a syntax error
FileWrite(f2,txtstartfilename.Text )
lststart.Add(strfilename)
FileClose(f2)
End Sub
I know each time OK is pressed that the file starts over because it was opened with 'cWrite' and why only the last name is shown when the app starts again. How do I append the files to the list? It can't be that hard but I am not seeing it right now.
How is a screen shot shown? I could send a file to my web site and then include the url but there must be an easier way. Thanks for any help.
Jim Schuchert