leprogrammer
Programmer
Hello.
I this txt file:
Where I divide the data into valid and unvalid lines
All the data is saved into an array
The valid data is:
And the unvalid data is:
I go through the array using two buttons:
Forward and previous
I have a int variable called currentLineNumber which contains the selected line from the array
When pressing forward the currentLineNumber is increased and decreased when pressing previous
My problem is that I need to enable and disable these two buttons on a certain point
For example if I am on the line
I want to disable the forward button since there is no valid data after that line
My question is:
How do I enable/disable these buttons when I reach the end of valid data?
Hope you understand otherwise just ask
I this txt file:
Code:
// Comment
2
0 0 20 177 185 4 // comment
0 0 20 75 65 4 // hi!!
0 0 20 85 65 4 // asd
0 0 20 95 65 4 // (bbb
end
Where I divide the data into valid and unvalid lines
All the data is saved into an array
The valid data is:
Code:
0 0 20 177 185 4 // comment
0 0 20 75 65 4 // hi!!
0 0 20 85 65 4 // asd
0 0 20 95 65 4 // (bbb
And the unvalid data is:
Code:
// Comment
2
end
I go through the array using two buttons:
Forward and previous
I have a int variable called currentLineNumber which contains the selected line from the array
When pressing forward the currentLineNumber is increased and decreased when pressing previous
My problem is that I need to enable and disable these two buttons on a certain point
For example if I am on the line
Code:
0 0 20 95 65 4 // (bbb
I want to disable the forward button since there is no valid data after that line
My question is:
How do I enable/disable these buttons when I reach the end of valid data?
Hope you understand otherwise just ask