# BreakPoint

cancel
Showing results for
Did you mean:

## Re: LabVIEW Minutiae (that may bite you someday)

In this thread Sunflower brings one of the "Bite you" scenarios regarding setting an AE as re-entrant and getting away with it... for now.

Ben

Message 41 of 131
(4,168 Views)

## Re: LabVIEW Minutiae (that may bite you someday)

Casting an int to an Enum (strict).

Who thought it would be so tricky?  Turns out that although I had expected each of the last 4 methods to be functionally equvellent I was wrong.

I guess you really do learn something new every day.

Message 42 of 131
(4,109 Views)

## Re: LabVIEW Minutiae (that may bite you someday)

Make that constant into a U16 and Bob will be your uncle.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 43 of 131
(4,103 Views)

## Re: LabVIEW Minutiae (that may bite you someday)

This NI document explains typecasting an integer into an enum.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 44 of 131
(4,093 Views)
Highlighted

## Re: LabVIEW Minutiae (that may bite you someday)

Just when I thought I knew something about LabVIEW!

Thanks Jim!  I wondered WHY- now I know.

Message 45 of 131
(4,083 Views)

## Re: LabVIEW Minutiae (that may bite you someday)

Jeff, you'd might like this too.

Coerce to Type

Message 46 of 131
(4,069 Views)

## Re: LabVIEW Minutiae (that may bite you someday)

Here is one that I also consider bad programming practice.

Setting a typedef enum as Use Default If Unwired always returns the FIRST (lowest number) in the enum. If you right click and create a constant, you will get whichever state was set to Make Current Value Default. This may be different from what the output is when left unwired. The default state is not shown and you have to look at the typedef to find out which will be the output.

Related - if someone rearranges the typedef enum (moves some other text to the first element) then the output of the unwired terminal changes. The state when you create a constant does not.

I think I would prefer a "Create Constant in Unwired Cases" option to use here.

Rob

Message 47 of 131
(4,055 Views)

## Re: LabVIEW Minutiae (that may bite you someday)

You have a value changed event for a combo box with Allow Undefined Strings deselected. You try to enter an invalid string into the combo box the system beeps an error at you and the control is not updated. As soon as you click somewhere else on the FP but the value changed event fires anyway. If you press escape prior to clicking away from the control the event is not fired.

Bug or intended behavior?

=====================
LabVIEW 2012

Message 48 of 131
(3,974 Views)

## Re: LabVIEW Minutiae (that may bite you someday)

SteveChandler wrote:

Grr... It is early and I ran out of time to edit. The link points to the right thread but the wrong post. Just scroll up and see the first post. Anyway...

=====================
LabVIEW 2012

Message 49 of 131
(3,961 Views)

## Re: LabVIEW Minutiae (that may bite you someday)

When working with the 3D Graph in the 3D Picture, I got bit.

A is not equal to B

Since I cut-n-pasted from an example I ASSumed that the wire was run behind the structure and worked with the value from "A" right up until I tested it.

Please note the tiny arrows indicating an Input AND an Output.

Can anyone else recall seeing another one these anywhere else?

Ben

Message 50 of 131
(3,895 Views)