Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

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...

Revisions


  

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

License

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

Share

About the Author

David_Wimbley
Software Developer
United States United States
No Biography provided

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