Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline gregi  
#1 Posted : 23 March 2017 10:38:39(UTC)
gregi

Rank: Newbie

Groups: Registered
Joined: 20/02/2017(UTC)
Posts: 5
Poland

Was thanked: 1 time(s) in 1 post(s)
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 <subscript {c3} >. Can it be done?

Code:
        public static TermInfo GetTermInfo()
        {
            return new TermInfo(
                "ε.c3",
                TermType.Function,
                "ec3 value of concrete class.",
                FunctionSections.Unknown,
                true,
                new ArgumentInfo(ArgumentSections.Variable, true)
               );
        }

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline uni  
#2 Posted : 23 March 2017 11:05:17(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Yes, you can.

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

Script:
Russia ☭ forever
Viacheslav N. Mezentsev
Offline gregi  
#3 Posted : 23 March 2017 12:08:08(UTC)
gregi

Rank: Newbie

Groups: Registered
Joined: 20/02/2017(UTC)
Posts: 5
Poland

Was thanked: 1 time(s) in 1 post(s)
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.
Code:

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[]?
Offline uni  
#4 Posted : 23 March 2017 13:06:40(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
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
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.