0

I would like to make a function which would allow me to pass a string in the argument - what's the best way to do this?

eg.. Moles("Ca(OH)2")

Any help would be extremely gratefully received.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Chris
  • 2,727
  • 2
  • 27
  • 28

1 Answers1

1

I ended up putting this in by parsing strings as variables. So for DDMathParser:

someFunction("Hello")

... is equivalent to:

someFunction($Hello)

However, this means you can have variables now with more complex stuff:

someFunction("Hello world")
Moles("Ca(OH)2")

... etc

Dave DeLong
  • 242,470
  • 58
  • 448
  • 498