Event in Application Control

Can anybody help me, and explain to me in plain english what this
routine below means and what it is expected to do?

The routine is an event found in the application control sample

onValidate

$path = $_SERVER[‘DOCUMENT_ROOT’]."/scriptcase/file/doc/".{field};
$pointer = fopen("$path", “r”);

while($feof($pointer)){
$line = fgets($pointer,4096);
if(!empty($line)){
sc_exec_sql($line);
echo $line."<br>";
}
}
fclose($pointer);

Re: Event in Application Control

// retrieve the path/file from website root based on fieldname
$path = $_SERVER[‘DOCUMENT_ROOT’]."/scriptcase/file/doc/".{field};

// open the file in readonly; assign pointer var for file; use path from above
$pointer = fopen("$path", “r”);

// read open file until EOF
while($feof($pointer)){
// reads each line of the file, buffer size of 4K
$line = fgets($pointer,4096);
// if fgets was able to read line, assign to var $line for use
if(!empty($line)){
// text was found, scriptcase wants to exec the SQL statement of line
sc_exec_sql($line);
// display the executed line to screen for review
echo $line."<br>";
}
}
// close file
fclose($pointer);

What it is supposed to do is based on what each SQL statement contains.

Regards,
Scott.

Re: Event in Application Control

Thanks Scott for sharing with us your knowlege .
You are truly a great help for us in this forum.

I only wish you were closer to me,
so you could take a look at what I am designing

  • and for sure I could move foward faster with my scriptcase development.

Re: Event in Application Control

Your welcome.

Lord knows I have asked my share of questions trying to get something done.

Regards,
Scott.