Difference between revisions of "Execute Command"

From GeoGebra Manual
Jump to: navigation, search
m (Text replace - "<div class="box info"> 48px|left This page is part of the official manual for print and pdf. For structural reasons normal users can't edit this page. If you found any errors on this page please contact )
Line 8: Line 8:
 
::<code><nowiki>Execute[Join[{"f_{1} = 1", "f_{2} = 1"}, Sequence["f_{"+(i + 2) + "} = f_{" + (i+1) + "} + f_{"+ i +"}", i, 1, 10]]]</nowiki></code> creates first 10 elements of [[w:Fibonacci sequence|Fibonacci sequence]].}}
 
::<code><nowiki>Execute[Join[{"f_{1} = 1", "f_{2} = 1"}, Sequence["f_{"+(i + 2) + "} = f_{" + (i+1) + "} + f_{"+ i +"}", i, 1, 10]]]</nowiki></code> creates first 10 elements of [[w:Fibonacci sequence|Fibonacci sequence]].}}
  
;Execute[ <List of Texts>, <Parameter 1>, ... , <Parameter 9> ]
+
;Execute[ <List of Texts>, <Parameter>, ... , <Parameter> ]
:Replaces %1 for parameter 1, %2 for parameter 2 and so on in each text in list. Up to 9 parameters can be specified. After the replacement, resulting scripts are executed.
+
:Replaces %1 for the first parameter, %2 for the second parameter and so on in each text in list. Up to 9 parameters can be specified. After the replacement, resulting scripts are executed.
 
:{{example|1=<br><code>Execute[{"Midpoint[%1,%2]"},A,B]</code> creates midpoint of segment ''AB''.}}
 
:{{example|1=<br><code>Execute[{"Midpoint[%1,%2]"},A,B]</code> creates midpoint of segment ''AB''.}}
 
   
 
   
:{{note| 1=<div>Command names '''must be in English''' in the texts for this command to work</div>}}.
+
:{{note| 1=Command names '''must be in English''' in the texts for this command to work.}}

Revision as of 13:44, 19 April 2013



Execute[ <List of Texts> ]
Executes list of commands entered as texts.
Examples:
Execute[{"A=(1,1)","B=(3,3)","C = Midpoint[A, B]"}] creates points A, B and their midpoint C.

Execute[Join[{"f_{1} = 1", "f_{2} = 1"}, Sequence["f_{"+(i + 2) + "} = f_{" + (i+1) + "} + f_{"+ i +"}", i, 1, 10]]] creates first 10 elements of Fibonacci sequence.


Execute[ <List of Texts>, <Parameter>, ... , <Parameter> ]
Replaces %1 for the first parameter, %2 for the second parameter and so on in each text in list. Up to 9 parameters can be specified. After the replacement, resulting scripts are executed.
Example:
Execute[{"Midpoint[%1,%2]"},A,B] creates midpoint of segment AB.


Note: Command names must be in English in the texts for this command to work.
© 2024 International GeoGebra Institute