Skip to main content
12-Amethyst
May 18, 2020
Solved

What are the differences between := in regular math block and <- in loop block?

  • May 18, 2020
  • 2 replies
  • 3029 views

From my (very limited) experience, in the (if, while) loop, Mathcad doesn't allow := but only <-. I was just wondering how are they differ from one another.

 

Thank you!

Best answer by AlanStevens

They are both assignment operators, but the left arrow is used within a programming structure, while the := is only used outside a programming structure.

 

Why this is the case, I've no idea!

 

Alan

 

2 replies

19-Tanzanite
May 18, 2020

They are both assignment operators, but the left arrow is used within a programming structure, while the := is only used outside a programming structure.

 

Why this is the case, I've no idea!

 

Alan

 

23-Emerald IV
May 18, 2020

LucMeekes_0-1589810120180.png

Success!

Luc

yoohooos12-AmethystAuthor
12-Amethyst
May 18, 2020

Could you please explain what does each means? 

23-Emerald I
May 18, 2020

As Alan says they're both assignment operators.  The "left arrow."  { <--} only works in program blocks.  Assignments inside program blocks stay inside program blocks--the assignment isn't valid outside the program.  The { :=} assignment is the more common one, out in "free Mathcad."  That assigns the variable/function for the rest of the sheet (below and right of) unless it is overwritten by another assignment statement.