|
|
#1 |
|
Fanatic Member
Join Date: Jul 02
Location: Canada
Posts: 655
![]() |
Thinking foward... Execute code once in loop?
I found the Static declaration very useful since you can declare a variable once and let it run threw a loop or sub
ex: VB Code:
which is pretty usefull anyways, I was wondering if something could do like: VB Code:
Anyways, to get the result of the c variable only once, meh, I was just curious if some new structure could have 'been created... Well, .net, let's think foward! ![]() (btw don't answer me like use flags and do if statements... There are probably billions of ways to do this, I was just wondering if some new stuff was boiling to be used )
__________________
Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85, Website: http://DreamForgery.com |
|
|
|
|
|
#2 |
|
Dream Theater Fan
Join Date: Aug 02
Location: #!/bin/bash
Posts: 5,628
![]() ![]() ![]() ![]() ![]() ![]() |
Re: Thinking foward... Execute code once in loop?
You post makes no sense at all.
__________________
RPNSolve version 1.1.3 (Free commandline math parser) Go on, it's for charity.Registered Linux user number 0x7468A. My Flickr ![]() Of course you're free to go // Go and tell the world my story // Tell them about my brother // Tell them about me // The Count of Tuscany |
|
|
|
|
|
#3 | |
|
Frenzied Member
Join Date: Feb 04
Location: Toledo Cebu City.
Posts: 1,416
![]() ![]() |
Re: Thinking foward... Execute code once in loop?
Quote:
|
|
|
|
|
|
|
#4 | |
|
Dream Theater Fan
Join Date: Aug 02
Location: #!/bin/bash
Posts: 5,628
![]() ![]() ![]() ![]() ![]() ![]() |
Re: Thinking foward... Execute code once in loop?
Quote:
No rudeness intended.I humbly apologise for any anguish, distress or trauma that my earlier comments may have illicited in those of a delicate sensibility.
__________________
RPNSolve version 1.1.3 (Free commandline math parser) Go on, it's for charity.Registered Linux user number 0x7468A. My Flickr ![]() Of course you're free to go // Go and tell the world my story // Tell them about my brother // Tell them about me // The Count of Tuscany |
|
|
|
|
|
|
#5 |
|
Frenzied Member
Join Date: Aug 02
Location: Australia
Posts: 1,718
![]() ![]() |
Re: Thinking foward... Execute code once in loop?
Can you explain this a little better what you're asking/doing? I also didn't quite understand it.
__________________
I use Microsoft Visual Basic 2005. (Therefore, most code samples I provide will be based around the .NET Framework v2.0, unless otherwise specified) |
|
|
|
|
|
#6 |
|
Fanatic Member
Join Date: Jul 02
Location: Canada
Posts: 655
![]() |
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:
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...
__________________
Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85, Website: http://DreamForgery.com |
|
|
|
|
|
#7 |
|
Frenzied Member
Join Date: Jul 02
Location: Canada eh...
Posts: 1,621
![]() ![]() |
Re: Thinking foward... Execute code once in loop?
Then Nope, it would have to be before or after the loop to only execute once.
__________________
Tips:
If you think I was helpful, rate my post IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous
![]() |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|