Files
Convention-CSharp/[Test]/Program.cs

28 lines
511 B
C#
Raw Normal View History

using Convention.RScript;
using Flee.PublicTypes;
using System;
2025-06-13 10:52:21 +08:00
public class Program
{
static void Main(string[] args)
{
RScriptEngine engine = new();
RScriptImportClass import = new()
{
typeof(Math)
};
var result = engine.Run(@"
double i;
i = 2.0;
label(test);
2025-10-16 00:39:45 +08:00
goto(true,func1);
goto(100>i,test);
2025-10-10 18:01:38 +08:00
2025-10-16 00:39:45 +08:00
namespace(func1)
2025-10-10 18:01:38 +08:00
{
i = Pow(i,2.0);
}
", import);
2025-10-16 00:39:45 +08:00
Console.WriteLine($"Script executed successfully. Result: {result["i"].data}");
2025-06-13 10:52:21 +08:00
}
}