Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top