0

In my code I first wrote :

Print["else"]
beta156v345 = 
 1/Sin[theta15]*1/
  Sin[theta35]*(Cos[theta13]*1 - 
    Cos[theta15] Cos[theta35]); (* j1^j5 . j3^j5 *)

And it said me a set::write error.

Then I added a ";" after my Print["else"] :

 Print["else"];
beta156v345 = 
 1/Sin[theta15]*1/
  Sin[theta35]*(Cos[theta13]*1 - 
    Cos[theta15] Cos[theta35]); (* j1^j5 . j3^j5 *)

And there were no longer the error.

Why there had an error in the first time ? I thought that the ";" was only here to say "do not display this" if I have a variable for example. (I just want to understand how mathematica works to be more efficient)

Michael E2
  • 235,386
  • 17
  • 334
  • 747
StarBucK
  • 2,164
  • 1
  • 10
  • 33
  • 2
    Is this code contained in a Module or other construct? Only bare lines of code are read as actual lines; those contained in something else need to be separated. See the example in the middle of my answer to (41086) – Mr.Wizard May 27 '17 at 14:02
  • Indeed it is in a Module. I will take a look, thanks ! – StarBucK May 27 '17 at 14:38

0 Answers0