:confused: No. I know where you're going with this now. I had another look at the first post again. I wasn't thinking that way at the time. As i said it all makes sense now. Thanks.
Regards Zeldacat
:confused: No. I know where you're going with this now. I had another look at the first post again. I wasn't thinking that way at the time. As i said it all makes sense now. Thanks.
Regards Zeldacat
Sorry Karl I made a bit of a boo boo here. I forgot to add the fact, i'm using a .csv file to append the new persons data to. I might get a thread going properly one day. :confused:
Regards Zeldacat
I am have problems adding records to an array. I am using a structure and an arraylist Code Snippet Public Persons As New ArrayList Public Structure Person Public First As String Public Last As String Public Home As String Public Work As String Public Mobile As String End Structure and the next block is to add a record to the list Code Snippet Dim p As New Person p.First = txtFirst2.Text p.Last = txtLast2.Text p.Home = txtHome2.Text p.Work = txtWork2.Text p.Mobile = txtMobile2.Text Persons.Add(p) lstPhone.Items.Add(p.First + " " + p.Last) The above code works but the trouble i'm having now is I cannot append to the array or save it. Can anyone help? Thanks all :((
Regards Zeldacat
Thanks John for the info. It is the sort of info i needed to look at before i tried again Regards Lawrence Zeldacat
Regards Zeldacat
Hi all I'm just after general examples dealing with streamwriter appendtext examples. I have had a look around microsoft and of course Code Project but can't find much to help. I am old and ready for the knackers yard, but still trying. I use the MSDN in Miscrosoft, but sometimes i find it more confusing than helpful. Can anyone just give me general guidance? Thanks Zeldacat
Regards Zeldacat
I am trying to do a game of pong. My problem is, i can't get the ball served to a patricular point or location. By changing a valriables value i can get the ball served either to the left or right, up or down. the ball is located in thr middle of the form. When i serve the ball it will either do up or down and then bounce off the top or bottom, so if i want to serve a ball directly to a point say in the top left hand corner. i can't. here are the variables i am using and a bit of code trying to explain what i mean i'm using a timer for the ball speed Dim XChange As Integer = -5 Dim YChange As Integer = 5 Dim BallDirX As Integer 'for direction Dim BallDirY As Integer 'for direction Dim X, Y As Integer 'unused just in case If picBall.Top < 0 Then picBall.Top = 0 XChange = -5 YChange = 5 Here I want the ball to bounce off the wall and goto a YPoint say 50 and the xpoint as zero as the ball bounces in thay direction End If thnks from Zeldacat
Regards Zeldacat
Thank you all. Sorry, I do have problem describing details about things. I have changed the arrays around a bit, so i can now do the total scores. Once again thank you.
Regards Zeldacat
Use Decimal for a variable then, as was said, Iterate through.
Regards Zeldacat
I am doing a game of Blackjack. I have only one problem to figure out. I cannot get the dealers cards to add up if it is more than two cards. i am giving two cards to the dealer on the on the first deal. I can get the dealers total hear, but i can't get the totals if the dealer needs more than two cards. I am using arrays for the cards and card values plus piture boxes. I also have an array for the players and dealers last four cards. The players four extra cards i have on a click event. It is just the dealers totals i cannot work out.
Regards Zeldacat
Thanks to all for the help. I have now resolved my query.
Regards Zeldacat
sorry I know what you mean. the code i showed is what i am trying to use as an example. but i got myself totally lost. teaching yourself at 52 isn't easy. but i must
Regards Zeldacat
I am doing an Example of creating barcharts in VB. I am using two variables Thedate as date = Today Theweight as double The weight is input on a daily basis via a textbox. The date is taken from the pc's calender. I have a sample to go by, which uses integers and doubles as variables. Everything i have tried so far gets errors because of the date. Dim NumberGames As Integer Dim DStreak(144) As Double Private Sub frmPlot_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim Streak As Integer 'Open file, load data in arrays FileOpen(1, AppPath() + "mar95.csv", OpenMode.Input) NumberGames = 0 Do Until EOF(1) Input(1, NumberGames) Input(1, Streak) DStreak(NumberGames) = CDbl(Streak) Loop FileClose(1) picPlot_Paint(Nothing, Nothing) End Sub The above code is what i am trying to follow. i hope this helps thanks
Regards Zeldacat
I am doing an Example of creating barcharts in VB. I am using two variables Thedate as date = Today Theweight as double The weight is input on a daily basis via a textbox. The date is taken from the pc's calender. I have a sample to go by, which uses integers and doubles as variables. Everything i have tried so far gets errors because of the date. Dim NumberGames As Integer Dim DStreak(144) As Double Private Sub frmPlot_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim Streak As Integer 'Open file, load data in arrays FileOpen(1, AppPath() + "mar95.csv", OpenMode.Input) NumberGames = 0 Do Until EOF(1) Input(1, NumberGames) Input(1, Streak) DStreak(NumberGames) = CDbl(Streak) Loop FileClose(1) picPlot_Paint(Nothing, Nothing) End Sub The above code is what i am trying to follow. i hope this helps thanks
Regards Zeldacat
I am doing a bar chart using a date variable and a double variable. I am having trouble reading in the date. Do I have to read in the date using seperate variables for the date?
Regards Zeldacat
I am trying to do a barchart from data in a csv file in vb 2k3. I can write the required data to the csv file, but from here i am totally stuck and don't know which way to turn. Any help or advise would be greatfully welcome.
Regards Zeldacat
I,m after some vb 2003 source code for the card game Blackjack. Can anyone help?
Regards Zeldacat
I'm having a problem with the Addressof part. Do i have to do a sub procedure for the click events, if so how? Do I use the performclick method? I have added the part of code i'm using. Any help or advice will be welcomed. Dim mnuFileRecent1 As New MenuItem Dim mnuFileRecent2 As New MenuItem Dim mnuFileRecent3 As New MenuItem Dim mnuFileRecent4 As New MenuItem Dim RecentFiles(3) As String Dim ThePath As String Dim I As Integer Private Function AppPath() As String Dim A As String 'Executing file location and name A = Reflection.Assembly.GetExecutingAssembly.Location 'Strip off file name A = Mid(A, 1, InStrRev(A, "\")) Return (A) End Function Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click Me.Close() End Sub Private Sub mnuFileOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileOprn.Click If dlgOpen.ShowDialog() = DialogResult.OK Then FileOpen(1, dlgOpen.FileName, OpenMode.Input) txtOutput.Text = InputString(1, CInt(LOF(1))) txtOutput.SelectionLength = 0 FileClose(1) ThePath = dlgOpen.FileName RearrangeFiles(ThePath) End If End Sub Private Sub RearrangeFiles(ByVal F As String) 'Reorder the four most recent files located in the menu structure Dim TempArray(4) As String Dim TempArrayCounter As Integer = 1 Dim i As Integer 'The first item is the name of the file just opened. TempArray(0) = F 'Loop the the origonal array, if the item is not the 'same as the new file opened add it to the temp array. For i = 0 To 3 If RecentFiles(i) <> F Then TempArray(TempArrayCounter) = RecentFiles(i) TempArrayCounter += 1 End If Next i 'Reassign the array RecentFiles = TempArray 'Re-populate the menu. mnuFileRecent1.Text = "1 " + RecentFiles(0) mnuFileRecent2.Text = "2 " + RecentFiles(1) mnuFileRecent3.Text = "3 " + RecentFiles(2) mnuFileRecent4.Text = "4 " + RecentFiles(3) End Sub Private Sub frmRecent_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Try FileOpen(1, AppPath() + "Recent.dat", OpenMode.Input) mnuFileRecent.MenuItems.Add(mnuFileRecent1) mnuFileRecent.MenuItems.Add(mnuFileRecent2) mnuFileRecent.MenuItems.Add(mnuFileRecent3) mnuFileRecent.MenuItems.Add(mnuFileRecent4) 'AddHandler mnuFileRecent1.Click, AddressOf Input(1, RecentFiles(0)) Input(1, RecentFiles(1)) Input(1, RecentFiles(2)) Input(1, RecentFiles(3)) FileClose(1) Catch ex As Exception End Try Try For I = 0 To 3 Select Case I Case 0 mnuFileRec
I am doing a recent files menuitem. I am using a zero based array of 4 items, which i have displayed everytime you load the form. The problem i have now is, how do i limit the datafile to 4 entries? i can append the data file, but thats it. Any suggestions would be most welcome.
Regards Zeldacat
[Message Deleted]
i am doing a project to enter data to a text file and save it.(a single line of data on a daily basis) this i can do, but the only problem i have is when you append the textfile the data entered goes to the next line down. how do i get it to reverse, go above the last line.
Regards Zeldacat