04-29-2008, 10:57 AM
I tried this from QB > C. i made it do this:
the only error is that it searches from left to right so for:
  (5^5)^5
it returns:
  (pow( 5, 5) )pow( ,5)
but for something like this:
  5^5
it returns:
  pow(5,5)
it should look from the inside brackets to the outside brackets but i don't know how to do that.
  LPG Â
  Â
- put spaces between expressions and operators
- find the ^
- search left until it finds a space. if it sees a ) forget spaces until it comes to a (
- put "pow(" in
- do the same going right but add ")"
- put spaces in again
the only error is that it searches from left to right so for:
  (5^5)^5
it returns:
  (pow( 5, 5) )pow( ,5)
but for something like this:
  5^5
it returns:
  pow(5,5)
it should look from the inside brackets to the outside brackets but i don't know how to do that.
  LPG Â
  Â
WHILE RPG$ <> "complete" : make up silly excuses :WEND