vassilych / cscs

CSCS: Customized Scripting in C#
MIT License
166 stars 47 forks source link

How to return List<Variables> ?? #40

Open michalss opened 7 months ago

michalss commented 7 months ago

HI,

arr=["a","b"];
sintra["List"]=arr;
sintra["ActionType"]="Extract";

Is there any equivalent in c# to return this exact format from : ParserFunction please ? I cannot make it work ... :( also i cannot return from ParserFunction List... Simply say i need to return back to cscs complex object from c#. Something similar to..

returnData=SomeFunction

print(returnData["type"]);  // this would be string
print(returnData["list"]); // this would be array

@vassilych

vassilych commented 7 months ago

Hi, you always return a Variable from anywhere.... Then you can take a look at Variable type and its fields, e.g. what list it has inside...

michalss commented 7 months ago

well i sped 8h to found out how to do it, but i was not able to do it. can you please give me sample ?