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.
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 whitespacevdata = split(vli," ")array_shift(vdata)do while list(vkey,velev) = each(vdata)if velev < vbase_elev thenresponse.write("vbase_elev")else if velev > vcap_elev thenresponse.write("vcap_elev")elseresponse.write("velev")if velev > vpeak_elev thenvpeak_elev = velevend ifend ifloopresponse.write(vbcrlf)loopvyscale = vscale * vvert_exag * (vzspacing/vnrows) |
|
|
|
|