Click here to Skip to main content
15,918,889 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Oh No! Pin
CPallini22-Oct-07 0:15
mveCPallini22-Oct-07 0:15 
AnswerRe: [Message Deleted] Pin
Colin Angus Mackay22-Oct-07 7:46
Colin Angus Mackay22-Oct-07 7:46 
QuestionThanks To Dave And Others who helped me Pin
VB 8.021-Oct-07 19:20
VB 8.021-Oct-07 19:20 
QuestionUser based Tabs Format..., Pin
Member 387988121-Oct-07 18:57
Member 387988121-Oct-07 18:57 
AnswerRe: User based Tabs Format..., Pin
Tom Deketelaere21-Oct-07 22:20
professionalTom Deketelaere21-Oct-07 22:20 
GeneralRe: User based Tabs Format..., Pin
Member 387988122-Oct-07 17:40
Member 387988122-Oct-07 17:40 
GeneralRe: User based Tabs Format..., Pin
Tom Deketelaere22-Oct-07 22:24
professionalTom Deketelaere22-Oct-07 22:24 
Questionbeginner here. Pin
bjk8821-Oct-07 13:11
bjk8821-Oct-07 13:11 
hi guys. beginner here!
following code throws up an formatexception error. unsure how fix the problem
reading from a text file with the data:

Rovers
6
1
1
12500
120000
United
4
2
2
20200
400000
City
1
0
7
8000
85000

Public Class Form1
Private Sub btnOutput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOutput.Click
Dim sr As IO.StreamReader = IO.File.OpenText("C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Assessment2\football.txt")
Dim fmtStr As String = "{0, -15}{1, 10:N0}{2, 8:N1}{3, 8:N2}{4, 8:N3}{5, 8:N4}{6, 20:N5}(7, 20:C}{8, 8:P0}"
Dim team As String
Dim played, won, drawn, lost, points, aveA, aveI, perc As Integer

lstbox.Items.Add(String.Format(fmtStr, "Team", "Played", "Won", "Drawn", "Lost", "Points", "AveAttendance", "AveIncome", "%Won"))

team = sr.ReadLine
won = sr.ReadLine
drawn = sr.ReadLine
lost = sr.ReadLine
played = won + lost + drawn
points = (won * 3) + (drawn * 1)
aveA = sr.ReadLine
aveI = sr.ReadLine
lstbox.Items.Add(String.Format(fmtStr, team, won, drawn, lost, points, aveA, aveI, perc))

team = sr.ReadLine
won = sr.ReadLine
drawn = sr.ReadLine
lost = sr.ReadLine
played = won + lost + drawn
points = (won * 3) + (drawn * 1)
aveA = sr.ReadLine
aveI = sr.ReadLine
lstbox.Items.Add(String.Format(fmtStr, team, won, drawn, lost, points, aveA, aveI, perc))

team = sr.ReadLine
won = sr.ReadLine
drawn = sr.ReadLine
lost = sr.ReadLine
played = won + lost + drawn
points = (won * 3) + (drawn * 1)
aveA = sr.ReadLine
aveI = sr.ReadLine
lstbox.Items.Add(String.Format(fmtStr, team, won, drawn, lost, points, aveA, aveI, perc))

sr.Close()

End Sub
End Class
AnswerRe: beginner here. Pin
Colin Angus Mackay21-Oct-07 13:23
Colin Angus Mackay21-Oct-07 13:23 
GeneralRe: beginner here. Pin
bjk8821-Oct-07 13:28
bjk8821-Oct-07 13:28 
GeneralRe: beginner here. Pin
Colin Angus Mackay21-Oct-07 13:33
Colin Angus Mackay21-Oct-07 13:33 
GeneralRe: beginner here. Pin
bjk8821-Oct-07 13:42
bjk8821-Oct-07 13:42 
GeneralRe: beginner here. Pin
Colin Angus Mackay21-Oct-07 13:50
Colin Angus Mackay21-Oct-07 13:50 
GeneralRe: beginner here. Pin
bjk8821-Oct-07 13:58
bjk8821-Oct-07 13:58 
AnswerRe: beginner here. Pin
Guffa21-Oct-07 22:35
Guffa21-Oct-07 22:35 
GeneralRe: beginner here. Pin
bjk8821-Oct-07 22:48
bjk8821-Oct-07 22:48 
GeneralRe: beginner here. Pin
Guffa21-Oct-07 23:01
Guffa21-Oct-07 23:01 
GeneralRe: beginner here. Pin
bjk8821-Oct-07 23:12
bjk8821-Oct-07 23:12 
GeneralRe: beginner here. Pin
Guffa21-Oct-07 23:48
Guffa21-Oct-07 23:48 
GeneralRe: beginner here. Pin
bjk8822-Oct-07 0:04
bjk8822-Oct-07 0:04 
AnswerRe: beginner here. Pin
Guffa22-Oct-07 0:11
Guffa22-Oct-07 0:11 
GeneralRe: beginner here. Pin
bjk8822-Oct-07 0:22
bjk8822-Oct-07 0:22 
GeneralRe: beginner here. Pin
bjk8822-Oct-07 0:44
bjk8822-Oct-07 0:44 
AnswerRe: beginner here. Pin
Guffa22-Oct-07 1:59
Guffa22-Oct-07 1:59 
Questionqube rotation Pin
bapu288921-Oct-07 7:43
bapu288921-Oct-07 7:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.