Properties
Similar Topics
Statistics
Comments
2
Participants
3
Subscribers
0
Votes
2
Views
1321
Share
Answered
Hi, I want to do more than one thing when an if condition is true. For example if[a<10,SetValue[a,3] and SetValue[b,5],SetValue[a,10]]
- GeoGebra
- Help
- Partners
-
Contact us
- Feedback & Questions
- This email address is being protected from spambots. You need JavaScript enabled to view it.
- +43 677 6137 2693
© 2023 International GeoGebra Institute
if[a<10,Repeat[1,SetValue[a,3], SetValue[b,5],SetValue[c,10]]]
Note: no If inside Repeat
or
If[a<10, Execute[{"SetValue[a,3]", "SetValue[b,5]","SetValue[c,10]"}] ]
Note: the commands must be in english
if[a<10,Repeat[1,SetValue[a,3], SetValue[b,5],SetValue[c,10]]]
Note: no If inside Repeat
or
If[a<10, Execute[{"SetValue[a,3]", "SetValue[b,5]","SetValue[c,10]"}] ]
Note: the commands must be in english
Also If[a>b,{SetValue[b,5],SetValue[a,10]}] should work. In most cases I'd suggest to avoid Execute (as rami said, Execute requires English commands and makes the code harder to read).
Comments have been locked on this page!