Difference between revisions of "Execute Command"

From GeoGebra Manual
Jump to: navigation, search
(:{{note| 1=If you need to use a quote (<code>"</code> then you can use <code>UnicodeToLetter(34)</code>}})
 
(16 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.0}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|scripting}}
{{command|scripting}}
+
;Execute( <List of Texts> )
;Execute[<List of Texts>]
 
 
:Executes list of commands entered as texts.
 
:Executes list of commands entered as texts.
 +
{{note|Please note that you always need to use English (US) commands within this list of texts, no matter which language option you selected for GeoGebra.}}
  
{{example|1=<div>
+
:{{Examples|1=<br>
* <code><nowiki>Execute[{"A=(1,1)","B=(3,3)","C=Midpoint[A,B]"}]</nowiki></code> creates points ''A, B'' and their midpoint ''C''.
+
:*<code><nowiki>Execute({"A=(1,1)","B=(3,3)","C = Midpoint(A, B)"})</nowiki></code> creates points ''A, B'' and their midpoint ''C''.<br><br>
* <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:Fibonaci sequence|Fibonaci sequence]].</div>}}
+
:*<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=<code>Execute[{"Midpoint[%1,%2]"},A,B}]</code> creates midpoint of segment ''AB''.}}
+
:{{example|1=<br><code>Execute({"Segment(%1,%2)","Midpoint(%1,%2)"}, A, B)</code> creates the segment ''AB'' and its midpoint.}}
 +
:{{note| 1=Command names '''must be in English (US)''' in the texts for this command to work.}}
 +
:{{note| 1=If you need to use a quote (<code>"</code>) then you can use <code>UnicodeToLetter(34)</code>}}

Latest revision as of 22:01, 5 May 2019


Execute( <List of Texts> )
Executes list of commands entered as texts.
Note: Please note that you always need to use English (US) commands within this list of texts, no matter which language option you selected for GeoGebra.
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({"Segment(%1,%2)","Midpoint(%1,%2)"}, A, B) creates the segment AB and its midpoint.
Note: Command names must be in English (US) in the texts for this command to work.
Note: If you need to use a quote (") then you can use UnicodeToLetter(34)
© 2024 International GeoGebra Institute