Displaying function with substituted input value

This is a file with example commands and scripts on how to show function in x with substitution of x with variable slider n value and displaying the substitutions and output value of f(n)[br]Useful for showing to beginning students learning functions.
The Geogebra scripting in the button helps to set up all the objects needed to produced and displayed.[br]The essential commands relied upon were the text and list commands like TextToUnicode and UnicodeToText, FormulaText, Insert, Remove, RemoveUndefined.[br][br][br][b]Script for Enumerating Functions[/b][br]# function : f[br]f(x) = 2 x^2+x-1+1/x[br]# variable input n[br]n = 2[br]# InputBoxFunction for f[br]InputBoxFunction=InputBox(f)[br]SetCaption(InputBoxFunction,Text["Input f(x) ="])[br]#output textEnumFunction for enumerated function[br]#[br]#textFromFunction = FormulaText[f][br]textFromFunction = FormulaText[f][br]#[br]#L_r is to replace x with characters (n) [br]#L_r = {40, 110, 41}[br]#L_r is not being used, instead L_n is used[br]#[br]#L_n the unicode list representing value n in brackets ie. (n) value to replace x [br]# slider n value is being captured in text as textFormulaValue = Text["("+n+")"][br]textFormulaValue = Text["("+n+")"][br]#List of unicode characters representing functions L_n = TextToUnicode(textFormulaValue)[br]L_n = TextToUnicode(textFormulaValue)[br]#[br]#L_3 = TextToUnicode(textFromFunction)[br]L_3 = TextToUnicode(textFromFunction)[br]#[br]# L_4 to L_9 is used to replace x (Unicode value 120) with variable n as (n) value[br]# (n) in unicode is computed from L_n = TextToUnicode(textFormulaValue)[br]#L_4 = Remove(Insert(L_n, L_3, IndexOf(120, L_3)), {120})[br]#L_5 = Remove(Insert(L_n, L_4, IndexOf(120, L_4)), {120})[br]#L_6 = Remove(Insert(L_n, L_5, IndexOf(120, L_5)), {120})[br]#L_7 = Remove(Insert(L_n, L_6, IndexOf(120, L_6)), {120})[br]#L_8 = Remove(Insert(L_n, L_7, IndexOf(120, L_7)), {120})[br]#L_9 = Remove(Insert(L_n, L_8, IndexOf(120, L_8)), {120})[br]#L_{10} = RemoveUndefined({L_3, L_4, L_5, L_6, L_7,L_8,L_9})[br]#L_{11} = Element(L_{10}, Length(L_{10}))[br]#[br]L_4 = Remove(Insert(L_n, L_3, IndexOf(120, L_3)), {120})[br]L_5 = Remove(Insert(L_n, L_4, IndexOf(120, L_4)), {120})[br]L_6 = Remove(Insert(L_n, L_5, IndexOf(120, L_5)), {120})[br]L_7 = Remove(Insert(L_n, L_6, IndexOf(120, L_6)), {120})[br]L_8 = Remove(Insert(L_n, L_7, IndexOf(120, L_7)), {120})[br]L_9 = Remove(Insert(L_n, L_8, IndexOf(120, L_8)), {120})[br]L_{10} = RemoveUndefined({L_3, L_4, L_5, L_6, L_7,L_8,L_9})[br]L_{11} = Element(L_{10}, Length(L_{10}))[br]#output :[br]#textEnumFunction= FormulaText(UnicodeToText(L_{11}), true)[br]textEnumFunction= FormulaText(UnicodeToText(L_{11}), true)[br]#Texts textShowEnumeratedFunction and textShowFunction are manually done due to styling [br]#problem for f(x) for f to be non cursive[br]#Show point P (n, f(n))[br]P = (n, f(n))[br]

Information: Displaying function with substituted input value