<https://www.autoitscript.com/forum/topic/157116-creating-a-simple-script-engine-with-autoit/#comment-1138783>
<http://schema.org/text>
"I am trying to do something very similar in one of my scripts, \nI like how jdelaney went about it but for what I am doing I cannot declare the variables before. \nI came up with this real quick and it works for what you are trying to do, \nthere are a couple ways you could improve it because right now it will confuse similar variable names ex. ABC and ABCD \nI can think of a couple ways of fixing this but i think you can figure it out  \n\n#include &lt;Array.au3&gt;\n\nDim $TestScript = 'ABC = 456' &amp; @CRLF &amp; _\n\t\t\t\t  'DEF = \"this is a test\" &amp; ABC + 123' &amp; @CRLF &amp; _\n\t\t\t\t  'myVar =  1 + -5 * 8 / 7 - 5  &amp; \"test\" &amp;  -1 - -10  &amp; \"help!!!\"' &amp; @CRLF &amp; _\n\t\t\t\t  'Func = 456' &amp; @CRLF\n\nProcessScript($TestScript)\n\nFunc ProcessScript($hScript)\n\tLocal $hSplit = StringSplit($hScript, @CRLF, 1)\n\tLocal $Variables[1] = [0], $Data[1] = [0]\n\tFor $i = 1 to $hSplit[0] Step 1\n\t\tLocal $aString\n\t\t$aString = StringRegExp($hSplit[$i],\"(.*)\\s=\\s(.*)\",3)\n\t\tIf IsArray($aString) Then\n\t\t\t_ArrayAdd($Variables, $aString[0])\n\t\t\t_ArrayAdd($Data, $aString[1])\n\t\t\t$Variables[0] += 1\n\t\t\t$Data[0] += 1\n\t\tEndIf\n\tNext\n\tFor $i = 1 to $Variables[0] Step 1\n\t\tConsoleWrite(\"+ Variable[\"&amp;$i&amp;\"] = \"&amp;$Variables[$i]&amp;@CRLF)\n\t\tConsoleWrite(\"&gt; Data[\"&amp;$i&amp;\"]     = \"&amp;$Data[$i]&amp;@CRLF)\n\tNext\n\tFor $i = 1 to $Data[0] Step 1\n\t\tLocal $ProcessData = $Data[$i]\n\t\tFor $c = 1 to $Variables[0] Step 1\n\t\t\tIf StringinStr($Data[$i], $Variables[$c]) Then\n\t\t\t\t$ProcessData = StringReplace($Data[$i], $Variables[$c], $Data[$c])\n\t\t\tEndIf\n\t\tNext\n\t\tConsoleWrite(\"- Processed Data[\"&amp;$i&amp;\"]     = \"&amp;Execute($ProcessData)&amp;@CRLF)\n\tNext\nEndFunc\n"
<https://www.autoitscript.com/forum/topic/157116-creating-a-simple-script-engine-with-autoit/?tab=comments#comment-1138783>