BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Why some people say Local Variables are bad...

There was a discussion in one thread where there seemed to be 2 camps.  One insisting that Locals were okay... and they are as long as they are carefully utilised, and the other saying that it is better to stay away from Locals, because most people abuse them considerably.
 
This thread is to tally all examples posted on this forum where Locals are either abused, misused, or caused headaches..  A Rube Goldberg cousin dedicated to Locals..  and the occasional Globals.. 
 
Please post examples and links.  
Message 1 of 396
(23,248 Views)

Let's start with this first example.

Thanks to smercurio for posting this reply.

 

Message 2 of 396
(23,246 Views)
Message 3 of 396
(23,231 Views)

Dear JLV,

shall we post 'global' headaches also Smiley Surprised ???? Smiley Wink

Thanks,

Mathan

0 Kudos
Message 4 of 396
(23,227 Views)

Here is a nice tutorial.... njoy

Thanks,

Mathan

0 Kudos
Message 5 of 396
(23,224 Views)

Reverse programming (right-to-left) can be even more confusing with Locals!

See this link.

Mathan, yes Globals are okay 😉

Message 6 of 396
(23,200 Views)

Something seen often... Using Locals to write to itself: 

And of course, there is a race condition in (C); values in the case structure vs out.



Message Edited by JoeLabView on 05-22-2008 12:30 PM
Message 7 of 396
(23,195 Views)

Example of why 18 frame stacked sequence with frames linked via sequence locals and local variables is a nightmare for code maintenance:

Discussed here

Message 8 of 396
(23,190 Views)
Message 9 of 396
(23,187 Views)