quote:
Originally posted by Montago
Next - how do i EVAL the piece ??
like exactly like you just said: use the Eval() function in the replace.
quote:
Originally posted by Montago
and i recall that the function would only process one math piece ?
the replace can replace all occuring findstrings.
Search the forum for "calc", there are already a few threads about calculating expressions. So to avoid repeating everything which has been said already in other threads, search forums first and you'll find similar threads..
- calculating with eval(). eg:
CookieRevised's reply to An idea for a script
- one which explanes how the Replace method actually works (instead of "$1" as replacement string, you can use a function as a replacement string. This is what makes Replace so powerfull and which makes it possible to use Eval for example directly in your replace method. eg:
CookieRevised's reply to [Question] Isn't string.replace supposed to replace all occurences ?
(^^ explains the replace function)
CookieRevised's reply to Replace Colour Codes
(^^ shows an example for replace using a function as replace text)
CookieRevised's reply to [I help them] VB2JS
(^^ shows an example for replace using a function as replace text)
- one which uses a complex algorithm instead of eval() to calculate almost all possible expressions (eval() is rather limited). eg:
[?] Pow... err, triggering some function on certain convo events?
- etc...