|
-
Aug 19th, 2005, 02:52 AM
#1
Thread Starter
Lively Member
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
Last edited by Resilience; Aug 19th, 2005 at 03:17 AM.
Reason: resolved
--- Science does not explain why things are what they are. What we get from Science is our interpretation of how things do what they do.
--- No Scientific law of the universe is stable, we did not create it, and we will never understand all of its abilities.
--- What we determine as reality is a mere assumption of what tomorrow will be based on what yesterday was.
-
Aug 19th, 2005, 02:56 AM
#2
Frenzied Member
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
Last edited by Devion; Aug 19th, 2005 at 03:00 AM.
-
Aug 19th, 2005, 03:15 AM
#3
Thread Starter
Lively Member
Re: checking multiple variables
--- Science does not explain why things are what they are. What we get from Science is our interpretation of how things do what they do.
--- No Scientific law of the universe is stable, we did not create it, and we will never understand all of its abilities.
--- What we determine as reality is a mere assumption of what tomorrow will be based on what yesterday was.
-
Aug 19th, 2005, 03:19 AM
#4
Frenzied Member
Re: checking multiple variables (resolved)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|