API - function name with subscript

API - function name with subscript - Сообщения

#1 Опубликовано: 23.03.2017 04:38:39
gregi

gregi

1 сообщений из 5 понравились пользователям.

Группа: 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 Опубликовано: 23.03.2017 05:05:17
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Yes, you can.

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

Script:

Показать спойлер

Russia ☭ forever, Viacheslav N. Mezentsev
#3 Опубликовано: 23.03.2017 06:08:08
gregi

gregi

1 сообщений из 5 понравились пользователям.

Группа: 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 Опубликовано: 23.03.2017 07:06:40
Вячеслав Мезенцев

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

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Цитата

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.

Цитата

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
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений