Click to See Complete Forum and Search --> : on error resume next


cancer10
04-24-2008, 08:40 AM
Hi

I am unable to get the following code to work, could u plz tell me wots wrong with it?

Purpose: I want to add the "on error resume next" error handling tag on my asp page if the value of x=5 but for some reason this isn't working


dim x

x=5

function myfunc(data)
if x=5 then on error resume next

end function







THanx

yamaharuss
04-24-2008, 09:20 AM
You are writing a function but not calling it. Your function will not fire until it has been called somewhere in your code.

Also, declaring x outside of your function is not going to have any affect on the function. I think what you're trying to do does not require the use of a function...

lose the function and simply try..

dim x
x=5
if x=5 then on error resume next

cancer10
04-24-2008, 11:23 AM
see, I actually want to define a function, which will take 2 parameters. The first one is the data and the second one a boolean one. The boolean value would tell the asp page whether to add the "on error resume next" line or not


function myfunc(data,bpara)
if bpara = 1 then on error resume next
end function

that was the basic idea.