Home All Groups Group Topic Archive Search About
Author
11 Oct 2006 11:50 PM
Jeff Dillon
Granted this question is for a take-home pre-screening interview question.
No rules against using the newsgroups!

I need to take an input string like (4 * (5 + 6.7) - 81 /  9) and calculate
the result.

I was thinking of using reflection or similar to actually let VB do the
work, like an execute.indirect statement:

dim  result as double = <execute.indirect(sInput)>

Any thoughts? Otherwise, I guess I'll have to implement a stack

Jeff

Author
12 Oct 2006 12:39 AM
Herfried K. Wagner [MVP]
"Jeff Dillon" <jeffdil***@hotmail.com> schrieb:
> I need to take an input string like (4 * (5 + 6.7) - 81 /  9) and
> calculate the result.
>
> I was thinking of using reflection or similar to actually let VB do the
> work, like an execute.indirect statement:

See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/60cde209714dfbb0>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>