Dynamic again

I want to build a tasks distributor.

This small example doesn’t work.

I get a message on the error window.

Where do I put the Dynamic? (again)

Thanks.

The problem here isn’t with dynamic.

The first step in debugging any problem like this is to make the simplest possible example of it. Remove the inessential parts of the code.

Here is a simple example of your problem:

m = 2;

(* Why is the value always Null?*)
Dynamic[Switch[m,
  1, Print["a"],
  2, Print["b"]
  ]]

What does the following code do?

Switch[1,
      1, Print["a"],
      2, Print["b"]
      ]

The code prints the value “a” to the screen and returns Null. Please make sure you understand this. You want it to return the value “a” instead of printing it to the screen:

m = 2;
Dynamic[Switch[m,
  1, "a"
  2, "b"
  ]]

Sean:

I sent a very short and buggy example before. I send now my real problem, it´s a little long but the idea is clear. It’s almost the same code as before. Functions within Mathematica, but it does not work when I’ am trying to produce my CDF file. That is the real problem.

I am in search of an error out of my reach.

I thank you for your time.

This is a new problem that is not related to the previous one. Please make a new post asking for help with it.

The first step in debugging any problem like this is to make the simplest possible example of it.

Please remove the inessential parts of the code. Reduce the code down as much as possible before posting it. This will help other people help you. Please try this.