-
Jan 8th, 2000, 05:27 AM
#1
Thread Starter
Lively Member
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).]
-
Jan 8th, 2000, 06:09 AM
#2
Hyperactive Member
Make a textbox and say texttest.text = strtemp. then you'll know.
-
Jan 8th, 2000, 06:11 AM
#3
Thread Starter
Lively Member
I did but I keep getting compiler errors! In my code and don't know what is wrong!
-
Jan 8th, 2000, 06:34 AM
#4
Guru
if intCurpos = 0 then you will get an error in the InStr function
-
Jan 8th, 2000, 08:31 AM
#5
Thread Starter
Lively Member
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|