02-13-2024 03:17 AM
@paul_cardinale wrote:
What do you think of this?
But why would you need that?
The UID won't change, so a quick peek in heap peek is enough. It's a lot more efficient.
I have seen "UID to GObject Reference.vi" crash on some UIDs, so I don't like to use it loops, especially in production code.
02-13-2024 03:42 AM
wiebe@CARYA wrote:
@paul_a_cardinale wrote:
Very nice.
But it doesn't work on a Mac.
And I hate the icon.
The attached version works with a Mac (and has a nice icon).
Now this function doesn't work (properly) in executables, so it's irrelevant, but I don't think the solution itself will work in a PC executable.
On PC, the function has to be a call to LabVIEW, and not the executable's name. The RTE will replace LabVIEW with calls to the LVTRE (lvrt.dll, IIRC).
If you've tested the trick, and if it works, I guess I have to add it to my bag of tricks.
Yes, this indeed doesn't work in PC executables.
02-13-2024 04:16 AM
wiebe@CARYA wrote:
BTW There is another way to get the variant data and type text, although in executables only the data text works.
More on that later...
So here's a VI that returns variant data text in development and executables (Windows maybe Linux, not Mac).
The variant type text only works in development, it is ignored in an exe.
Based on Rolfk's VI...
02-13-2024 07:35 AM
wiebe@CARYA wrote:
wiebe@CARYA wrote:
BTW There is another way to get the variant data and type text, although in executables only the data text works.
More on that later...
So here's a VI that returns variant data text in development and executables (Windows maybe Linux, not Mac).
The variant type text only works in development, it is ignored in an exe.
Based on Rolfk's VI...
It does work on a Mac.
02-13-2024 07:39 AM
@paul_a_cardinale wrote:
wiebe@CARYA wrote:
wiebe@CARYA wrote:
BTW There is another way to get the variant data and type text, although in executables only the data text works.
More on that later...
So here's a VI that returns variant data text in development and executables (Windows maybe Linux, not Mac).
The variant type text only works in development, it is ignored in an exe.
Based on Rolfk's VI...
It does work on a Mac.
Executables too?
02-13-2024 12:12 PM
wiebe@CARYA wrote:
@paul_a_cardinale wrote:
wiebe@CARYA wrote:
wiebe@CARYA wrote:
BTW There is another way to get the variant data and type text, although in executables only the data text works.
More on that later...
So here's a VI that returns variant data text in development and executables (Windows maybe Linux, not Mac).
The variant type text only works in development, it is ignored in an exe.
Based on Rolfk's VI...
It does work on a Mac.
Executables too?
Yes.
02-13-2024 12:43 PM
Should we add code to throw a warning if "Type (Dev. Only!) [F]" is True in a compiled app?
02-14-2024 04:51 AM
@paul_cardinale wrote:
Should we add code to throw a warning if "Type (Dev. Only!) [F]" is True in a compiled app?
I'll consider that when (iff) I actually start using the VI.
02-19-2024 06:29 AM
So there are plenty of interesting comments, but frankly I'm kinda lost. It seems most of the comments focusing on getting the text out of a variant, but do we have a solution to that now? And even if so (data to string), is there a way to write the text back to a variant (string to data)?
02-19-2024 09:32 AM
@1984 wrote:
So there are plenty of interesting comments, but frankly I'm kinda lost. It seems most of the comments focusing on getting the text out of a variant, but do we have a solution to that now?
Yes. It's "Variant Data To Text.vi"
And even if so (data to string), is there a way to write the text back to a variant (string to data)?
Why would you need to do that? Just use the original data.