Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

[Visual Basic] CSV Files and textboxes


  • Please log in to reply
4 replies to this topic

#1 paroxysmattack

paroxysmattack

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:29 PM

Posted 01 March 2014 - 01:02 PM

Hello,
 
So I have this assignment due Monday that I absolutely stumped on and nobody online is really able to help me.
 
I have a CSV file, and all information per record is separated by a comma. Each record is on it's own line: First name, last name, phone number and nicknames (nicknames can have more than one entry). I have 3 single-line textboxes names appropriately for the names and phone numbers, and one multi-line box for the nicknames. I have four buttons: Load Contacts, Previous Contact, Next Contact and Exit. Here is a screen shot:
 
7eZvn.png
 
 
Basically, I have to be able to press "Load Contacts" and it has to open the CSV file. The location is already in the code, so I don't have to do an OpenFileDialog.  When I press the button, the first contact should appear in the boxes, and the user should be able to scroll through the contacts using the previous and next buttons. They should be able to make changes where needed and have the file save when exiting. 
 
Here's what I got so far. Someone elsewhere online said I was on the right track but couldn't exactly tell me where the issue was. As of right now I get the following error messages when running the program:
 
7eZs4.png


BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:06:29 PM

Posted 01 March 2014 - 04:30 PM

The error message indicates the exact problem. Did you declare and initialize your variables?



#3 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:05:29 PM

Posted 02 March 2014 - 02:15 AM

The error message indicates the exact problem. Did you declare and initialize your variables?


http://blogs.msdn.com/b/oldnewthing/archive/2010/03/24/9983984.aspx

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#4 paroxysmattack

paroxysmattack
  • Topic Starter

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:29 PM

Posted 02 March 2014 - 03:21 AM

I believe I did it correctly. I can't really assign it a value because it will have no value until the file is opened, right? Please excuse my ignorance. 



#5 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:05:29 PM

Posted 03 March 2014 - 02:45 AM

You can assign it to null. (Nothing in Visual Basic).

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users