Message Boards Message Boards

0
|
4202 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Do not see label

Posted 9 years ago

Program does not see the label when I use goto. Please help me in this situation. Help please fix it ! I would be very grateful .

Attachments:
POSTED BY: Nick Larionov

That works

In[2]:= Clear[a, b, c, d];
b = 1; a = 30;
{
 If[b <= 2, Goto[10], Goto[20]];
 Goto[20];
 Label[10];
 a = 10;
 Print["a = " , a];
 Goto[30];
 Label[20];
 a = 20;
 Print["a = ", a];
 Label[30];
 Print["the end"]
}

During evaluation of In[2]:= a = 10
During evaluation of In[2]:= the end
Out[4]= {Null}

Do you see the difference? Hint: CompoundExpression and Goto.

POSTED BY: Udo Krause
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract