| |
Highwayman
Posts: 2
Score: 0
Joined: 8/9/2007
Status: offline
|
I'm fairly new to VBScript and I've written an asp page to dynamically create content from a text file. Everything was running smoothly, and I had a statement near the bottom of the page in the HTML body to evaluate a condition. If the value of "act_today" is less than that of "dayrun" write the value of "act_today" in red, else write it in black. <td align="right"><% if (act_today)<(dayrun) then response.write("<font color='red'>" & (act_today)) else response.write(act_today) end if %></td> This worked correctly and changed the colour of the output accordingly. However, one of my calculations further up the script could have resulted in an error where the script would try to divide another variable by 0, so I put in the following statement to evaluate this condition. If the value of "remain" is greater than 0, "dayrun" is the rounded result of "to_go" divided by "remain", else dayrun is equal to to_go if (remain)>0 then dayrun=(Round((to_go/remain), 0)) else dayrun=to_go This however has broken the 1st statement, and it always evaluates the condition as false... anyone have any pointers or tips... I havent been able to solve this in a few days so far, and it's doing my head in to say the least
|
|