Page 1 of 1

Calculate inside textbox

Posted: Tue Feb 20, 2018 3:18 am
by ALD Automotive
Hello,
Is is possible calculate inside textbox?
Examlpe:

Code: Select all

$a = $textbox1.text
$b=$textbox2.text
$result= $a+$b
$resultTextbox.text = $result
If i wtite at textbox1 - "5" and textbox2 - "5" as result i receive "10"
But i want write at textbox1 "5+1" and textbox2 - "5" and as result receive "11"
Is it possible?

Re: Calculate inside textbox

Posted: Tue Feb 20, 2018 4:24 am
by jvierra
It is possible to evaluate a string.

$s = '5 * 2 + 3'
Invoke-Expression $s

Re: Calculate inside textbox

Posted: Tue Feb 20, 2018 4:44 am
by ALD Automotive
Thank you very much!