Hi
I am accessing a dbf file with lots of records. This is the portion of code where I am having confusion about!
CODE
while ($i<=$rdb->last_record)
{
my @data = $rdb->get_record($i,"X", "Y"
if($data[2]<20)
{
$comment = "Good";
wdb->set_record($i,$data[1],$data[2],$comment);
}
if($data[2]>20)
{
#PLEASE HELP ME FILL THIS PART
}
This is what I have to do
--> If value of Y is less than 20
-> Write comments as good
-->If value of Y is 20 or greater
->Keep looking until X value is greater than 5
->Count number of records until X value 5 is reached--(*)
->If number of these consecutive records counted in (*) is greater than 10
-->write bad_not_fixed to comments
->If number of consecutive records counted in (*) is 10 or less
--> write fixed to comments
The main reason for my confusion is how do you first finish counting the records(10) and then go back and write? Please help me with this.
I wold really appreciate it.
Cheerz
I am accessing a dbf file with lots of records. This is the portion of code where I am having confusion about!
CODE
while ($i<=$rdb->last_record)
{
my @data = $rdb->get_record($i,"X", "Y"
if($data[2]<20)
{
$comment = "Good";
wdb->set_record($i,$data[1],$data[2],$comment);
}
if($data[2]>20)
{
#PLEASE HELP ME FILL THIS PART
}
This is what I have to do
--> If value of Y is less than 20
-> Write comments as good
-->If value of Y is 20 or greater
->Keep looking until X value is greater than 5
->Count number of records until X value 5 is reached--(*)
->If number of these consecutive records counted in (*) is greater than 10
-->write bad_not_fixed to comments
->If number of consecutive records counted in (*) is 10 or less
--> write fixed to comments
The main reason for my confusion is how do you first finish counting the records(10) and then go back and write? Please help me with this.
I wold really appreciate it.
Cheerz