Steve Drake wrote:
> Hello all.
>
> I am wondering about the merits of using global/local variables or
> shift registers. I would think that the global/local variables would
> give better performance than using shift registers to send info back.
> Does anyone have some information on the pro's and con's of each
> method? Does one give you a faster program, take up less memory,
> result in fewer problems?
>
> Thanks for sharing anything you might have on the subject.
>
> Regards,
>
> Steve Drake
Steve,
As with most things, it all depends on what you want to do.
Here are some pros / cons from each item
Memory (biggest to smallest ) : Global, local, shift register (SR)
Disk space (big to little): Global, local , SR
Execution (long to short): Local, global, SR (l
ocal is longer because of
screen updates)
Test case: 10000 interations of a for loop, read , +1, write. Used profiler
to get information over 5 runs.
Each has a place:
Global for VI to VI data exchange
Local to use one object as control and indicator, can help clean up diagram
Shift register is only useful (obviously) in while and for loops.
Globals and locals suffer from race conditions, you have to pay a lot of
attention
to who is writing and who is reading and WHEN.
I hope this clears up the mystery.
Kevin Kent