Re: output contents of a listbox to a sequential file
From: Dave (drettger_at_ameritech.net)
Date: 10/25/04
- Next message: Jean: "Shell to Command"
- Previous message: MikeD: "Re: List boxes and Item Data Reference"
- In reply to: Ken Halter: "Re: output contents of a listbox to a sequential file"
- Messages sorted by: [ date ] [ thread ]
Date: 25 Oct 2004 02:30:50 -0700
One other problem you might encounter... The listbox is indexed from
0 to ListBox.Count - 1. You will be missing the first item and
generating an error on the last loop through the For ... Next block.
Ken Halter <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message news:<eoxIIEgtEHA.2864@TK2MSFTNGP09.phx.gbl>...
> Cpt.Crazyhorse wrote:
> > how do you output the contents of listbox to a sequential file that looks
> > like this
> > John Kerry 1(800)555-9898
> > Bob Dilan 1(345)555-6789
> > (this is a sample of what the items look like in listbox)
> > The names and numbers are to be seperate items
> > i tried this code:
> > dlgcommon.Filter = "Phone Directory Files(.pd)|*.pd"
> > dlgcommon.ShowSave
> > Open dlgcommon.FileName For Output As #3
> > For looping = 1 To lstMain.ListCount
> > usemeagain = Left(lstMain.Text, 20)
> > useme = Right(lstMain.Text, 15)
> > Write #3, useme, addtome
> > Next looping
> > Close #3
> > can someone steer me straight here???
>
> Left should work fine but you'll never get anything using the Right
> function if those are the names you supply <g> To avoid confusion, use
> the LeftWingFreak function instead of just Left.
>
> btw... why break up the string before writing. Just store the text
> exactly as its shown in the listbox. Also not that Write surrounds the
> output in quotes. If you use Print# instead, you can open the resulting
> file in Notepad and it'll look exactly the same as the listbox.
- Next message: Jean: "Shell to Command"
- Previous message: MikeD: "Re: List boxes and Item Data Reference"
- In reply to: Ken Halter: "Re: output contents of a listbox to a sequential file"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|