![]() |
| ||
| Saving text manipulated data Hello. I have a small question/problem. I have this text file: // Test I read it into an array in C#, but in my array I read it in as 0 0 0 15 15 7 // 0 Since this is a easyer way of manipulating with the data, but now I want to save the data to the text file. I know the line number of my array, but that does not add up with the orginal file since I stripped som things So my question is: How do I save the manipulated data so it fits with the orginal data? My code looks like this: string[] SaveMonsterLines = File.ReadAllLines(XMLfileLocation); If you dont understand my question/problem, please speak up :) |
| ||
| Re: Saving text manipulated data Now I got the saving text working by not removing any data from the text file so my array looks like this: // Test But now I ran into another problem I have a image where I draw ellipses on with the coordinates from my text file (X: 15 Y: 15 and the 2: X: 25, Y: 25). It triggers on the paint event from the image I also have a mouse down event on my image I save all my ellipses in a list called List<Rectangle> mapRectangleList = new List<Rectangle>(); When I do mouse down I see if the mouse is over a ellipse. If it is it jumps to a specific line in my MonsterDataArray, but the problem is when I save all my ellipses in the list I dont take end, 0, // and the other things from my text with. I only take: 1 0 30 25 25 240 240 -1 5 // Red Dragon So when I jump to specific line in my array the line doesnt match up Yeah im kinda lost here.. Here is the mouse down part: // Getting cursor position Paint event: // Open the data file (msbr = monsterSetBaseRead) And my checkif private void checkIf(string data) Dont know if this makes any sense There might be an easier soloution, but I dont know it Its allmost the same problem as before, but in a diffrent context |
| All times are GMT -4. The time now is 10:21 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC