Save
This commit is contained in:
Submodule Convention/[FLEE] updated: 90828989ad...47b12f4bc0
@@ -3,25 +3,35 @@ using System;
|
|||||||
|
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
|
static class Test
|
||||||
|
{
|
||||||
|
public static object Func(object x)
|
||||||
|
{
|
||||||
|
Console.WriteLine(x);
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
RScriptEngine engine = new();
|
RScriptEngine engine = new();
|
||||||
RScriptImportClass import = new()
|
RScriptImportClass import = new()
|
||||||
{
|
{
|
||||||
typeof(Math),
|
typeof(Math),
|
||||||
|
typeof(ExpressionMath),
|
||||||
|
typeof(Test)
|
||||||
};
|
};
|
||||||
import.Add(typeof(ExpressionMath));
|
|
||||||
var result = engine.Run(@"
|
var result = engine.Run(@"
|
||||||
int i;
|
int i;
|
||||||
i = 2.2;
|
i = 2;
|
||||||
label(test);
|
label(test);
|
||||||
goto(true,func1);
|
goto(true,func1);
|
||||||
goto(100>i,test);
|
goto(100>i,test);
|
||||||
|
|
||||||
namespace(func1)
|
namespace(func1)
|
||||||
{
|
{
|
||||||
i = Pow(i,2.0);
|
i = Pow(i,2);
|
||||||
|
Func(i);
|
||||||
}
|
}
|
||||||
", import);
|
", import);
|
||||||
Console.WriteLine($"Script executed successfully. Result: {result["i"].data}");
|
Console.WriteLine($"Script executed successfully. Result: {result["i"].data}");
|
||||||
|
Reference in New Issue
Block a user