0
$\begingroup$

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)

$\endgroup$
2
  • 2
    $\begingroup$ 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) $\endgroup$
    – Mr.Wizard
    Commented May 27, 2017 at 14:02
  • $\begingroup$ Indeed it is in a Module. I will take a look, thanks ! $\endgroup$
    – StarBucK
    Commented May 27, 2017 at 14:38

0

Browse other questions tagged or ask your own question.