Hi. I am producing a plot which data comes from a file uploaded by the user, but Mathematica tries to produce the plot from the beginning, when the data is not uploaded yet (I know I could split the procedures in different cells, but I want to keep them in a single one because, even when I know Import[ ] is not compatible with Manipulate[ ], I still want it for the web and minimize the interaction with the user).
I tried to combine and If[ ] and Dynamic[ ]. The next is a simple code that resembles what i ultimately want.
Dynamic[a, Initialization -> (a := "")]
If[Dynamic[a] =!= "", Print[Dynamic[a]], Print["Hi Five!"]]
The problem is that it never enters the "else section". It doesn't matter if I use "", or a number, or a Head or Null, it only updates for the first Print like if a were never compared inside the If.
We can see the same problema with a specific number and without the else section:
Dynamic[a, Initialization -> (a := 3)]
If[Dynamic[a] =!= 3, Print[Dynamic[a]]]
It always prints the value of "a", no matter if I set "a=3" or not.
By the way, I used to use != for "not equal", but if I use that now it doesn't do anything, just shows the If in plain text. I found on the internet that I should use =!= but I don't know why.
Thanks in advance,
Daniel