|
-
Oct 27th, 2001, 12:53 AM
#4
I wonder how many charact
My guess would be that you would have to search for '(' and assign all text from that operator until you reach the closing brace.
dim e() as string
dim d() as double
inputstring = "5*(6+(3+9))+3"
'search for high priorites ()
'when found substract string from original string
string e(1) = "3+9"
string e(2) = "6+"
'search from left hand side for middle priorites *,/,%
string e(3) = "5*"
'search from left hand side for low priorties
string e(4) = "+3"
calculate operations from e(1) to Ubound e
'parse thru each dimension of e, calculate, and assign to numeric variable d.
d(1) = 12
d(2) = 18
d(3) = 90
d(4) = 93
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
|