> If I told my C programming buddies they had to
> perform a function call to get a constant value returned
> to a program, the laughter wouldn't die down for years.

But tell your C++ buddies that they have to use a function, and many will
nod sagely. Inline functions, functions that return static const variables,
virtual functions that return a different const for each class. All of
these and more are ways in which a constant is best accessed through a
function. The VI in LabVIEW that just returns a constant is compiled by our
compiler to be equivalent to having that constant directly on all the
caller VIs. The VI is not a function call, but merely a syntax vehicle for
getting one value out to lots of places across many diagrams.

> maybe the closest equivalent would be to create
> a strict typedef'd custom control, hidden on the
> panel, with the default value set to the value desired.

Instances of a typedef do not change their value when the default value of
the typedef changes. Nor would you want them to 9 times out of 10. Stick
with the VI returning a constant.

Regarding the cluster of constant values from which you can select one
using an implicit unbundle:
Is it easier to drop one constant [from the palette or file system] and
then select which subpiece to use than it is to just select which constant
you want [from the palette or file system] in the first place? I'm not
opposing your general comments that a simpler way to define and then drop
constant values would be useful, I just don't think that the proposed
solution goes very far toward simplifying the situation.

Pojundery,
Stephen R. Mercer
-= LabVIEW R&D =-



Reply via email to