I want to retrieve and print each variable name from the parameters passed in a class. (My expression may not be clear enough, please refer to the comments in the code)
I searched for relevant information on Google and the suggestion I got was to use the callstack! However, I haven't been able to implement it yet. There might be a simpler method
I previously had a similar feature request in QM, but it was not resolved.
Thank you in advance for any suggestions and Help
David
I searched for relevant information on Google and the suggestion I got was to use the callstack! However, I haven't been able to implement it yet. There might be a simpler method
I previously had a similar feature request in QM, but it was not resolved.
Thank you in advance for any suggestions and Help
David
// script "ClassA_Test.cs"
/*/ role exeProgram; outputPath %folders.Desktop%\ClassA; c ClassA.cs; /*/ //.
script.setup(trayIcon: true, sleepExit: true);
//..
string inp = "Hi";
string S1 = "hello world";
int I1 = 888;
string[] AS1 = { "hello", "world" };
ClassA.FuncA(inp, S1, I1, AS1);
// class "ClassA.cs"
public class ClassA
{
public static void FuncA(string inp, params object[] args)
{
print.it(inp);
//Get the variable name passed as an argument to a function
print.it($"fist Arg variable name: ?"); // ? -> It should output S1
print.it($"Second Arg variable name: ??"); // ?? -> It should output I1
print.it($"Third Arg variable name: ???"); // ??? -> It should output AS1
}
}