[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
www.undertowsoftware.com • View topic - Off topic Question...

Off topic Question...

A forum made available for users of the MapPro OCX SDK to exchange ideas, ask each other questions, etc.

Off topic Question...

Postby MarkY » Mon May 31, 2010 9:23 pm

I know this is not really the place for it, but I'm stuck (you know, how sometimes you can't figure out the simplest things...)

How do I save the contents of a listbox to a text file, in VB? Does anyone have some simple code?
The gene pool has no lifeguard...
User avatar
MarkY
Active User
Active User
 
Posts: 28
Joined: Sat Feb 06, 2010 7:31 pm

Re: Off topic Question...

Postby UShadow » Tue Jun 22, 2010 9:14 am

MarkY wrote:I know this is not really the place for it, but I'm stuck (you know, how sometimes you can't figure out the simplest things...)

How do I save the contents of a listbox to a text file, in VB? Does anyone have some simple code?


That's trivial :-) (BTW, why are you still using VB?)

Private Sub MyListBoxSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyListBoxSave.Click
Dim FileNumber As Integer = FreeFile()
Dim MyFilenale As String = "ListBoxContents.TXT"
FileOpen(FileNumber, MyFIlename, OpenMode.Output)
For Each Item As Object In ListBox1.Items
PrintLine(FileNumber, Item.ToString)
Next
FileClose(FileNumber)
End Sub
Imagination is greater than detail - Albert Einstein
User avatar
UShadow
Frequent User
Frequent User
 
Posts: 61
Joined: Fri May 28, 2010 11:49 am

Re: Off topic Question...

Postby MarkY » Tue Jun 22, 2010 11:27 pm

Thanks, UShadow.

Why, what's wrong with VB? If a language can do the job that needs to be done, why not use it?
The gene pool has no lifeguard...
User avatar
MarkY
Active User
Active User
 
Posts: 28
Joined: Sat Feb 06, 2010 7:31 pm

Re: Off topic Question...

Postby UShadow » Fri Jun 25, 2010 8:19 am

MarkY wrote:Thanks, UShadow.

Why, what's wrong with VB? If a language can do the job that needs to be done, why not use it?

You are right. I was just kidding. As you say, if a language does the job for you, why not use it. I don't have anything against VB, it's just that basic, in general, has historically permitted new users to become sloppy programmers, but not forcing them to adhere to rules. Though, I have to say, that I had taken a look at the VB.NET stuff a couple of years ago and the language has gotten much better in that respect. Its construct is starting to look a lot like other, more structured languages - probably because as I read somewhere, all MS languages in VS are sharing the same core components.

Anyway, I was just kidding, I din't mean to criticize VB :-)
Imagination is greater than detail - Albert Einstein
User avatar
UShadow
Frequent User
Frequent User
 
Posts: 61
Joined: Fri May 28, 2010 11:49 am


Return to MapPro OCX

Who is online

Users browsing this forum: No registered users and 1 guest

cron