-
Here is the question!
ok if txtinput.text = 2+(4/(2*6))
would this statement return that the value of strtemp = (4/(2*6))
strCalc = txtInput.Text
intCurpos = InStr(intCurpos, "(", strCalc, vbTextCompare)
Do
intTempLastPar = intLastPar
intLastPar = InStr(intLastPar, ")", strCalc, vbTextCompare)
Loop Until InStr(intLastPar, ")", strCalc, vbTextCompare) = 0
strTemp = strCalc - Left$(strCalc, intCurpos - 1) - Right$(strCalc, intLastPar + 1)
MsgBox strTemp
[This message has been edited by ravcam (edited 01-08-2000).]
-
Make a textbox and say texttest.text = strtemp. then you'll know.
-
I did but I keep getting compiler errors! In my code and don't know what is wrong!
-
if intCurpos = 0 then you will get an error in the InStr function
-
Thank you Clunietp but that was not my problem but. I did find a way to to do it if anyone wants to compare this code to that above!
strCalc = txtInput.Text
intCurpos = InStr(intCurpos, strCalc, "(", vbTextCompare)
Do
intTempPar = intPar
intPar = InStr(intPar + 1, strCalc, ")", vbTextCompare)
Loop Until intPar = 0
strTemp = Mid(strCalc, intCurpos, intTempPar - intCurpos + 1)