BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Are globals really THAT evil?


tbob wrote:
...

 

How do you point to a particular post instead of the first one on a page?

 

Message Edited by tbob on 04-26-2010 10:54 AM

Good! It about time you build-up your "brag-list". Smiley Happy 

 

I can't say it works but what I do is...

 

1) Click on the number under your icon for the post you want. The screen will update and somewhere in the URL is will record the post #.

 

2) NOW copy the URL and prceed as normal.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 31 of 89
(11,306 Views)

Yep.  That works.  Thanx, Ben.  I'm simply amazed at the fact that I seem to learn something new every day here.  What a great group of guys.

 

- tbob

Inventor of the WORM Global
Message 32 of 89
(11,300 Views)

Ben wrote:

I thought about this this week-end.

 

WORM globals - (Write Once Read Many) globals are a safe use of globals provided you and only you are the developer and you remember that you used globals and already used-up your allotment of write globals.

 

Ben


But how many times have you thought you were that person, and it ended up not being the case? Since Notifiers, lossy Queues, and AE's are so easy to use, I just don't think I'm on board. That global will be misused by someone. (Matches laying around Smiley Wink)

Message Edited by Broken Arrow on 04-26-2010 02:47 PM
Richard






Message 33 of 89
(11,282 Views)
Wait a minute. How about a true WORM Global that only allows one write? Subsequent writes cause a Broken Arrow.
Richard






Message 34 of 89
(11,276 Views)

Time for another idea submission...

 

Who gets this one?  Broken Arrow or wormy tbob?  😉

0 Kudos
Message 35 of 89
(11,270 Views)

Broken Arrow wrote:
Wait a minute. How about a true WORM Global that only allows one write? Subsequent writes cause a Broken Arrow.

Impossible due to the ability to dynamically load VIs.

 

In the past I've suggested a global read-only VI which would include a diagram which would run once when the code starts running, but this suggestion has its own issues.


___________________
Try to take over the world!
Message 36 of 89
(11,265 Views)

tst wrote:

Broken Arrow wrote:
Wait a minute. How about a true WORM Global that only allows one write? Subsequent writes cause a Broken Arrow.

Impossible due to the ability to dynamically load VIs.

 

In the past I've suggested a global read-only VI which would include a diagram which would run once when the code starts running, but this suggestion has its own issues.


 

I think it's a pipe-dream, but couldn't the global be registered on the computer? You would never even be able to name another Global the same again! Smiley Very Happy
Richard






0 Kudos
Message 37 of 89
(11,262 Views)

tst wrote:
Impossible due to the ability to dynamically load VIs.

That thought crossed my mind when Broken Arrow mentionned "broken arrow".

 

Now, maybe the folks at NI can come up with some sort of locking mechanism (not necessaruly a semaphore) that would allow to change once and then it is read-only.

It certainly would be a nice feature and then we would say Globals are good.

 

They do have a function called "First Time?", so maybe they could implement it using some similar mechanism.  

 

Now back to Broken Arrows suggestion...

 

I was thinking that he meant that if you use a global variable and wrote to it somewhere in the project that the next time you select the global and tried to wire to it, it would give you a broken arrow and a broken wire.  I don't know how that could be implemented, but we've seen other rabbits being pulled out of a hat, so maybe it is not so impossible to implement.

Message 38 of 89
(11,243 Views)

Well, C/C++ has constants.  Why can't LV have constants in the form of Globals which cannot be written to from any block diagram.  You would be able to create the Global variable using the standard method.  All globals could be changed in the Global VI by the developer.  But those globals would be read-only anywhere inside any block diagram.  The Change to Write would be greyed out.  It is not a WORM Global, but it would be a constant.  99% of my global uses are like constants.  More people would use them if they were not writeable, and they are so much more easier than using Queues, Notifiers, or AEs.

 

- tbob

Inventor of the WORM Global
Message 39 of 89
(11,242 Views)

tbob wrote:

Well, C/C++ has constants.  Why can't LV have constants in the form of Globals which cannot be written to from any block diagram.


You mean like this?


___________________
Try to take over the world!
0 Kudos
Message 40 of 89
(11,239 Views)