Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 PHP -> ASP

Author  Topic 

simflex
Constraint Violating Yak Guru

327 Posts

Posted - 2004-06-07 : 08:33:03
Hello all,
Last time I had an issue similar to this new issue, I got great help from ehorn.
I have battled with this for 2 days and hope I can receive similar help from ehorn or someone else.

I have tried to re-write my php code in asp.
Normally, I can do a while loop in asp but the way this is written, is giving me some trouble.

Here is the php code, followed by my re-write but it isn't working.
Any help is greatly appreciated.

******************
PHP version
******************
# dont flip the order of the rows (pop vs shift)
$peak_elev = 0;
$li = '';
while ( $li = array_shift($ascii) )
{
# ignore first return value after splitting on whitespace
$data = split(" ",$li);
array_shift($data);
while ( list($key,$elev) = each($data) )
{
if ( $elev < $base_elev )
{
echo "$base_elev ";
}
elseif ( $elev > $cap_elev )
{
echo "$cap_elev ";
}
else
{
echo "$elev ";
if ( $elev > $peak_elev ) { $peak_elev = $elev; }
}
}
echo "\n";
}

$yscale = $scale*$vert_exag*($zspacing/$nrows);

******************
My ASP re-write
******************

' dont flip the order of the rows (pop vs shift)
vpeak_elev = 0;
vli = '';

do while vli = array_shift(vascii)
' ignore first return value after
'splitting on whitespace
vdata = split(vli," ")
array_shift(vdata)
do while list(vkey,velev) = each(vdata)
if velev < vbase_elev then
response.write("vbase_elev")
else if velev > vcap_elev then
response.write("vcap_elev")
else
response.write("velev")
if velev > vpeak_elev then
vpeak_elev = velev
end if
end if
loop
response.write(vbcrlf)
loop
vyscale = vscale * vvert_exag * (vzspacing/vnrows)
   

- Advertisement -