Click here to Skip to main content
12,304,822 members (65,622 online)
Click here to Skip to main content

Tagged as



Run method one time only

, 18 Jan 2013 CPOL
Here is one way to only run a method in code once. As you can see it uses a bool flag and a for loop to simulate multiple times being ran. After the first time the OnlyOnce method executes it sets the flag to true signifying its been ran and will not run within that for loop anymore.public...



Compare Revision Minor Date Status Editor
2 - publicly available No 18-Jan-13 18:50 Available David_Wimbley
Updates in content. 3 changes had been made.
1 No 18-Jan-13 18:50 Available David_Wimbley


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
United States United States
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160530.1 | Last Updated 18 Jan 2013
Article Copyright 2013 by David_Wimbley
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid