Hi there guys. I have a text file that I’m using to store a user’s session in my C# app. I need to load the info back into my app and all is working fine but for one section where I need to loop through a section of lines. I think it is best explained to look at the file structure, here it is:
PageName=aaa
PageTimespan=10
Clocks
Clock=(-21.9, 5.4, -5.0);Point2
Clock=(0.0, 15.8, -5.0);Point5
Clock=(24.1, 5.8, -5.0);Point8
NewCurve
curvePoints=(-35.9, -1.9, -5.0)
curvePoints=(-35.9, -1.9, -5.0)
curvePoints=(-6.4, 13.7, -5.0)
curvePoints=(5.2, 14.6, -5.0)
curvePoints=(35.9, 0.6, -5.0)
curvePoints=(35.9, 0.6, -5.0)
NewCurve
curvePoints=(-35.9, -4.7, -5.0)
curvePoints=(-35.9, -4.7, -5.0)
curvePoints=(-3.8, -9.2, -5.0)
curvePoints=(8.5, -9.5, -5.0)
curvePoints=(36.2, -1.8, -5.0)
curvePoints=(36.2, -1.8, -5.0)
PageName=bbb
PageTimespan=20
Clocks
Clock=(-22.7, 1.4, -5.0);Point2
Clock=(-4.8, 4.4, -5.0);Point4
Clock=(25.9, 3.2, -5.0);Point8
NewCurve
curvePoints=(-34.8, -4.8, -5.0)
curvePoints=(-34.8, -4.8, -5.0)
curvePoints=(-7.0, 9.1, 0.0)
curvePoints=(-0.1, 1.0, -5.0)
curvePoints=(36.2, 4.8, -5.0)
curvePoints=(36.2, 4.8, -5.0)
The only part my question is about is how would I loop form NewCurve, through the curvePoints until the next section is reached and store those curvePoints in a list. The focus of my question is on the actuall loop, not the parsing of the data etc. I have tried a do while loop, but I can’t seem to get it right!
Any help will be much appreciated