Difference between revisions of "ParseToNumber Command"

From GeoGebra Manual
Jump to: navigation, search
(moved comment to the syntax to notes)
(command syntax: changed [ ] into ( ))
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|scripting}}
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|scripting}}
;ParseToNumber[ <Number>, <String> ]
+
;ParseToNumber( <Number>, <String> )
 
:Parses the string and stores the result to a [[Numbers and Angles|number]] ''a'', which must be defined and [[Free, Dependent and Auxiliary Objects|free]] before the command is used.  
 
:Parses the string and stores the result to a [[Numbers and Angles|number]] ''a'', which must be defined and [[Free, Dependent and Auxiliary Objects|free]] before the command is used.  
:{{example|1=Define <code><nowiki> a = 3</nowiki></code> and <code><nowiki> text1 = "6"</nowiki></code>. <code><nowiki> ParseToNumber[a, text1]</nowiki></code> returns ''a = 6''.}}
+
:{{example|1=Define <code><nowiki> a = 3</nowiki></code> and <code><nowiki> text1 = "6"</nowiki></code>. <code><nowiki> ParseToNumber(a, text1)</nowiki></code> returns ''a = 6''.}}
 
{{notes|1=<div>
 
{{notes|1=<div>
:*This is a [[Scripting Commands|scripting command]] which only sets the value of a number once. To convert a text <i>text1</i> into a number which is updated dynamically, use [[FromBase Command|FromBase]][text1,10].
+
:*This is a [[Scripting Commands|scripting command]] which only sets the value of a number once. To convert a text <i>text1</i> into a number which is updated dynamically, use [[FromBase Command|FromBase]](text1,10).
 
:*See also [[ParseToFunction Command|ParseToFunction ]] command.</div> }}
 
:*See also [[ParseToFunction Command|ParseToFunction ]] command.</div> }}

Revision as of 07:58, 12 October 2017


ParseToNumber( <Number>, <String> )
Parses the string and stores the result to a number a, which must be defined and free before the command is used.
Example: Define a = 3 and text1 = "6". ParseToNumber(a, text1) returns a = 6.
Notes:
© 2024 International GeoGebra Institute