I want to implement a function to convert multiple lines of strings into multiple parameters
I created a member function str.CallCS
Currently, it only supports three lines of text (three parameters), but x.Call supports up to 10 parameters.
My method looks stupid
Is there a simpler and smarter solution?
PS: This function may not be suitable, but sometimes I need the requirement for multiple unknown numbers of parameters
Thanks in advance for any suggestions and help
david
Macro Test
Member function str.CallCS
I created a member function str.CallCS
Currently, it only supports three lines of text (three parameters), but x.Call supports up to 10 parameters.
My method looks stupid
,sel as.len
,,case 1 ret x.Call(_Fun as[0])
,,case 2 ret x.Call(_Fun as[0] as[1])
,,case 3 ret x.Call(_Fun as[0] as[1] as[2])
,,;......
Is there a simpler and smarter solution?
PS: This function may not be suitable, but sometimes I need the requirement for multiple unknown numbers of parameters
Thanks in advance for any suggestions and help
david
Macro Test
_s=
;using System;
;
;public class cla
;{
;,public static string Fun1(string str1)
;,{
;,,string result = str1;
;,,Console.WriteLine(result);
;,,return result;
;,}
;
;,public static string Fun2(string str1, string str2)
;,{
;,,string result = str1 + str2;
;,,Console.WriteLine(result);
;,,return result;
;,}
;
;,public static string Fun3(string str1, string str2, string str3)
;,{
;,,string result = str1 + str2 + str3;
;,,Console.WriteLine(result);
;,,return result;
;,}
;}
;1 arg
str args=
;first parameter
_s.CallCS("Fun1" args)
;2 args
args=
;first parameter
;second parameter
_s.CallCS("Fun2" args)
;3 args
args=
;first parameter
;second parameter
;Third parameter
_s.CallCS("Fun3" args)
Member function str.CallCS