ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm not an expert in VB but can someone tell me what does the second line do?
Code:
On Error Resume Next
I would also like to know about the built in error checking i.e. what does Err5 and Err6 checks for.
Code:
For i = 1 To smodules
On Error Resume Next
kl(i, 1) = ks(i, 1) * Exp(-(-p(i, 0) / b(i, 1)) ^ cc(i, 1))
ku(i, 1) = ks(i, 1) * Exp(-(-p(i, 1) / b(i, 1)) ^ cc(i, 1)) 'weibull function for upper half of element i
If Err = 5 Then
nodefailure = i
nodetype = "lateral shoot"
Exit Do
End If
nn = (-p(i, 1) / b(i, 1)) ^ cc(i, 1) 'n value for upper half in preparation for pgamma function
aa = 1 / cc(i, 1) 'assigns a value for incomplete gamma function
pgamma aa, nn 'calls function pgamma
If Err = 6 Then
nodefailure = i
nodetype = "lateral shoot"
Exit Do
End If
phiu = (1 - gammp) * gamma * ks(i, 1) * b(i, 1) / cc(i, 1) 'phi for upper half
nn = (-p(i, 0) / b(i, 1)) ^ cc(i, 1) 'n value for lower half
pgamma aa, nn 'calls pgamma again with lower half n value
If Err = 6 Then
nodefailure = i
nodetype = "lateral shoot"
Exit Do
End If
phil = (1 - gammp) * gamma * ks(i, 1) * b(i, 1) / cc(i, 1) 'phi for lower half
jl(i, 1) = cf(i, 1) * (phil - phiu) 'flux of element i--CF converts conductivity to conductance
Next i
on error resume next is VB's abissmal attempt at fault recovery. if it hits somesthing that doesn't make sense, either runtime logic, e.g. object doesn't exist... or base syntax errors.
what you do after that is your problem. it never stops making me laugh how pathetic that directive really is.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.