SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old November 29th, 2004, 10:52 AM
twosteppinq twosteppinq is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 twosteppinq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question help with files and arrays??? please help

My problem is that i have a text file that has some info on names, numbers, schools, and scores, all seperated by a tab. What ineed to do is open that file and save it into each seperate part into an array.... having problems storing it into an array.... can someone help??? i would be very grateful

Reply With Quote
  #2  
Old November 29th, 2004, 12:28 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 31 m 41 sec
Reputation Power: 180
What is your code that's giving you problems? Have you used the debugger?
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old November 30th, 2004, 01:21 AM
twosteppinq twosteppinq is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 twosteppinq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dim infile As IO.StreamReader

Dim aLine AsString

Dim Parts() AsString

If IO.File.Exists("Students.txt") Then

infile = IO.File.OpenText("Students.txt")

DoUntil infile.Peek = -1

aLine = infile.ReadLine()

Parts = aLine.Split(vbTab)

mIndex = mIndex + 1

ReDimPreserve mStudentRecord(mIndex)

mStudentRecord(mIndex).Name = Parts(0)

mStudentRecord(mIndex).ID = Parts(1)

mStudentRecord(mIndex).School = Parts(3)

mStudentRecord(mIndex).Score = Parts(4)

Loop

infile.Close()

Else

MessageBox.Show("File does not exist")

EndIf


sw = IO.File.AppendText("Students.txt")

For k = 0 To mIndex Step 1

sw = WriteLine(mStudentRecord(k).Name & vbTab & mStudentRecord(k).ID & vbTab & mStudentRecord(k).School & vbTab & mStudentRecord(k).Score)

Next

sw.Close()

basically im having trouble taking whats in the file and putting it into an array, i am then going to be writing more to the array and file from textboxes on the form.

thanks for any help, let me know if i should attach a zip file of it

Reply With Quote
  #4  
Old November 30th, 2004, 01:44 AM
Journeyman Journeyman is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 20 Journeyman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 19 m 18 sec
Reputation Power: 0
Quote:
Originally Posted by twosteppinq
My problem is that i have a text file that has some info on names, numbers, schools, and scores, all seperated by a tab. What ineed to do is open that file and save it into each seperate part into an array.... having problems storing it into an array.... can someone help??? i would be very grateful



You would be better off creating a database to store the information then pull the info from the db, This gives you more flexability in your code then you won't need the array.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > help with files and arrays??? please help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway