[Year 12 SofDev] Reading and Writing text data files in VB2010
Travis Parker
Travis.Parker at beaconhills.vic.edu.au
Thu May 12 09:26:24 EST 2011
Thanks for that Mark. I have been using something similar with my
students, particularly as the SAC I have written includes reading from a
text file (A prototype helpdesk, including type of job, computer,
priority, etc) and creating a new text file with jobs for the techies in
a prioritised order.
One thing I was wondering though, does anyone have anything good on
reading comma separated text files? All the programs I have gotten my
students to create read them a line at a time, but I would ideally like
to see something like this line - tim.cox, hardware, 12, ps40, 2 read
into arrays. So I would have a "Name", "Issue", "Computer_Number",
"Room_Number", "Priority" or something like that. I'm fine with the
arrays, but how would I read it in word at a time (i.e. Between commas"
rather than line at a time?
With many thanks for a first year SD newbie......
Trav
From: sofdev-bounces at edulists.com.au
[mailto:sofdev-bounces at edulists.com.au] On Behalf Of Mark KELLY
Sent: Wednesday, 11 May 2011 12:45 PM
To: Year 12 Software Development Teachers' Mailing List
Subject: [Year 12 SofDev] Reading and Writing text data files in VB2010
Hi, you paragons of pedagogy. I've been putting off teaching my kids
how to read and write text data files in VB but having investigated
today, it's not really more difficult than the days of VB6 with OPEN
"file" FOR INPUT AS 1 ... INPUT #1, data.
I've attached an adapted tutorial on reading and writing text files with
a task involving reading and writing a preferences file (with solution).
Once your kids can do data files, it greatly opens the scope for
populating and playing with really large arrays and makes loops
meaningful.
I remember how excited I was when I first discovered text files decades
ago - it was like finding mum's car keys. My programming world
blossomed from that point.
--
Mark Kelly
Manager of ICT, Reporting, IT Learning Area
McKinnon Secondary College
McKinnon Rd McKinnon 3204, Victoria, Australia
Direct line / Voicemail: +613 8520 9085, Fax +613 9578 9253
kel at mckinnonsc.vic.edu.au
VCE IT Lecture Notes: http://vceit.com
Moderator: IT Applications Edulist
Want a good time? Call 0112358. Ask for Mr Fibonacci.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.edulists.com.au/pipermail/sofdev/attachments/20110512/8e0fa1aa/attachment-0001.html
More information about the sofdev
mailing list