
-----------------------------------
xBloodyHeartx
Mon Mar 04, 2013 12:41 pm

Help for how to read more than one line from text file with intergers in it.
-----------------------------------
What is it you are trying to achieve?
I am trying to read more then one line from a text file into my program.

What is the problem you are having?
It reads the last line only and makes sure the random number generated doesn't match that 
which it does when it outputs to the screen, but it still shows the first line from the 
file in my output when generating the numbers to the screen.
My text file has and shows in notepad like this
2   4
3   4
I know how to write to a file and add to existing file as well.

Describe what you have tried to solve this problem
I have tried searching through this forums and google search as well, but still can't get 
it to read from the first line make sure it doesn't match before going to next line to 
make sure it doesn't match either.


Post any relevant code (You may choose to attach the file instead of posting 
the code if it is too long)


var hi1, hi2 : int
var menuinput : int
var ch : string (1)
var file : int
var winningnumbers1, winningnumbers2 : int := 0
var linenumber := 0
var tot2hi4lo : int
var linex : int

loop
    cls
    put "3. high and low"
    put "4. exit"
    get menuinput

    if menuinput = 3 then
        cls
        locate (1, 1)
        put "how many lines"
        get linex
        var lines2h4l : array 0 .. linex of int
%Open the file here early
        open : file, "D:/Winnings.txt", get
        for linez2h4l : 1 .. upper (lines2h4l)

            loop
                loop
                    loop
                        hi1 := Rand.Int (1, 4)
                        hi2 := Rand.Int (1, 4)
                        if hi1 not= hi2
                                and hi2 not= hi1
                                then
                            exit
                        end if
                    end loop

                    var d : int := 0
                    var sure : boolean := false
                    loop
                        if hi1 > hi2 then
                            d := hi1
                            hi1 := hi2
                            hi2 := d
                            sure := false
                        end if
                        exit when sure
                        sure := true
                    end loop

                    tot2hi4lo := hi1 + hi2

                    if tot2hi4lo >= 3 and tot2hi4lo 