Hey, Ive recently started programming and kinda hit a wall on how to continue :S

Im trying to load the values in a textfile into a array and then calculate the lowest value in the array and display it.

The format in the textfile is in HH.MM.SS and every value is stored for example 01.52.26 on a seperate line in the file, and i want to be able to drag those values out and then find the lowest one and display it in the same format. But i got no clue how to start :S ive looked around on how to but with no luck so far, atm im useing the ReadAllLines command but to be honest i dont really know how to use it properly.

Recommended Answers

All 2 Replies

So this is what you can do: Declare 6 Integer variables like: hour1,min1,sec1 and three more Integer varaibles hour2,min2,sec2. Take your first string from your text. Split it into three parts and convert these to Integers and store these in your first three Integers. Grab the next text, do the same but store these in the second lot of varaibles. Compare the hours, and if needed the minutes and seconds and either replace the first lot with the second or load the next lot into the second lot of variables - compare again until you have reached the end of your text file and diplay the stored numbers from the first three varaibles as these should be now the lowest.

thank you for the reply, i will try this out and see if it works.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.