|
-
Feb 28th, 2005, 03:05 PM
#6
Thread Starter
Fanatic Member
Re: Thinking foward... Execute code once in loop?
uh, ok, sorry for not being crystal clear...
After using the variable declaration method with Static, that can declare a variable used through let's say a form, the variable is only declared once and it becomes available through the whole form. (lookup "Static" for more info)
Anyways,
I was wondering,
Is there a new way to execute a bunch of code, only once even if it's in a loop?
my previous code:
VB Code:
Do
a += 1
b += 2 + a
(The Function)
c = b
(Footer of function)
Loop Until a = 50
Meaning the c variable will be grabbed ONCE in the loop, regardless of the values changing in the 2nd, 3rd, etc loop.
I think hope it's all clear now...
I know I could use a flag method with an IF to do that, but I'm just exploring new functions...
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
|