string res1 = "CalcAPI.GetXElementValue(" + "\"" + res[0] + "\"" + "," + "\"" + res[1] + "\"" + "," + false + ")"
の
res[0] = "IRS5555"
res[1] = "IRS001"
このコードの出力は次のとおりです。
CalcAPI.GetXElementValue("IRS5555","IRS001",False)
でも私はしたい
CalcAPI.GetXElementValue("IRS5555","IRS001",false)
false
小文字で。
完全なコードを提供していないことをお詫びします...falseは静的ではありません...
public static object GetElementDataType(string DataType)
{
///Write here methos for fetching data type of current element.
object res = null;
switch (DataType.ToLower())
{
case "int":
res = 0;
break;
case "double":
res = 0.0;
break;
case "string":
res = "";
break;
case "myboolean":
res = false;
break;
default:
res = "";
break;
}
return res;
}
string res1 =
"CalcAPI.GetXElementValue(" + "\"" + res[0] + "\"" + ","
+ "\"" + res[1] + "\"" + ","
+ GetElementDataType("myboolean") + ")"
結果は
CalcAPI.GetXElementValue("IRS5555","IRS001",False)
でも私はしたい
CalcAPI.GetXElementValue("IRS5555","IRS001",false)
ダブルパスすれば
string res1 = "CalcAPI.GetXElementValue(" + "\"" + res[0] + "\"" + "," + "\"" + res[1] + "\"" + "," + GetElementDataType("double") + ")"
結果は
CalcAPI.GetXElementValue("IRS5555","IRS001",0)
でも私はしたい
CalcAPI.GetXElementValue("IRS5555","IRS001",0.0)
文字列を渡すと
string res1 = "CalcAPI.GetXElementValue(" + "\"" + res[0] + "\"" + "," + "\"" + res[1] + "\"" + "," + GetElementDataType("string") + ")"
結果は
CalcAPI.GetXElementValue("IRS5555","IRS001",)
でも私はしたい
CalcAPI.GetXElementValue("IRS5555","IRS001","")