API - function name with subscript

API - function name with subscript - Messages

#1 Posted: 3/23/2017 4:38:39 AM
gregi

gregi

1 likes in 5 posts.

Group: User

Hi!

My next question about Smath API is about function names. Is there any possibility to create function with subscript in its name?

Below I present some code which contains definition of function. I want to obtain function like: greek epsilon . Can it be done?

        public static TermInfo GetTermInfo()
        {
            return new TermInfo(
                "ε.c3",
                TermType.Function,
                "ec3 value of concrete class.",
                FunctionSections.Unknown,
                true,
                new ArgumentInfo(ArgumentSections.Variable, true)
               );
        }
#2 Posted: 3/23/2017 5:05:17 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Yes, you can.

2017-03-23_13-02-16.png

Script:

Show Spoiler

Russia ☭ forever, Viacheslav N. Mezentsev
#3 Posted: 3/23/2017 6:08:08 AM
gregi

gregi

1 likes in 5 posts.

Group: User

Thank you again - now I see that it can be done but your answer results in two more questions:
1) How are you including C# code in Smath region? Is it just print screen or real code in some type of region which is evaluating on fly? Looks like magic for me (in MathCAD it is impossible to do such things).
2) You are using Definition and Store classes. During searching in example plugins I found that there are used mainly in customizable controls. I am developing some sort of functions by implementing IPluginHandleEvaluation interface.

public TermInfo[] TermsHandled
{
    get
    {
        return this.termInfos;
    }
}

public void Initialize()
{
    this.assemblyInfos = new[]
    {
        new AssemblyInfo("SMath Studio", new Version(0, 98), new Guid("a37cba83-b69c-4c71-9992-55ff666763bd")
    };
    this.termInfos = new[]
    {
        Fck.GetTermInfo(),
        Fck_cube.GetTermInfo()
    };
}

//Example GetTermInfo function
public static TermInfo GetTermInfo()
{
    return new TermInfo(
        "Fck",
        TermType.Function,
        "Fck value of concrete class.",
        FunctionSections.Unknown,
        true,
        new ArgumentInfo(ArgumentSections.Variable, true)
        );
}

How to combine your solution (Store and Definition) with TermInfo[]?
#4 Posted: 3/23/2017 7:06:40 AM
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 likes in 1708 posts.

Group: Moderator

Quote

1) How are you including C# code in Smath region? Is it just print screen or real code in some type of region which is evaluating on fly? Looks like magic for me (in MathCAD it is impossible to do such things).


Yes, the code is executed on the fly. This is just a Script region.

Quote

2) You are using Definition and Store classes. During searching in example plugins I found that there are used mainly in customizable controls. I am developing some sort of functions by implementing IPluginHandleEvaluation interface.


This is features of Script region. In your case, you have to write it differently. I just showed that this will work.
Russia ☭ forever, Viacheslav N. Mezentsev
  • New Posts New Posts
  • No New Posts No New Posts