checking multiple variables (resolved)
fairly simple question, is there any way to check the status of multi variables at once? I figure if it is possible they would have to be variables with arrays
such as,
currently that i have to use:
VB Code:
dim var(1 to 5) as boolean
If var(1) = true then 'do whatever code goes here
If var(2) = true then 'do whatever code goes here
If var(3) = true then 'do whatever code goes here
If var(4) = true then 'do whatever code goes here
If var(5) = true then 'do whatever code goes here
what i have want, but didnt work out:
VB Code:
dim var(1 to 5) as boolean
If var(1 to 5) = true then 'do whatever code goes here
Re: checking multiple variables
Here ya go :)
VB Code:
dim intCount as integer, ysnOk as boolean
ysnOk = true
for intCount = 1 to ubound(Var)
if var(intcount) = false then
ysnOk = false
exit for
end if
next
if ysnOk then
' Do your code if all checks out :)
end if
Or the slightly different version...
VB Code:
dim intCount as integer, ysnOk as boolean
for intCount = lbound(var) to ubound(Var)
if not var(intcount) then
ysnOk = not ysnOk
exit for
end if
next
if ysnOk then
' Do your code if all checks out :)
end if
Re: checking multiple variables
Re: checking multiple variables (resolved)