Page 1 of 1

Custom functions

Posted: Wed May 16, 2012 12:49 pm
by Lex Lavnikov
I need a custom function like this:

Change(string newText, string oldText)

which will just render HTML markup like this:

if (newText == oldText)
return newText;

return oldTextnewText

How can I implement something like this in Silverlight version?
I cannot find an interface point to register custom functions.

Using 2012.1 version

Custom functions

Posted: Thu May 17, 2012 7:19 am
by Alex K.
Hello,

You can add own function only in Client/Server version. In native it is not possible because native version has not compilation.
As a way you can use Conditions for this task.

Thank you.

Custom functions

Posted: Thu May 17, 2012 1:25 pm
by Lex Lavnikov
There is no need for compilation. Just provide an infrastructure to register custom functions like you do for built-in ones.

I've spent some time to see, how StiParser with StiAsm works, you just need to make it extendable, a dynamic list with custom functions (derived from your base class for example, specifying arguments types and count, result type), which programmer could derive from, implement custom logic and register them in some static class like StiFunction etc...

We could buy the source code and implement this on our own, but keeping this changes up-to-date with the evolving code is difficult. Anyway, this functional extensions could be a benefit for all customers of yours.

Custom functions

Posted: Fri May 18, 2012 8:23 am
by Alex K.
Hello,

On the current moment, the parser does not process any code, but only specific tasks. We had the attempt to do opportunity to realize the idea of ​​parsing of "any" function, but until now this feature is not implemented yet. We have added this problem to the to-do list with the highest priority, and try to implement it within the next release. There are currently no alternatives to solve your problem.

Thank you.