# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Changing Variables in Case Structure?

Hi all,

I have a case structure. Based on whether the case is t/f I would like to change the value of two variables. If I put the two variables in the true part of the case strcture they can't be in the false part. How would I assign them values outside of the case structure? Could I refer to them numeorus times in the different cases? Thanks.

Message 1 of 8
(476 Views)

## Re: Changing Variables in Case Structure?

Couldn't you simply assign the values inside the structure, and put the variables outside to the right?

Im afraid im not 100% sure what you are asking.

Like this?

Message 2 of 8
(473 Views)

## Re: Changing Variables in Case Structure?

Here's the part of the code. Basically I have 4 values. I then compare two in order to determine which values to use. Should for example the value on left be greater, I want to write the two left values to a pair of vairables. Should the value on the right be greater I wish to write the two values on the right to the pair of vairables mentioned previously. I tried writing them in a case structure but I couldn't put the variables in both the true and false part of the case structure.

Message 3 of 8
(468 Views)

## Re: Changing Variables in Case Structure?

Bascially I would like to say in pseudo code if the four top values are w/x and y/z and the two new values are a/b

if w > y

a = w

b = x

if y > w

a = y

b = z

Message 4 of 8
(456 Views)
Solution
Accepted by topic author JustinC
08-27-2015 04:09 PM

## Re: Changing Variables in Case Structure?

So something like this?

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 5 of 8
(451 Views)
Highlighted

## Re: Changing Variables in Case Structure?

Yes! Exactly what I was looking for. Thnaks!

Message 6 of 8
(446 Views)

## Re: Changing Variables in Case Structure?

Crap, crossrulz just barely beat me to it...

Message 7 of 8
(441 Views)

## Re: Changing Variables in Case Structure?

@NateTheGreat wrote:

Crap, crossrulz just barely beat me to it...

Yeah, I'm having fun this week.  Altenbach normally just beats me.  But he's busy having fun at NI Week and so I manage to get solutions in.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 8 of 8
(439 Views)