Hi I am accessing a dbf file with lots of records. This is the portion of code where I am having confusion about!
This is what I have to do
--> If value of velocity is less than 20
-> Write comments as good and new_speed = speed
-->If value of velocity is 20 or greater
->Keep looking until speed value is greater than 5
->Count number of bad records until speed value 5 is reached
->If number of consecutive bad records counted is greater than 10
-->write bad_not_fixed to comments
->If number of consecutive bad records counted is 10 or less
-->Pull 3 previous consecutive good speed records into before array
-->Pull 3 following consecutive good speed records into after array
-->If neither before or after array are filled, write bad_notfixed to comments
-->If both before and after arrays are filled write bad_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
Code:
while ($i<=$rdb->last_record)
{
my @data = $rdb->get_record($i,"Speed", "Velocity"
if($data[2]<20)
{
$comment = "Good";
wdb->set_record($i,$data[1],$data[2],$comment);
}
if($data[2]>20)
{
[COLOR=red]#PLEASE HELP ME FILL THIS PART[/color red]
}
--> If value of velocity is less than 20
-> Write comments as good and new_speed = speed
-->If value of velocity is 20 or greater
->Keep looking until speed value is greater than 5
->Count number of bad records until speed value 5 is reached
->If number of consecutive bad records counted is greater than 10
-->write bad_not_fixed to comments
->If number of consecutive bad records counted is 10 or less
-->Pull 3 previous consecutive good speed records into before array
-->Pull 3 following consecutive good speed records into after array
-->If neither before or after array are filled, write bad_notfixed to comments
-->If both before and after arrays are filled write bad_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