10-15-2020 10:28 AM
My question:
I want to use a local or global variable in a single VI program.
I want to be able to create and name variables as the single VI program executes?
10-15-2020 10:45 AM
Why? Care to elaborate more on what your application is and why you think to need to define variables on the fly?
10-15-2020 10:49 AM - edited 10-15-2020 10:50 AM
You definitely need to explain in much more detail what you actually want to do. It is significantly more helpful to explain what you want to do, and not how you want to do it.
(For example you could use a Map to store name<>value pairs.)
10-15-2020 11:36 AM
oh naming variables on-the-fly.. I was just thinking it might be something I could use in order to save real estate.
So I don't really have a explanation currently exactly how I would use that..
I just want to know if it's possible or not?
10-15-2020 11:44 AM
@chrlum47 wrote:
oh naming variables on-the-fly.. I was just thinking it might be something I could use in order to save real estate.
So I don't really have a explanation currently exactly how I would use that..
I just want to know if it's possible or not?
There are certainly ways to do essentially what you are asking, but why would you want to do so? The fact that you are asking about local and global variables suggests that you look at these as normal programming practice. They are not. There are instances where they are useful, but improper use will lead to all sorts of race conditions. I'm working on a project now with hundreds of vi's and not a local or a global variable in sight.
10-15-2020 11:48 AM
Fair enough thanks