The Cowsills In Books





Programming in Visual Basic 2010: The Very Beginner's Guide
by James S. McKeown
Cambridge University Press March 29, 2010

Book

Page 399:
Arrays and Structures ~ Organizing Data

This program sorts a CD collection by artist. The file has a list of CDs along with the title and genre. Load the data from the file into arrays, one for the artist, one for the album, and one for the genre. Once they're in the arrays, sort them by artist and then display them on the screen.

The file is called CDSortdat and has the following structure:
Artist, Album, Genre

"Moody Blues", "Days of Future Past", "Classic Rock"
"Newton-John, Olivia", "Have You Never Been Mellow", "Fop"
"Hill, Faith", "Fireflies", "Country"
"Coldplay", "X & Y", "Rock"
"U2", "How to Dismantle an Atomic Bomb" , "Rock"
"Crow, Sheryl", "C'mon C'mon", "Rock"
"Clarkson, Kelly", "Breakaway", "Rock"
"Paisley, Brad", "Time Well Wasted", "Country"
"Beatles", "Help!", "Classic Rock"
"Ace of Base", "Cruel summer", "Pop"
"Black Eyed Peas", "Monkey Business" "Rock"
"Gorillas", "Demon Daye", "Rap"
"Backyardigans", "The Backyardigans", "Childrens"
"Yearwood, Triaha", "Jasper County", "Country"
"311", "Don't Tread on Me", "Rock"
"Jones, Nora", "Come Away with Me", "Pop"
"Keith, Toby", "Honkytonk University", "Country"
"Dylan, Bob", "No Direction Home", "Rock"
"Springateen, Bruce", "Devils & Dust", "Rock"
"Rolling Stones", "Forty Licks", "Classic Rock"
"Queen", "A Night at the Opera", "Classic Rock"
"Abba", "Voulez-Vous", "Pop"
"Partridge Family", "Come on Get Happy!", "Pop"
"Cowsills", "The Rain, the Park & Other Things", "Pop"

Here's the code for it to load the arrays from the file:

'Open File
ofdCDSort.ShowDialog()
srdFile = New-system.IO.streamReader(ofdCBSort.FileName)

. . .




Email Me Home