On 03/07/2012 06:22 PM, gene heskett wrote: > On Wednesday, March 07, 2012 06:16:33 PM Mark Wendt did opine: >> Gene, >> >> How are you returning the value of the global variable after you exit >> the loop? Perhaps you need an assignment statement prior to the exit of >> the loop to ensure you are returning the value you want? Crazy things >> can happen inside those things to global variables. >> >> mark >> > > I had been assuming that it was whatever it was inside the loop, when the > loop fell through. That didn't turn out to be overly reliable as it was > often the same value as before the loop, even if it had been modified 360k > times inside the loop. > > Cheers, Gene > Are there any other things going on which may have the ability to write to the variable once the loop lets go of the lock?
I don't really like using global variables when I can avoid it, especially inside functions, loops or whatever. I'd much rather return a value that I can set the global variable to, than muck around changing the variable inside. Use a local variable and return that value to the global value. Mark ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
