Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a sequential file as a data

Status
Not open for further replies.

solo7

Technical User
Mar 14, 2001
243
NO
I have a sequential file as a data source, and I'm populateing a list box with this data several lines of numbers each 6 numbers long (1-99).

In my list box I can update as necessary with the 'ADDITEM' syntax, and I can delete any selected range from the list with the 'REMOVEITEM' syntax. But how can I cascade the deleted range down to the sequential file so that the deleted range is actually deleted - I'm trying to extract the values in the list box after the user has selected the line to be deleted, but I'm falling down badly !!

Any hints tips or clues would be most welcome

Steady ...
 
Maybe call the entire entity in the textbox as say boxY.
Then make it equal to "".
Then on click event the selection as a variable like boxZ.
Then write the output to the textbox as boxY without the boxZ.

cya

:)

Ratman
 
Open the sq file For Output; this will delete everything in the file. Use a For...Next on the listbox:
MyFile = FreeFile
Open "C:/MyPath/Myfile.txt" For Output AS MyFile
For ctr = 0 to List1.ListCount - 1
If List1.Selected(ctr) = False Then
Print MyFile, List1.List(ctr)
End If
Next
Close MyFile
(I think the syntax is correct, but it's been a long time......)
 
Thats brilliant !
Thanks guys. I'd got the theory about right, but I just couldn't put it together.

Cheers

Steady ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top