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:
  1. $a = $textbox1.text
  2.  
  3. $b=$textbox2.text
  4.  
  5. $result= $a+$b
  6.  
  7. $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!