[{"data":1,"prerenderedAt":4692},["ShallowReactive",2],{"content-query-jTimY94iaL":3,"navigation":4345},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":7,"date":9,"body":10,"_type":4338,"_id":4339,"_source":4340,"_file":4341,"_stem":4342,"_extension":4343,"sitemap":4344},"/document/formula/custom-function","formula",false,"","カスタム関数","2014-05-28",{"type":11,"children":12,"toc":4310},"root",[13,21,36,259,278,288,294,304,316,324,335,394,400,405,497,502,575,580,585,590,687,692,697,815,820,859,864,869,906,918,1038,1043,1064,1214,1219,1346,1351,1356,1503,1508,1513,1543,1548,1561,1566,1571,1606,1611,1780,1785,1790,1919,1924,2003,2008,2013,2018,2023,2028,2041,2200,2205,2711,2716,2722,2727,2837,2842,2854,3071,3076,3081,3252,3263,3268,3286,3296,3313,3323,3328,3333,3337,3546,3551,3575,3580,3616,3626,3631,3636,3795,3808,3878,3884,3889,3894,3914,3920,3925,4111,4116,4187,4195,4205,4210,4216,4240,4250,4260,4266,4271,4304],{"type":14,"tag":15,"props":16,"children":18},"element","h2",{"id":17},"カスタム数式関数の追加",[19],{"type":20,"value":17},"text",{"type":14,"tag":22,"props":23,"children":24},"p",{},[25,27,34],{"type":20,"value":26},"カスタム関数を追加するには、",{"type":14,"tag":28,"props":29,"children":31},"code",{"className":30},[],[32],{"type":20,"value":33},"FormulaExtension",{"type":20,"value":35},"クラスを使用します。以下の例では、指定された文字列を大文字に変換する関数を追加します。",{"type":14,"tag":37,"props":38,"children":42},"pre",{"className":39,"code":40,"language":41,"meta":7,"style":7},"language-cs shiki shiki-themes github-light github-dark github-light","unvell.ReoGrid.Formula.FormulaExtension.CustomFunctions[\"myUpper\"] =\n  (cell, args) =>\n  {\n    if (args.Length == 0)\n    {\n      // this function needs at least one argument\n      return null;\n    }\n\n    return Convert.ToString(args[0]).ToUpper();\n  };\n","cs",[43],{"type":14,"tag":28,"props":44,"children":45},{"__ignoreMap":7},[46,75,110,119,149,158,168,187,196,206,250],{"type":14,"tag":47,"props":48,"children":51},"span",{"class":49,"line":50},"line",1,[52,58,64,69],{"type":14,"tag":47,"props":53,"children":55},{"style":54},"--shiki-light:#24292E;--shiki-dark:#E1E4E8;--shiki-default:#24292E",[56],{"type":20,"value":57},"unvell.ReoGrid.Formula.FormulaExtension.CustomFunctions[",{"type":14,"tag":47,"props":59,"children":61},{"style":60},"--shiki-light:#032F62;--shiki-dark:#9ECBFF;--shiki-default:#032F62",[62],{"type":20,"value":63},"\"myUpper\"",{"type":14,"tag":47,"props":65,"children":66},{"style":54},[67],{"type":20,"value":68},"] ",{"type":14,"tag":47,"props":70,"children":72},{"style":71},"--shiki-light:#D73A49;--shiki-dark:#F97583;--shiki-default:#D73A49",[73],{"type":20,"value":74},"=\n",{"type":14,"tag":47,"props":76,"children":78},{"class":49,"line":77},2,[79,84,90,95,100,105],{"type":14,"tag":47,"props":80,"children":81},{"style":54},[82],{"type":20,"value":83},"  (",{"type":14,"tag":47,"props":85,"children":87},{"style":86},"--shiki-light:#6F42C1;--shiki-dark:#B392F0;--shiki-default:#6F42C1",[88],{"type":20,"value":89},"cell",{"type":14,"tag":47,"props":91,"children":92},{"style":54},[93],{"type":20,"value":94},", ",{"type":14,"tag":47,"props":96,"children":97},{"style":86},[98],{"type":20,"value":99},"args",{"type":14,"tag":47,"props":101,"children":102},{"style":54},[103],{"type":20,"value":104},") ",{"type":14,"tag":47,"props":106,"children":107},{"style":71},[108],{"type":20,"value":109},"=>\n",{"type":14,"tag":47,"props":111,"children":113},{"class":49,"line":112},3,[114],{"type":14,"tag":47,"props":115,"children":116},{"style":54},[117],{"type":20,"value":118},"  {\n",{"type":14,"tag":47,"props":120,"children":122},{"class":49,"line":121},4,[123,128,133,138,144],{"type":14,"tag":47,"props":124,"children":125},{"style":71},[126],{"type":20,"value":127},"    if",{"type":14,"tag":47,"props":129,"children":130},{"style":54},[131],{"type":20,"value":132}," (args.Length ",{"type":14,"tag":47,"props":134,"children":135},{"style":71},[136],{"type":20,"value":137},"==",{"type":14,"tag":47,"props":139,"children":141},{"style":140},"--shiki-light:#005CC5;--shiki-dark:#79B8FF;--shiki-default:#005CC5",[142],{"type":20,"value":143}," 0",{"type":14,"tag":47,"props":145,"children":146},{"style":54},[147],{"type":20,"value":148},")\n",{"type":14,"tag":47,"props":150,"children":152},{"class":49,"line":151},5,[153],{"type":14,"tag":47,"props":154,"children":155},{"style":54},[156],{"type":20,"value":157},"    {\n",{"type":14,"tag":47,"props":159,"children":161},{"class":49,"line":160},6,[162],{"type":14,"tag":47,"props":163,"children":165},{"style":164},"--shiki-light:#6A737D;--shiki-dark:#6A737D;--shiki-default:#6A737D",[166],{"type":20,"value":167},"      // this function needs at least one argument\n",{"type":14,"tag":47,"props":169,"children":171},{"class":49,"line":170},7,[172,177,182],{"type":14,"tag":47,"props":173,"children":174},{"style":71},[175],{"type":20,"value":176},"      return",{"type":14,"tag":47,"props":178,"children":179},{"style":140},[180],{"type":20,"value":181}," null",{"type":14,"tag":47,"props":183,"children":184},{"style":54},[185],{"type":20,"value":186},";\n",{"type":14,"tag":47,"props":188,"children":190},{"class":49,"line":189},8,[191],{"type":14,"tag":47,"props":192,"children":193},{"style":54},[194],{"type":20,"value":195},"    }\n",{"type":14,"tag":47,"props":197,"children":199},{"class":49,"line":198},9,[200],{"type":14,"tag":47,"props":201,"children":203},{"emptyLinePlaceholder":202},true,[204],{"type":20,"value":205},"\n",{"type":14,"tag":47,"props":207,"children":209},{"class":49,"line":208},10,[210,215,220,225,230,235,240,245],{"type":14,"tag":47,"props":211,"children":212},{"style":71},[213],{"type":20,"value":214},"    return",{"type":14,"tag":47,"props":216,"children":217},{"style":54},[218],{"type":20,"value":219}," Convert.",{"type":14,"tag":47,"props":221,"children":222},{"style":86},[223],{"type":20,"value":224},"ToString",{"type":14,"tag":47,"props":226,"children":227},{"style":54},[228],{"type":20,"value":229},"(args[",{"type":14,"tag":47,"props":231,"children":232},{"style":140},[233],{"type":20,"value":234},"0",{"type":14,"tag":47,"props":236,"children":237},{"style":54},[238],{"type":20,"value":239},"]).",{"type":14,"tag":47,"props":241,"children":242},{"style":86},[243],{"type":20,"value":244},"ToUpper",{"type":14,"tag":47,"props":246,"children":247},{"style":54},[248],{"type":20,"value":249},"();\n",{"type":14,"tag":47,"props":251,"children":253},{"class":49,"line":252},11,[254],{"type":14,"tag":47,"props":255,"children":256},{"style":54},[257],{"type":20,"value":258},"  };\n",{"type":14,"tag":22,"props":260,"children":261},{},[262,264,270,272],{"type":20,"value":263},"数式",{"type":14,"tag":28,"props":265,"children":267},{"className":266},[],[268],{"type":20,"value":269},"=myUpper(\"hello\")",{"type":20,"value":271},"を入力してこの関数をテストします。 ",{"type":14,"tag":273,"props":274,"children":277},"img",{"alt":275,"src":276},"169","/document/images/169.png",[],{"type":14,"tag":22,"props":279,"children":280},{},[281,283],{"type":20,"value":282},"Enterを押すと、セルの値が大文字に変換されます。 ",{"type":14,"tag":273,"props":284,"children":287},{"alt":285,"src":286},"170","/document/images/170.png",[],{"type":14,"tag":15,"props":289,"children":291},{"id":290},"formulaextensionについて",[292],{"type":20,"value":293},"FormulaExtensionについて",{"type":14,"tag":22,"props":295,"children":296},{},[297,302],{"type":14,"tag":28,"props":298,"children":300},{"className":299},[],[301],{"type":20,"value":33},{"type":20,"value":303},"は、数式計算中に拡張機能を追加するためのインターフェースです。",{"type":14,"tag":22,"props":305,"children":306},{},[307,309,314],{"type":20,"value":308},"スクリプト実行機能を持つReoGrid拡張版では、ReoScriptの機能を使用して数式拡張を実装できます。ReoGridの標準版を使用するアプリケーションでは、",{"type":14,"tag":28,"props":310,"children":312},{"className":311},[],[313],{"type":20,"value":33},{"type":20,"value":315},"インターフェースが数式拡張機能を実装するより簡単な方法です。",{"type":14,"tag":22,"props":317,"children":318},{},[319],{"type":14,"tag":273,"props":320,"children":323},{"alt":321,"src":322},"177","/document/images/177.png",[],{"type":14,"tag":22,"props":325,"children":326},{},[327,333],{"type":14,"tag":28,"props":328,"children":330},{"className":329},[],[331],{"type":20,"value":332},"CustomFunctions",{"type":20,"value":334},"プロパティは以下のように定義されています。",{"type":14,"tag":37,"props":336,"children":338},{"className":39,"code":337,"language":41,"meta":7,"style":7},"Dictionary\u003Cstring, Func\u003CReoGridCell, object[], object>> CustomFunctions\n",[339],{"type":14,"tag":28,"props":340,"children":341},{"__ignoreMap":7},[342],{"type":14,"tag":47,"props":343,"children":344},{"class":49,"line":50},[345,350,355,360,365,369,374,379,384,389],{"type":14,"tag":47,"props":346,"children":347},{"style":54},[348],{"type":20,"value":349},"Dictionary",{"type":14,"tag":47,"props":351,"children":352},{"style":71},[353],{"type":20,"value":354},"\u003C",{"type":14,"tag":47,"props":356,"children":357},{"style":71},[358],{"type":20,"value":359},"string",{"type":14,"tag":47,"props":361,"children":362},{"style":54},[363],{"type":20,"value":364},", Func",{"type":14,"tag":47,"props":366,"children":367},{"style":71},[368],{"type":20,"value":354},{"type":14,"tag":47,"props":370,"children":371},{"style":54},[372],{"type":20,"value":373},"ReoGridCell, ",{"type":14,"tag":47,"props":375,"children":376},{"style":71},[377],{"type":20,"value":378},"object",{"type":14,"tag":47,"props":380,"children":381},{"style":54},[382],{"type":20,"value":383},"[], ",{"type":14,"tag":47,"props":385,"children":386},{"style":71},[387],{"type":20,"value":388},"object>>",{"type":14,"tag":47,"props":390,"children":391},{"style":54},[392],{"type":20,"value":393}," CustomFunctions\n",{"type":14,"tag":395,"props":396,"children":398},"h3",{"id":397},"最も簡単な関数の例",[399],{"type":20,"value":397},{"type":14,"tag":22,"props":401,"children":402},{},[403],{"type":20,"value":404},"C#:",{"type":14,"tag":37,"props":406,"children":408},{"className":39,"code":407,"language":41,"meta":7,"style":7},"FormulaExtension.CustomFunctions[\"myFunc\"] = (cell, args) => {\n  // function body goes here\n  return null;\n};\n",[409],{"type":14,"tag":28,"props":410,"children":411},{"__ignoreMap":7},[412,465,473,489],{"type":14,"tag":47,"props":413,"children":414},{"class":49,"line":50},[415,420,425,429,434,439,443,447,451,455,460],{"type":14,"tag":47,"props":416,"children":417},{"style":54},[418],{"type":20,"value":419},"FormulaExtension.CustomFunctions[",{"type":14,"tag":47,"props":421,"children":422},{"style":60},[423],{"type":20,"value":424},"\"myFunc\"",{"type":14,"tag":47,"props":426,"children":427},{"style":54},[428],{"type":20,"value":68},{"type":14,"tag":47,"props":430,"children":431},{"style":71},[432],{"type":20,"value":433},"=",{"type":14,"tag":47,"props":435,"children":436},{"style":54},[437],{"type":20,"value":438}," (",{"type":14,"tag":47,"props":440,"children":441},{"style":86},[442],{"type":20,"value":89},{"type":14,"tag":47,"props":444,"children":445},{"style":54},[446],{"type":20,"value":94},{"type":14,"tag":47,"props":448,"children":449},{"style":86},[450],{"type":20,"value":99},{"type":14,"tag":47,"props":452,"children":453},{"style":54},[454],{"type":20,"value":104},{"type":14,"tag":47,"props":456,"children":457},{"style":71},[458],{"type":20,"value":459},"=>",{"type":14,"tag":47,"props":461,"children":462},{"style":54},[463],{"type":20,"value":464}," {\n",{"type":14,"tag":47,"props":466,"children":467},{"class":49,"line":77},[468],{"type":14,"tag":47,"props":469,"children":470},{"style":164},[471],{"type":20,"value":472},"  // function body goes here\n",{"type":14,"tag":47,"props":474,"children":475},{"class":49,"line":112},[476,481,485],{"type":14,"tag":47,"props":477,"children":478},{"style":71},[479],{"type":20,"value":480},"  return",{"type":14,"tag":47,"props":482,"children":483},{"style":140},[484],{"type":20,"value":181},{"type":14,"tag":47,"props":486,"children":487},{"style":54},[488],{"type":20,"value":186},{"type":14,"tag":47,"props":490,"children":491},{"class":49,"line":121},[492],{"type":14,"tag":47,"props":493,"children":494},{"style":54},[495],{"type":20,"value":496},"};\n",{"type":14,"tag":22,"props":498,"children":499},{},[500],{"type":20,"value":501},"VB.NET:",{"type":14,"tag":37,"props":503,"children":507},{"className":504,"code":505,"language":506,"meta":7,"style":7},"language-vb shiki shiki-themes github-light github-dark github-light","FormulaExtension.CustomFunctions(\"myFunc\") = Function(cell, args)\n    ' function body goes here\n    Return Nothing\nEnd Function\n","vb",[508],{"type":14,"tag":28,"props":509,"children":510},{"__ignoreMap":7},[511,546,554,567],{"type":14,"tag":47,"props":512,"children":513},{"class":49,"line":50},[514,519,523,528,532,536,541],{"type":14,"tag":47,"props":515,"children":516},{"style":54},[517],{"type":20,"value":518},"FormulaExtension.",{"type":14,"tag":47,"props":520,"children":521},{"style":86},[522],{"type":20,"value":332},{"type":14,"tag":47,"props":524,"children":525},{"style":54},[526],{"type":20,"value":527},"(",{"type":14,"tag":47,"props":529,"children":530},{"style":60},[531],{"type":20,"value":424},{"type":14,"tag":47,"props":533,"children":534},{"style":54},[535],{"type":20,"value":104},{"type":14,"tag":47,"props":537,"children":538},{"style":71},[539],{"type":20,"value":540},"= Function",{"type":14,"tag":47,"props":542,"children":543},{"style":54},[544],{"type":20,"value":545},"(cell, args)\n",{"type":14,"tag":47,"props":547,"children":548},{"class":49,"line":77},[549],{"type":14,"tag":47,"props":550,"children":551},{"style":164},[552],{"type":20,"value":553},"    ' function body goes here\n",{"type":14,"tag":47,"props":555,"children":556},{"class":49,"line":112},[557,562],{"type":14,"tag":47,"props":558,"children":559},{"style":71},[560],{"type":20,"value":561},"    Return",{"type":14,"tag":47,"props":563,"children":564},{"style":140},[565],{"type":20,"value":566}," Nothing\n",{"type":14,"tag":47,"props":568,"children":569},{"class":49,"line":121},[570],{"type":14,"tag":47,"props":571,"children":572},{"style":71},[573],{"type":20,"value":574},"End Function\n",{"type":14,"tag":395,"props":576,"children":578},{"id":577},"デリゲート関数の使用",[579],{"type":20,"value":577},{"type":14,"tag":22,"props":581,"children":582},{},[583],{"type":20,"value":584},"ラムダ式の代わりに通常のデリゲート関数を使用することもできます。関数を定義するには：",{"type":14,"tag":22,"props":586,"children":587},{},[588],{"type":20,"value":589},"C#",{"type":14,"tag":37,"props":591,"children":593},{"className":39,"code":592,"language":41,"meta":7,"style":7},"static object MyFunc(ReoGridCell cell, params object[] arguments)\n{\n  return null;\n}\n",[594],{"type":14,"tag":28,"props":595,"children":596},{"__ignoreMap":7},[597,656,664,679],{"type":14,"tag":47,"props":598,"children":599},{"class":49,"line":50},[600,605,610,615,619,624,629,633,638,642,647,652],{"type":14,"tag":47,"props":601,"children":602},{"style":71},[603],{"type":20,"value":604},"static",{"type":14,"tag":47,"props":606,"children":607},{"style":71},[608],{"type":20,"value":609}," object",{"type":14,"tag":47,"props":611,"children":612},{"style":86},[613],{"type":20,"value":614}," MyFunc",{"type":14,"tag":47,"props":616,"children":617},{"style":54},[618],{"type":20,"value":527},{"type":14,"tag":47,"props":620,"children":621},{"style":86},[622],{"type":20,"value":623},"ReoGridCell",{"type":14,"tag":47,"props":625,"children":626},{"style":86},[627],{"type":20,"value":628}," cell",{"type":14,"tag":47,"props":630,"children":631},{"style":54},[632],{"type":20,"value":94},{"type":14,"tag":47,"props":634,"children":635},{"style":71},[636],{"type":20,"value":637},"params",{"type":14,"tag":47,"props":639,"children":640},{"style":71},[641],{"type":20,"value":609},{"type":14,"tag":47,"props":643,"children":644},{"style":54},[645],{"type":20,"value":646},"[] ",{"type":14,"tag":47,"props":648,"children":649},{"style":86},[650],{"type":20,"value":651},"arguments",{"type":14,"tag":47,"props":653,"children":654},{"style":54},[655],{"type":20,"value":148},{"type":14,"tag":47,"props":657,"children":658},{"class":49,"line":77},[659],{"type":14,"tag":47,"props":660,"children":661},{"style":54},[662],{"type":20,"value":663},"{\n",{"type":14,"tag":47,"props":665,"children":666},{"class":49,"line":112},[667,671,675],{"type":14,"tag":47,"props":668,"children":669},{"style":71},[670],{"type":20,"value":480},{"type":14,"tag":47,"props":672,"children":673},{"style":140},[674],{"type":20,"value":181},{"type":14,"tag":47,"props":676,"children":677},{"style":54},[678],{"type":20,"value":186},{"type":14,"tag":47,"props":680,"children":681},{"class":49,"line":121},[682],{"type":14,"tag":47,"props":683,"children":684},{"style":54},[685],{"type":20,"value":686},"}\n",{"type":14,"tag":22,"props":688,"children":689},{},[690],{"type":20,"value":691},"この静的メソッドをカスタム関数として数式で利用可能にするには：",{"type":14,"tag":22,"props":693,"children":694},{},[695],{"type":20,"value":696},"VB.NET",{"type":14,"tag":37,"props":698,"children":700},{"className":504,"code":699,"language":506,"meta":7,"style":7},"FormulaExtension.CustomFunctions[\"myFunc\"] = MyFunc;\n\nShared Function MyFunc(cell As ReoGridCell, ParamArray args As Object()) As Object\n  Return Nothing\nEnd Function\n",[701],{"type":14,"tag":28,"props":702,"children":703},{"__ignoreMap":7},[704,728,735,796,808],{"type":14,"tag":47,"props":705,"children":706},{"class":49,"line":50},[707,711,715,719,723],{"type":14,"tag":47,"props":708,"children":709},{"style":54},[710],{"type":20,"value":419},{"type":14,"tag":47,"props":712,"children":713},{"style":60},[714],{"type":20,"value":424},{"type":14,"tag":47,"props":716,"children":717},{"style":54},[718],{"type":20,"value":68},{"type":14,"tag":47,"props":720,"children":721},{"style":71},[722],{"type":20,"value":433},{"type":14,"tag":47,"props":724,"children":725},{"style":54},[726],{"type":20,"value":727}," MyFunc;\n",{"type":14,"tag":47,"props":729,"children":730},{"class":49,"line":77},[731],{"type":14,"tag":47,"props":732,"children":733},{"emptyLinePlaceholder":202},[734],{"type":20,"value":205},{"type":14,"tag":47,"props":736,"children":737},{"class":49,"line":112},[738,743,748,753,758,763,768,773,777,782,787,791],{"type":14,"tag":47,"props":739,"children":740},{"style":54},[741],{"type":20,"value":742},"Shared",{"type":14,"tag":47,"props":744,"children":745},{"style":71},[746],{"type":20,"value":747}," Function ",{"type":14,"tag":47,"props":749,"children":750},{"style":86},[751],{"type":20,"value":752},"MyFunc",{"type":14,"tag":47,"props":754,"children":755},{"style":54},[756],{"type":20,"value":757},"(cell ",{"type":14,"tag":47,"props":759,"children":760},{"style":71},[761],{"type":20,"value":762},"As",{"type":14,"tag":47,"props":764,"children":765},{"style":140},[766],{"type":20,"value":767}," ReoGridCell",{"type":14,"tag":47,"props":769,"children":770},{"style":54},[771],{"type":20,"value":772},", ParamArray args ",{"type":14,"tag":47,"props":774,"children":775},{"style":71},[776],{"type":20,"value":762},{"type":14,"tag":47,"props":778,"children":779},{"style":140},[780],{"type":20,"value":781}," Object",{"type":14,"tag":47,"props":783,"children":784},{"style":54},[785],{"type":20,"value":786},"()) ",{"type":14,"tag":47,"props":788,"children":789},{"style":71},[790],{"type":20,"value":762},{"type":14,"tag":47,"props":792,"children":793},{"style":140},[794],{"type":20,"value":795}," Object\n",{"type":14,"tag":47,"props":797,"children":798},{"class":49,"line":121},[799,804],{"type":14,"tag":47,"props":800,"children":801},{"style":71},[802],{"type":20,"value":803},"  Return",{"type":14,"tag":47,"props":805,"children":806},{"style":140},[807],{"type":20,"value":566},{"type":14,"tag":47,"props":809,"children":810},{"class":49,"line":151},[811],{"type":14,"tag":47,"props":812,"children":813},{"style":71},[814],{"type":20,"value":574},{"type":14,"tag":22,"props":816,"children":817},{},[818],{"type":20,"value":819},"この共有メソッドをカスタム関数として数式で利用可能にするには：",{"type":14,"tag":37,"props":821,"children":823},{"className":39,"code":822,"language":41,"meta":7,"style":7},"FormulaExtension.CustomFunctions(\"myFunc\") = AddressOf MyFunc\n",[824],{"type":14,"tag":28,"props":825,"children":826},{"__ignoreMap":7},[827],{"type":14,"tag":47,"props":828,"children":829},{"class":49,"line":50},[830,834,838,842,846,850,854],{"type":14,"tag":47,"props":831,"children":832},{"style":54},[833],{"type":20,"value":518},{"type":14,"tag":47,"props":835,"children":836},{"style":86},[837],{"type":20,"value":332},{"type":14,"tag":47,"props":839,"children":840},{"style":54},[841],{"type":20,"value":527},{"type":14,"tag":47,"props":843,"children":844},{"style":60},[845],{"type":20,"value":424},{"type":14,"tag":47,"props":847,"children":848},{"style":54},[849],{"type":20,"value":104},{"type":14,"tag":47,"props":851,"children":852},{"style":71},[853],{"type":20,"value":433},{"type":14,"tag":47,"props":855,"children":856},{"style":54},[857],{"type":20,"value":858}," AddressOf MyFunc\n",{"type":14,"tag":395,"props":860,"children":862},{"id":861},"セルインスタンス",[863],{"type":20,"value":861},{"type":14,"tag":22,"props":865,"children":866},{},[867],{"type":20,"value":868},"最初の引数は、数式を所有するセルインスタンスです。この関数は数式内から呼び出されます。例：",{"type":14,"tag":37,"props":870,"children":872},{"className":39,"code":871,"language":41,"meta":7,"style":7},"worksheet[\"A1\"] = \"=myFunc()\";\n",[873],{"type":14,"tag":28,"props":874,"children":875},{"__ignoreMap":7},[876],{"type":14,"tag":47,"props":877,"children":878},{"class":49,"line":50},[879,884,889,893,897,902],{"type":14,"tag":47,"props":880,"children":881},{"style":54},[882],{"type":20,"value":883},"worksheet[",{"type":14,"tag":47,"props":885,"children":886},{"style":60},[887],{"type":20,"value":888},"\"A1\"",{"type":14,"tag":47,"props":890,"children":891},{"style":54},[892],{"type":20,"value":68},{"type":14,"tag":47,"props":894,"children":895},{"style":71},[896],{"type":20,"value":433},{"type":14,"tag":47,"props":898,"children":899},{"style":60},[900],{"type":20,"value":901}," \"=myFunc()\"",{"type":14,"tag":47,"props":903,"children":904},{"style":54},[905],{"type":20,"value":186},{"type":14,"tag":22,"props":907,"children":908},{},[909,911,916],{"type":20,"value":910},"セルA1にはカスタム関数「myFunc」を呼び出す数式があります。上で定義した.NETの関数本体が呼び出され、",{"type":14,"tag":28,"props":912,"children":914},{"className":913},[],[915],{"type":20,"value":89},{"type":20,"value":917},"引数はA1セルになります。",{"type":14,"tag":37,"props":919,"children":921},{"className":39,"code":920,"language":41,"meta":7,"style":7},"static object MyFunc(ReoGridCell cell, params object[] arguments)\n{\n  MessageBox.Show(cell.Position.ToAddress());   // output: A1\n  return null;\n}\n",[922],{"type":14,"tag":28,"props":923,"children":924},{"__ignoreMap":7},[925,976,983,1016,1031],{"type":14,"tag":47,"props":926,"children":927},{"class":49,"line":50},[928,932,936,940,944,948,952,956,960,964,968,972],{"type":14,"tag":47,"props":929,"children":930},{"style":71},[931],{"type":20,"value":604},{"type":14,"tag":47,"props":933,"children":934},{"style":71},[935],{"type":20,"value":609},{"type":14,"tag":47,"props":937,"children":938},{"style":86},[939],{"type":20,"value":614},{"type":14,"tag":47,"props":941,"children":942},{"style":54},[943],{"type":20,"value":527},{"type":14,"tag":47,"props":945,"children":946},{"style":86},[947],{"type":20,"value":623},{"type":14,"tag":47,"props":949,"children":950},{"style":86},[951],{"type":20,"value":628},{"type":14,"tag":47,"props":953,"children":954},{"style":54},[955],{"type":20,"value":94},{"type":14,"tag":47,"props":957,"children":958},{"style":71},[959],{"type":20,"value":637},{"type":14,"tag":47,"props":961,"children":962},{"style":71},[963],{"type":20,"value":609},{"type":14,"tag":47,"props":965,"children":966},{"style":54},[967],{"type":20,"value":646},{"type":14,"tag":47,"props":969,"children":970},{"style":86},[971],{"type":20,"value":651},{"type":14,"tag":47,"props":973,"children":974},{"style":54},[975],{"type":20,"value":148},{"type":14,"tag":47,"props":977,"children":978},{"class":49,"line":77},[979],{"type":14,"tag":47,"props":980,"children":981},{"style":54},[982],{"type":20,"value":663},{"type":14,"tag":47,"props":984,"children":985},{"class":49,"line":112},[986,991,996,1001,1006,1011],{"type":14,"tag":47,"props":987,"children":988},{"style":54},[989],{"type":20,"value":990},"  MessageBox.",{"type":14,"tag":47,"props":992,"children":993},{"style":86},[994],{"type":20,"value":995},"Show",{"type":14,"tag":47,"props":997,"children":998},{"style":54},[999],{"type":20,"value":1000},"(cell.Position.",{"type":14,"tag":47,"props":1002,"children":1003},{"style":86},[1004],{"type":20,"value":1005},"ToAddress",{"type":14,"tag":47,"props":1007,"children":1008},{"style":54},[1009],{"type":20,"value":1010},"());   ",{"type":14,"tag":47,"props":1012,"children":1013},{"style":164},[1014],{"type":20,"value":1015},"// output: A1\n",{"type":14,"tag":47,"props":1017,"children":1018},{"class":49,"line":121},[1019,1023,1027],{"type":14,"tag":47,"props":1020,"children":1021},{"style":71},[1022],{"type":20,"value":480},{"type":14,"tag":47,"props":1024,"children":1025},{"style":140},[1026],{"type":20,"value":181},{"type":14,"tag":47,"props":1028,"children":1029},{"style":54},[1030],{"type":20,"value":186},{"type":14,"tag":47,"props":1032,"children":1033},{"class":49,"line":151},[1034],{"type":14,"tag":47,"props":1035,"children":1036},{"style":54},[1037],{"type":20,"value":686},{"type":14,"tag":395,"props":1039,"children":1041},{"id":1040},"関数からワークシートインスタンスを取得する",[1042],{"type":20,"value":1040},{"type":14,"tag":22,"props":1044,"children":1045},{},[1046,1048,1054,1056,1062],{"type":20,"value":1047},"セルインスタンスの",{"type":14,"tag":28,"props":1049,"children":1051},{"className":1050},[],[1052],{"type":20,"value":1053},"Worksheet",{"type":20,"value":1055},"プロパティにアクセスしてワークシートインスタンスを取得し、ワークシートインスタンスの",{"type":14,"tag":28,"props":1057,"children":1059},{"className":1058},[],[1060],{"type":20,"value":1061},"Workbook",{"type":20,"value":1063},"プロパティからワークブックを取得します。",{"type":14,"tag":37,"props":1065,"children":1067},{"className":39,"code":1066,"language":41,"meta":7,"style":7},"FormulaExtension.CustomFunctions[\"myFunc\"] = (cell, args) =>\n{\n  var worksheet = cell.Worksheet;\n  var workbook = worksheet.Workbook;\n\n  ...\n\n  return null;\n};\n",[1068],{"type":14,"tag":28,"props":1069,"children":1070},{"__ignoreMap":7},[1071,1114,1121,1144,1165,1172,1185,1192,1207],{"type":14,"tag":47,"props":1072,"children":1073},{"class":49,"line":50},[1074,1078,1082,1086,1090,1094,1098,1102,1106,1110],{"type":14,"tag":47,"props":1075,"children":1076},{"style":54},[1077],{"type":20,"value":419},{"type":14,"tag":47,"props":1079,"children":1080},{"style":60},[1081],{"type":20,"value":424},{"type":14,"tag":47,"props":1083,"children":1084},{"style":54},[1085],{"type":20,"value":68},{"type":14,"tag":47,"props":1087,"children":1088},{"style":71},[1089],{"type":20,"value":433},{"type":14,"tag":47,"props":1091,"children":1092},{"style":54},[1093],{"type":20,"value":438},{"type":14,"tag":47,"props":1095,"children":1096},{"style":86},[1097],{"type":20,"value":89},{"type":14,"tag":47,"props":1099,"children":1100},{"style":54},[1101],{"type":20,"value":94},{"type":14,"tag":47,"props":1103,"children":1104},{"style":86},[1105],{"type":20,"value":99},{"type":14,"tag":47,"props":1107,"children":1108},{"style":54},[1109],{"type":20,"value":104},{"type":14,"tag":47,"props":1111,"children":1112},{"style":71},[1113],{"type":20,"value":109},{"type":14,"tag":47,"props":1115,"children":1116},{"class":49,"line":77},[1117],{"type":14,"tag":47,"props":1118,"children":1119},{"style":54},[1120],{"type":20,"value":663},{"type":14,"tag":47,"props":1122,"children":1123},{"class":49,"line":112},[1124,1129,1134,1139],{"type":14,"tag":47,"props":1125,"children":1126},{"style":71},[1127],{"type":20,"value":1128},"  var",{"type":14,"tag":47,"props":1130,"children":1131},{"style":86},[1132],{"type":20,"value":1133}," worksheet",{"type":14,"tag":47,"props":1135,"children":1136},{"style":71},[1137],{"type":20,"value":1138}," =",{"type":14,"tag":47,"props":1140,"children":1141},{"style":54},[1142],{"type":20,"value":1143}," cell.Worksheet;\n",{"type":14,"tag":47,"props":1145,"children":1146},{"class":49,"line":121},[1147,1151,1156,1160],{"type":14,"tag":47,"props":1148,"children":1149},{"style":71},[1150],{"type":20,"value":1128},{"type":14,"tag":47,"props":1152,"children":1153},{"style":86},[1154],{"type":20,"value":1155}," workbook",{"type":14,"tag":47,"props":1157,"children":1158},{"style":71},[1159],{"type":20,"value":1138},{"type":14,"tag":47,"props":1161,"children":1162},{"style":54},[1163],{"type":20,"value":1164}," worksheet.Workbook;\n",{"type":14,"tag":47,"props":1166,"children":1167},{"class":49,"line":151},[1168],{"type":14,"tag":47,"props":1169,"children":1170},{"emptyLinePlaceholder":202},[1171],{"type":20,"value":205},{"type":14,"tag":47,"props":1173,"children":1174},{"class":49,"line":160},[1175,1180],{"type":14,"tag":47,"props":1176,"children":1177},{"style":71},[1178],{"type":20,"value":1179},"  ..",{"type":14,"tag":47,"props":1181,"children":1182},{"style":54},[1183],{"type":20,"value":1184},".\n",{"type":14,"tag":47,"props":1186,"children":1187},{"class":49,"line":170},[1188],{"type":14,"tag":47,"props":1189,"children":1190},{"emptyLinePlaceholder":202},[1191],{"type":20,"value":205},{"type":14,"tag":47,"props":1193,"children":1194},{"class":49,"line":189},[1195,1199,1203],{"type":14,"tag":47,"props":1196,"children":1197},{"style":71},[1198],{"type":20,"value":480},{"type":14,"tag":47,"props":1200,"children":1201},{"style":140},[1202],{"type":20,"value":181},{"type":14,"tag":47,"props":1204,"children":1205},{"style":54},[1206],{"type":20,"value":186},{"type":14,"tag":47,"props":1208,"children":1209},{"class":49,"line":198},[1210],{"type":14,"tag":47,"props":1211,"children":1212},{"style":54},[1213],{"type":20,"value":496},{"type":14,"tag":22,"props":1215,"children":1216},{},[1217],{"type":20,"value":1218},"関数のスコープを特定のワークブックまたはワークシートに制限します。",{"type":14,"tag":37,"props":1220,"children":1222},{"className":39,"code":1221,"language":41,"meta":7,"style":7},"{\n  var worksheet = cell.Worksheet;\n  var workbook = worksheet.Workbook;\n\n  if (workbook != myWorkbook)\n  {\n    // not in valid workbook scope\n    return null;\n  }\n}\n",[1223],{"type":14,"tag":28,"props":1224,"children":1225},{"__ignoreMap":7},[1226,1233,1252,1271,1278,1301,1308,1316,1331,1339],{"type":14,"tag":47,"props":1227,"children":1228},{"class":49,"line":50},[1229],{"type":14,"tag":47,"props":1230,"children":1231},{"style":54},[1232],{"type":20,"value":663},{"type":14,"tag":47,"props":1234,"children":1235},{"class":49,"line":77},[1236,1240,1244,1248],{"type":14,"tag":47,"props":1237,"children":1238},{"style":71},[1239],{"type":20,"value":1128},{"type":14,"tag":47,"props":1241,"children":1242},{"style":86},[1243],{"type":20,"value":1133},{"type":14,"tag":47,"props":1245,"children":1246},{"style":71},[1247],{"type":20,"value":1138},{"type":14,"tag":47,"props":1249,"children":1250},{"style":54},[1251],{"type":20,"value":1143},{"type":14,"tag":47,"props":1253,"children":1254},{"class":49,"line":112},[1255,1259,1263,1267],{"type":14,"tag":47,"props":1256,"children":1257},{"style":71},[1258],{"type":20,"value":1128},{"type":14,"tag":47,"props":1260,"children":1261},{"style":86},[1262],{"type":20,"value":1155},{"type":14,"tag":47,"props":1264,"children":1265},{"style":71},[1266],{"type":20,"value":1138},{"type":14,"tag":47,"props":1268,"children":1269},{"style":54},[1270],{"type":20,"value":1164},{"type":14,"tag":47,"props":1272,"children":1273},{"class":49,"line":121},[1274],{"type":14,"tag":47,"props":1275,"children":1276},{"emptyLinePlaceholder":202},[1277],{"type":20,"value":205},{"type":14,"tag":47,"props":1279,"children":1280},{"class":49,"line":151},[1281,1286,1291,1296],{"type":14,"tag":47,"props":1282,"children":1283},{"style":71},[1284],{"type":20,"value":1285},"  if",{"type":14,"tag":47,"props":1287,"children":1288},{"style":54},[1289],{"type":20,"value":1290}," (workbook ",{"type":14,"tag":47,"props":1292,"children":1293},{"style":71},[1294],{"type":20,"value":1295},"!=",{"type":14,"tag":47,"props":1297,"children":1298},{"style":54},[1299],{"type":20,"value":1300}," myWorkbook)\n",{"type":14,"tag":47,"props":1302,"children":1303},{"class":49,"line":160},[1304],{"type":14,"tag":47,"props":1305,"children":1306},{"style":54},[1307],{"type":20,"value":118},{"type":14,"tag":47,"props":1309,"children":1310},{"class":49,"line":170},[1311],{"type":14,"tag":47,"props":1312,"children":1313},{"style":164},[1314],{"type":20,"value":1315},"    // not in valid workbook scope\n",{"type":14,"tag":47,"props":1317,"children":1318},{"class":49,"line":189},[1319,1323,1327],{"type":14,"tag":47,"props":1320,"children":1321},{"style":71},[1322],{"type":20,"value":214},{"type":14,"tag":47,"props":1324,"children":1325},{"style":140},[1326],{"type":20,"value":181},{"type":14,"tag":47,"props":1328,"children":1329},{"style":54},[1330],{"type":20,"value":186},{"type":14,"tag":47,"props":1332,"children":1333},{"class":49,"line":198},[1334],{"type":14,"tag":47,"props":1335,"children":1336},{"style":54},[1337],{"type":20,"value":1338},"  }\n",{"type":14,"tag":47,"props":1340,"children":1341},{"class":49,"line":208},[1342],{"type":14,"tag":47,"props":1343,"children":1344},{"style":54},[1345],{"type":20,"value":686},{"type":14,"tag":395,"props":1347,"children":1349},{"id":1348},"関数の引数を取得する",[1350],{"type":20,"value":1348},{"type":14,"tag":22,"props":1352,"children":1353},{},[1354],{"type":20,"value":1355},"2番目の引数には、数式の呼び出し元から渡された引数が含まれます。",{"type":14,"tag":37,"props":1357,"children":1359},{"className":39,"code":1358,"language":41,"meta":7,"style":7},"FormulaExtension.CustomFunctions[\"myFunc\"] = (cell, args) =>\n{\n  if (args.Length \u003C 2)\n  {\n    // this function requires at least two arguments\n    return null;\n  }\n\n  return null;\n};\n",[1360],{"type":14,"tag":28,"props":1361,"children":1362},{"__ignoreMap":7},[1363,1406,1413,1437,1444,1452,1467,1474,1481,1496],{"type":14,"tag":47,"props":1364,"children":1365},{"class":49,"line":50},[1366,1370,1374,1378,1382,1386,1390,1394,1398,1402],{"type":14,"tag":47,"props":1367,"children":1368},{"style":54},[1369],{"type":20,"value":419},{"type":14,"tag":47,"props":1371,"children":1372},{"style":60},[1373],{"type":20,"value":424},{"type":14,"tag":47,"props":1375,"children":1376},{"style":54},[1377],{"type":20,"value":68},{"type":14,"tag":47,"props":1379,"children":1380},{"style":71},[1381],{"type":20,"value":433},{"type":14,"tag":47,"props":1383,"children":1384},{"style":54},[1385],{"type":20,"value":438},{"type":14,"tag":47,"props":1387,"children":1388},{"style":86},[1389],{"type":20,"value":89},{"type":14,"tag":47,"props":1391,"children":1392},{"style":54},[1393],{"type":20,"value":94},{"type":14,"tag":47,"props":1395,"children":1396},{"style":86},[1397],{"type":20,"value":99},{"type":14,"tag":47,"props":1399,"children":1400},{"style":54},[1401],{"type":20,"value":104},{"type":14,"tag":47,"props":1403,"children":1404},{"style":71},[1405],{"type":20,"value":109},{"type":14,"tag":47,"props":1407,"children":1408},{"class":49,"line":77},[1409],{"type":14,"tag":47,"props":1410,"children":1411},{"style":54},[1412],{"type":20,"value":663},{"type":14,"tag":47,"props":1414,"children":1415},{"class":49,"line":112},[1416,1420,1424,1428,1433],{"type":14,"tag":47,"props":1417,"children":1418},{"style":71},[1419],{"type":20,"value":1285},{"type":14,"tag":47,"props":1421,"children":1422},{"style":54},[1423],{"type":20,"value":132},{"type":14,"tag":47,"props":1425,"children":1426},{"style":71},[1427],{"type":20,"value":354},{"type":14,"tag":47,"props":1429,"children":1430},{"style":140},[1431],{"type":20,"value":1432}," 2",{"type":14,"tag":47,"props":1434,"children":1435},{"style":54},[1436],{"type":20,"value":148},{"type":14,"tag":47,"props":1438,"children":1439},{"class":49,"line":121},[1440],{"type":14,"tag":47,"props":1441,"children":1442},{"style":54},[1443],{"type":20,"value":118},{"type":14,"tag":47,"props":1445,"children":1446},{"class":49,"line":151},[1447],{"type":14,"tag":47,"props":1448,"children":1449},{"style":164},[1450],{"type":20,"value":1451},"    // this function requires at least two arguments\n",{"type":14,"tag":47,"props":1453,"children":1454},{"class":49,"line":160},[1455,1459,1463],{"type":14,"tag":47,"props":1456,"children":1457},{"style":71},[1458],{"type":20,"value":214},{"type":14,"tag":47,"props":1460,"children":1461},{"style":140},[1462],{"type":20,"value":181},{"type":14,"tag":47,"props":1464,"children":1465},{"style":54},[1466],{"type":20,"value":186},{"type":14,"tag":47,"props":1468,"children":1469},{"class":49,"line":170},[1470],{"type":14,"tag":47,"props":1471,"children":1472},{"style":54},[1473],{"type":20,"value":1338},{"type":14,"tag":47,"props":1475,"children":1476},{"class":49,"line":189},[1477],{"type":14,"tag":47,"props":1478,"children":1479},{"emptyLinePlaceholder":202},[1480],{"type":20,"value":205},{"type":14,"tag":47,"props":1482,"children":1483},{"class":49,"line":198},[1484,1488,1492],{"type":14,"tag":47,"props":1485,"children":1486},{"style":71},[1487],{"type":20,"value":480},{"type":14,"tag":47,"props":1489,"children":1490},{"style":140},[1491],{"type":20,"value":181},{"type":14,"tag":47,"props":1493,"children":1494},{"style":54},[1495],{"type":20,"value":186},{"type":14,"tag":47,"props":1497,"children":1498},{"class":49,"line":208},[1499],{"type":14,"tag":47,"props":1500,"children":1501},{"style":54},[1502],{"type":20,"value":496},{"type":14,"tag":15,"props":1504,"children":1506},{"id":1505},"数式でのデータ型",[1507],{"type":20,"value":1505},{"type":14,"tag":22,"props":1509,"children":1510},{},[1511],{"type":20,"value":1512},"数式の計算中には以下のデータ型が使用されます。",{"type":14,"tag":1514,"props":1515,"children":1516},"ul",{},[1517,1523,1528,1533,1538],{"type":14,"tag":1518,"props":1519,"children":1520},"li",{},[1521],{"type":20,"value":1522},"Number（int、long、short、float、double）",{"type":14,"tag":1518,"props":1524,"children":1525},{},[1526],{"type":20,"value":1527},"String（stringおよびStringBuffer）",{"type":14,"tag":1518,"props":1529,"children":1530},{},[1531],{"type":20,"value":1532},"Boolean",{"type":14,"tag":1518,"props":1534,"children":1535},{},[1536],{"type":20,"value":1537},"DateTime",{"type":14,"tag":1518,"props":1539,"children":1540},{},[1541],{"type":20,"value":1542},"Object",{"type":14,"tag":22,"props":1544,"children":1545},{},[1546],{"type":20,"value":1547},"ReoGridは数式の計算で常にdoubleを数値型として使用します。ReoGridは値が関数に渡される前に以下の変換を行います。",{"type":14,"tag":1514,"props":1549,"children":1550},{},[1551,1556],{"type":14,"tag":1518,"props":1552,"children":1553},{},[1554],{"type":20,"value":1555},"int、long、short、floatはdoubleに変換されます",{"type":14,"tag":1518,"props":1557,"children":1558},{},[1559],{"type":20,"value":1560},"stringおよびStringBufferオブジェクトはstringに変換されます",{"type":14,"tag":395,"props":1562,"children":1564},{"id":1563},"数値定数",[1565],{"type":20,"value":1563},{"type":14,"tag":22,"props":1567,"children":1568},{},[1569],{"type":20,"value":1570},"数式で使用される数値定数はdoubleとして初期化されます。例：",{"type":14,"tag":37,"props":1572,"children":1574},{"className":39,"code":1573,"language":41,"meta":7,"style":7},"worksheet[\"A1\"] = \"=myFunc(10)\";\n",[1575],{"type":14,"tag":28,"props":1576,"children":1577},{"__ignoreMap":7},[1578],{"type":14,"tag":47,"props":1579,"children":1580},{"class":49,"line":50},[1581,1585,1589,1593,1597,1602],{"type":14,"tag":47,"props":1582,"children":1583},{"style":54},[1584],{"type":20,"value":883},{"type":14,"tag":47,"props":1586,"children":1587},{"style":60},[1588],{"type":20,"value":888},{"type":14,"tag":47,"props":1590,"children":1591},{"style":54},[1592],{"type":20,"value":68},{"type":14,"tag":47,"props":1594,"children":1595},{"style":71},[1596],{"type":20,"value":433},{"type":14,"tag":47,"props":1598,"children":1599},{"style":60},[1600],{"type":20,"value":1601}," \"=myFunc(10)\"",{"type":14,"tag":47,"props":1603,"children":1604},{"style":54},[1605],{"type":20,"value":186},{"type":14,"tag":22,"props":1607,"children":1608},{},[1609],{"type":20,"value":1610},"数値10はdoubleとして解析されメモリに格納されます。引数配列の最初の要素はdouble型になります。",{"type":14,"tag":37,"props":1612,"children":1614},{"className":39,"code":1613,"language":41,"meta":7,"style":7},"FormulaExtension.CustomFunctions[\"myFunc\"] = (cell, args) =>\n{\n  if (args.Length \u003C 1 || !(args[0] is double))\n  {\n    // this function requires a double value\n    return null;\n  }\n  ...\n};\n",[1615],{"type":14,"tag":28,"props":1616,"children":1617},{"__ignoreMap":7},[1618,1661,1668,1725,1732,1740,1755,1762,1773],{"type":14,"tag":47,"props":1619,"children":1620},{"class":49,"line":50},[1621,1625,1629,1633,1637,1641,1645,1649,1653,1657],{"type":14,"tag":47,"props":1622,"children":1623},{"style":54},[1624],{"type":20,"value":419},{"type":14,"tag":47,"props":1626,"children":1627},{"style":60},[1628],{"type":20,"value":424},{"type":14,"tag":47,"props":1630,"children":1631},{"style":54},[1632],{"type":20,"value":68},{"type":14,"tag":47,"props":1634,"children":1635},{"style":71},[1636],{"type":20,"value":433},{"type":14,"tag":47,"props":1638,"children":1639},{"style":54},[1640],{"type":20,"value":438},{"type":14,"tag":47,"props":1642,"children":1643},{"style":86},[1644],{"type":20,"value":89},{"type":14,"tag":47,"props":1646,"children":1647},{"style":54},[1648],{"type":20,"value":94},{"type":14,"tag":47,"props":1650,"children":1651},{"style":86},[1652],{"type":20,"value":99},{"type":14,"tag":47,"props":1654,"children":1655},{"style":54},[1656],{"type":20,"value":104},{"type":14,"tag":47,"props":1658,"children":1659},{"style":71},[1660],{"type":20,"value":109},{"type":14,"tag":47,"props":1662,"children":1663},{"class":49,"line":77},[1664],{"type":14,"tag":47,"props":1665,"children":1666},{"style":54},[1667],{"type":20,"value":663},{"type":14,"tag":47,"props":1669,"children":1670},{"class":49,"line":112},[1671,1675,1679,1683,1688,1693,1698,1702,1706,1710,1715,1720],{"type":14,"tag":47,"props":1672,"children":1673},{"style":71},[1674],{"type":20,"value":1285},{"type":14,"tag":47,"props":1676,"children":1677},{"style":54},[1678],{"type":20,"value":132},{"type":14,"tag":47,"props":1680,"children":1681},{"style":71},[1682],{"type":20,"value":354},{"type":14,"tag":47,"props":1684,"children":1685},{"style":140},[1686],{"type":20,"value":1687}," 1",{"type":14,"tag":47,"props":1689,"children":1690},{"style":71},[1691],{"type":20,"value":1692}," ||",{"type":14,"tag":47,"props":1694,"children":1695},{"style":71},[1696],{"type":20,"value":1697}," !",{"type":14,"tag":47,"props":1699,"children":1700},{"style":54},[1701],{"type":20,"value":229},{"type":14,"tag":47,"props":1703,"children":1704},{"style":140},[1705],{"type":20,"value":234},{"type":14,"tag":47,"props":1707,"children":1708},{"style":54},[1709],{"type":20,"value":68},{"type":14,"tag":47,"props":1711,"children":1712},{"style":71},[1713],{"type":20,"value":1714},"is",{"type":14,"tag":47,"props":1716,"children":1717},{"style":71},[1718],{"type":20,"value":1719}," double",{"type":14,"tag":47,"props":1721,"children":1722},{"style":54},[1723],{"type":20,"value":1724},"))\n",{"type":14,"tag":47,"props":1726,"children":1727},{"class":49,"line":121},[1728],{"type":14,"tag":47,"props":1729,"children":1730},{"style":54},[1731],{"type":20,"value":118},{"type":14,"tag":47,"props":1733,"children":1734},{"class":49,"line":151},[1735],{"type":14,"tag":47,"props":1736,"children":1737},{"style":164},[1738],{"type":20,"value":1739},"    // this function requires a double value\n",{"type":14,"tag":47,"props":1741,"children":1742},{"class":49,"line":160},[1743,1747,1751],{"type":14,"tag":47,"props":1744,"children":1745},{"style":71},[1746],{"type":20,"value":214},{"type":14,"tag":47,"props":1748,"children":1749},{"style":140},[1750],{"type":20,"value":181},{"type":14,"tag":47,"props":1752,"children":1753},{"style":54},[1754],{"type":20,"value":186},{"type":14,"tag":47,"props":1756,"children":1757},{"class":49,"line":170},[1758],{"type":14,"tag":47,"props":1759,"children":1760},{"style":54},[1761],{"type":20,"value":1338},{"type":14,"tag":47,"props":1763,"children":1764},{"class":49,"line":189},[1765,1769],{"type":14,"tag":47,"props":1766,"children":1767},{"style":71},[1768],{"type":20,"value":1179},{"type":14,"tag":47,"props":1770,"children":1771},{"style":54},[1772],{"type":20,"value":1184},{"type":14,"tag":47,"props":1774,"children":1775},{"class":49,"line":198},[1776],{"type":14,"tag":47,"props":1777,"children":1778},{"style":54},[1779],{"type":20,"value":496},{"type":14,"tag":395,"props":1781,"children":1783},{"id":1782},"数値変数",[1784],{"type":20,"value":1782},{"type":14,"tag":22,"props":1786,"children":1787},{},[1788],{"type":20,"value":1789},"セルから数値が取得される場合、doubleに変換されます。以下の関数を作成します。",{"type":14,"tag":37,"props":1791,"children":1793},{"className":39,"code":1792,"language":41,"meta":7,"style":7},"FormulaExtension.CustomFunctions[\"myFunc\"] = (cell, args) =>\n{\n  double value = (double)args[0];\n  return value \\* 2;\n};\n",[1794],{"type":14,"tag":28,"props":1795,"children":1796},{"__ignoreMap":7},[1797,1840,1847,1887,1912],{"type":14,"tag":47,"props":1798,"children":1799},{"class":49,"line":50},[1800,1804,1808,1812,1816,1820,1824,1828,1832,1836],{"type":14,"tag":47,"props":1801,"children":1802},{"style":54},[1803],{"type":20,"value":419},{"type":14,"tag":47,"props":1805,"children":1806},{"style":60},[1807],{"type":20,"value":424},{"type":14,"tag":47,"props":1809,"children":1810},{"style":54},[1811],{"type":20,"value":68},{"type":14,"tag":47,"props":1813,"children":1814},{"style":71},[1815],{"type":20,"value":433},{"type":14,"tag":47,"props":1817,"children":1818},{"style":54},[1819],{"type":20,"value":438},{"type":14,"tag":47,"props":1821,"children":1822},{"style":86},[1823],{"type":20,"value":89},{"type":14,"tag":47,"props":1825,"children":1826},{"style":54},[1827],{"type":20,"value":94},{"type":14,"tag":47,"props":1829,"children":1830},{"style":86},[1831],{"type":20,"value":99},{"type":14,"tag":47,"props":1833,"children":1834},{"style":54},[1835],{"type":20,"value":104},{"type":14,"tag":47,"props":1837,"children":1838},{"style":71},[1839],{"type":20,"value":109},{"type":14,"tag":47,"props":1841,"children":1842},{"class":49,"line":77},[1843],{"type":14,"tag":47,"props":1844,"children":1845},{"style":54},[1846],{"type":20,"value":663},{"type":14,"tag":47,"props":1848,"children":1849},{"class":49,"line":112},[1850,1855,1860,1864,1868,1873,1878,1882],{"type":14,"tag":47,"props":1851,"children":1852},{"style":71},[1853],{"type":20,"value":1854},"  double",{"type":14,"tag":47,"props":1856,"children":1857},{"style":86},[1858],{"type":20,"value":1859}," value",{"type":14,"tag":47,"props":1861,"children":1862},{"style":71},[1863],{"type":20,"value":1138},{"type":14,"tag":47,"props":1865,"children":1866},{"style":54},[1867],{"type":20,"value":438},{"type":14,"tag":47,"props":1869,"children":1870},{"style":71},[1871],{"type":20,"value":1872},"double",{"type":14,"tag":47,"props":1874,"children":1875},{"style":54},[1876],{"type":20,"value":1877},")args[",{"type":14,"tag":47,"props":1879,"children":1880},{"style":140},[1881],{"type":20,"value":234},{"type":14,"tag":47,"props":1883,"children":1884},{"style":54},[1885],{"type":20,"value":1886},"];\n",{"type":14,"tag":47,"props":1888,"children":1889},{"class":49,"line":121},[1890,1894,1899,1904,1908],{"type":14,"tag":47,"props":1891,"children":1892},{"style":71},[1893],{"type":20,"value":480},{"type":14,"tag":47,"props":1895,"children":1896},{"style":54},[1897],{"type":20,"value":1898}," value \\",{"type":14,"tag":47,"props":1900,"children":1901},{"style":71},[1902],{"type":20,"value":1903},"*",{"type":14,"tag":47,"props":1905,"children":1906},{"style":140},[1907],{"type":20,"value":1432},{"type":14,"tag":47,"props":1909,"children":1910},{"style":54},[1911],{"type":20,"value":186},{"type":14,"tag":47,"props":1913,"children":1914},{"class":49,"line":151},[1915],{"type":14,"tag":47,"props":1916,"children":1917},{"style":54},[1918],{"type":20,"value":496},{"type":14,"tag":22,"props":1920,"children":1921},{},[1922],{"type":20,"value":1923},"次に数式で使用します。",{"type":14,"tag":37,"props":1925,"children":1927},{"className":39,"code":1926,"language":41,"meta":7,"style":7},"sheet[\"A1\"] = (int)10;\nsheet[\"B1\"] = \"=myFunc(A1)\";\n",[1928],{"type":14,"tag":28,"props":1929,"children":1930},{"__ignoreMap":7},[1931,1974],{"type":14,"tag":47,"props":1932,"children":1933},{"class":49,"line":50},[1934,1939,1943,1947,1951,1955,1960,1965,1970],{"type":14,"tag":47,"props":1935,"children":1936},{"style":54},[1937],{"type":20,"value":1938},"sheet[",{"type":14,"tag":47,"props":1940,"children":1941},{"style":60},[1942],{"type":20,"value":888},{"type":14,"tag":47,"props":1944,"children":1945},{"style":54},[1946],{"type":20,"value":68},{"type":14,"tag":47,"props":1948,"children":1949},{"style":71},[1950],{"type":20,"value":433},{"type":14,"tag":47,"props":1952,"children":1953},{"style":54},[1954],{"type":20,"value":438},{"type":14,"tag":47,"props":1956,"children":1957},{"style":71},[1958],{"type":20,"value":1959},"int",{"type":14,"tag":47,"props":1961,"children":1962},{"style":54},[1963],{"type":20,"value":1964},")",{"type":14,"tag":47,"props":1966,"children":1967},{"style":140},[1968],{"type":20,"value":1969},"10",{"type":14,"tag":47,"props":1971,"children":1972},{"style":54},[1973],{"type":20,"value":186},{"type":14,"tag":47,"props":1975,"children":1976},{"class":49,"line":77},[1977,1981,1986,1990,1994,1999],{"type":14,"tag":47,"props":1978,"children":1979},{"style":54},[1980],{"type":20,"value":1938},{"type":14,"tag":47,"props":1982,"children":1983},{"style":60},[1984],{"type":20,"value":1985},"\"B1\"",{"type":14,"tag":47,"props":1987,"children":1988},{"style":54},[1989],{"type":20,"value":68},{"type":14,"tag":47,"props":1991,"children":1992},{"style":71},[1993],{"type":20,"value":433},{"type":14,"tag":47,"props":1995,"children":1996},{"style":60},[1997],{"type":20,"value":1998}," \"=myFunc(A1)\"",{"type":14,"tag":47,"props":2000,"children":2001},{"style":54},[2002],{"type":20,"value":186},{"type":14,"tag":22,"props":2004,"children":2005},{},[2006],{"type":20,"value":2007},"データ型変換エラーは発生しません。（ただし、引数の長さには注意してください。）",{"type":14,"tag":15,"props":2009,"children":2011},{"id":2010},"関数内の参照",[2012],{"type":20,"value":2010},{"type":14,"tag":395,"props":2014,"children":2016},{"id":2015},"セル参照",[2017],{"type":20,"value":2015},{"type":14,"tag":22,"props":2019,"children":2020},{},[2021],{"type":20,"value":2022},"ReoGridは、数式で使用される参照セルから値を自動的に取得します。「数値変数」の例で示した通りです。",{"type":14,"tag":395,"props":2024,"children":2026},{"id":2025},"範囲参照",[2027],{"type":20,"value":2025},{"type":14,"tag":22,"props":2029,"children":2030},{},[2031,2033,2039],{"type":20,"value":2032},"数式で範囲リテラルが使用される場合、ReoGridは",{"type":14,"tag":28,"props":2034,"children":2036},{"className":2035},[],[2037],{"type":20,"value":2038},"RangePosition",{"type":20,"value":2040},"構造体を関数に渡します。例：",{"type":14,"tag":37,"props":2042,"children":2044},{"className":39,"code":2043,"language":41,"meta":7,"style":7},"worksheet[\"G2:K3\"] = new object[] { 1, 2, 5, 7, 8, 10, 12, 15, 16, 19};\nworksheet[\"L2\"] = \"=CountEvenNumber(G2:K3)\";\n",[2045],{"type":14,"tag":28,"props":2046,"children":2047},{"__ignoreMap":7},[2048,2171],{"type":14,"tag":47,"props":2049,"children":2050},{"class":49,"line":50},[2051,2055,2060,2064,2068,2073,2077,2082,2087,2091,2096,2100,2105,2109,2114,2118,2123,2127,2131,2135,2140,2144,2149,2153,2158,2162,2167],{"type":14,"tag":47,"props":2052,"children":2053},{"style":54},[2054],{"type":20,"value":883},{"type":14,"tag":47,"props":2056,"children":2057},{"style":60},[2058],{"type":20,"value":2059},"\"G2:K3\"",{"type":14,"tag":47,"props":2061,"children":2062},{"style":54},[2063],{"type":20,"value":68},{"type":14,"tag":47,"props":2065,"children":2066},{"style":71},[2067],{"type":20,"value":433},{"type":14,"tag":47,"props":2069,"children":2070},{"style":71},[2071],{"type":20,"value":2072}," new",{"type":14,"tag":47,"props":2074,"children":2075},{"style":71},[2076],{"type":20,"value":609},{"type":14,"tag":47,"props":2078,"children":2079},{"style":54},[2080],{"type":20,"value":2081},"[] { ",{"type":14,"tag":47,"props":2083,"children":2084},{"style":140},[2085],{"type":20,"value":2086},"1",{"type":14,"tag":47,"props":2088,"children":2089},{"style":54},[2090],{"type":20,"value":94},{"type":14,"tag":47,"props":2092,"children":2093},{"style":140},[2094],{"type":20,"value":2095},"2",{"type":14,"tag":47,"props":2097,"children":2098},{"style":54},[2099],{"type":20,"value":94},{"type":14,"tag":47,"props":2101,"children":2102},{"style":140},[2103],{"type":20,"value":2104},"5",{"type":14,"tag":47,"props":2106,"children":2107},{"style":54},[2108],{"type":20,"value":94},{"type":14,"tag":47,"props":2110,"children":2111},{"style":140},[2112],{"type":20,"value":2113},"7",{"type":14,"tag":47,"props":2115,"children":2116},{"style":54},[2117],{"type":20,"value":94},{"type":14,"tag":47,"props":2119,"children":2120},{"style":140},[2121],{"type":20,"value":2122},"8",{"type":14,"tag":47,"props":2124,"children":2125},{"style":54},[2126],{"type":20,"value":94},{"type":14,"tag":47,"props":2128,"children":2129},{"style":140},[2130],{"type":20,"value":1969},{"type":14,"tag":47,"props":2132,"children":2133},{"style":54},[2134],{"type":20,"value":94},{"type":14,"tag":47,"props":2136,"children":2137},{"style":140},[2138],{"type":20,"value":2139},"12",{"type":14,"tag":47,"props":2141,"children":2142},{"style":54},[2143],{"type":20,"value":94},{"type":14,"tag":47,"props":2145,"children":2146},{"style":140},[2147],{"type":20,"value":2148},"15",{"type":14,"tag":47,"props":2150,"children":2151},{"style":54},[2152],{"type":20,"value":94},{"type":14,"tag":47,"props":2154,"children":2155},{"style":140},[2156],{"type":20,"value":2157},"16",{"type":14,"tag":47,"props":2159,"children":2160},{"style":54},[2161],{"type":20,"value":94},{"type":14,"tag":47,"props":2163,"children":2164},{"style":140},[2165],{"type":20,"value":2166},"19",{"type":14,"tag":47,"props":2168,"children":2169},{"style":54},[2170],{"type":20,"value":496},{"type":14,"tag":47,"props":2172,"children":2173},{"class":49,"line":77},[2174,2178,2183,2187,2191,2196],{"type":14,"tag":47,"props":2175,"children":2176},{"style":54},[2177],{"type":20,"value":883},{"type":14,"tag":47,"props":2179,"children":2180},{"style":60},[2181],{"type":20,"value":2182},"\"L2\"",{"type":14,"tag":47,"props":2184,"children":2185},{"style":54},[2186],{"type":20,"value":68},{"type":14,"tag":47,"props":2188,"children":2189},{"style":71},[2190],{"type":20,"value":433},{"type":14,"tag":47,"props":2192,"children":2193},{"style":60},[2194],{"type":20,"value":2195}," \"=CountEvenNumber(G2:K3)\"",{"type":14,"tag":47,"props":2197,"children":2198},{"style":54},[2199],{"type":20,"value":186},{"type":14,"tag":22,"props":2201,"children":2202},{},[2203],{"type":20,"value":2204},"数式で範囲参照（G2:K3）が使用されています。カスタム関数本体内で手動で処理する必要があります。以下の関数例は、指定された範囲内の偶数を数えます。",{"type":14,"tag":37,"props":2206,"children":2208},{"className":39,"code":2207,"language":41,"meta":7,"style":7},"FormulaExtension.CustomFunctions[\"CountEvenNumber\"] = (cell, args) =>\n{\n  if (args.Length \u003C 1 || !(args[0] is RangePosition))\n  {\n    return null; // we need a range reference\n  }\n\n  RangePosition range = (RangePosition)args[0];\n\n  int count = 0;\n\n  // iterate over cells inside a range\n  cell.Worksheet.IterateCells(range, (r, c, inCell) => {\n    double value;\n\n    // try get a number from cell data\n    if (ReoGridCellUtility.TryGetNumberData(inCell.Data, out value) {\n      if ((value % 2) == 0) {\n        count++;\n      }\n    }\n\n    // continue iterating\n    return true;\n  });\n\n  return count;\n};\n",[2209],{"type":14,"tag":28,"props":2210,"children":2211},{"__ignoreMap":7},[2212,2256,2263,2315,2322,2343,2350,2357,2394,2401,2426,2433,2442,2496,2513,2521,2530,2563,2603,2621,2630,2638,2646,2655,2673,2682,2690,2703],{"type":14,"tag":47,"props":2213,"children":2214},{"class":49,"line":50},[2215,2219,2224,2228,2232,2236,2240,2244,2248,2252],{"type":14,"tag":47,"props":2216,"children":2217},{"style":54},[2218],{"type":20,"value":419},{"type":14,"tag":47,"props":2220,"children":2221},{"style":60},[2222],{"type":20,"value":2223},"\"CountEvenNumber\"",{"type":14,"tag":47,"props":2225,"children":2226},{"style":54},[2227],{"type":20,"value":68},{"type":14,"tag":47,"props":2229,"children":2230},{"style":71},[2231],{"type":20,"value":433},{"type":14,"tag":47,"props":2233,"children":2234},{"style":54},[2235],{"type":20,"value":438},{"type":14,"tag":47,"props":2237,"children":2238},{"style":86},[2239],{"type":20,"value":89},{"type":14,"tag":47,"props":2241,"children":2242},{"style":54},[2243],{"type":20,"value":94},{"type":14,"tag":47,"props":2245,"children":2246},{"style":86},[2247],{"type":20,"value":99},{"type":14,"tag":47,"props":2249,"children":2250},{"style":54},[2251],{"type":20,"value":104},{"type":14,"tag":47,"props":2253,"children":2254},{"style":71},[2255],{"type":20,"value":109},{"type":14,"tag":47,"props":2257,"children":2258},{"class":49,"line":77},[2259],{"type":14,"tag":47,"props":2260,"children":2261},{"style":54},[2262],{"type":20,"value":663},{"type":14,"tag":47,"props":2264,"children":2265},{"class":49,"line":112},[2266,2270,2274,2278,2282,2286,2290,2294,2298,2302,2306,2311],{"type":14,"tag":47,"props":2267,"children":2268},{"style":71},[2269],{"type":20,"value":1285},{"type":14,"tag":47,"props":2271,"children":2272},{"style":54},[2273],{"type":20,"value":132},{"type":14,"tag":47,"props":2275,"children":2276},{"style":71},[2277],{"type":20,"value":354},{"type":14,"tag":47,"props":2279,"children":2280},{"style":140},[2281],{"type":20,"value":1687},{"type":14,"tag":47,"props":2283,"children":2284},{"style":71},[2285],{"type":20,"value":1692},{"type":14,"tag":47,"props":2287,"children":2288},{"style":71},[2289],{"type":20,"value":1697},{"type":14,"tag":47,"props":2291,"children":2292},{"style":54},[2293],{"type":20,"value":229},{"type":14,"tag":47,"props":2295,"children":2296},{"style":140},[2297],{"type":20,"value":234},{"type":14,"tag":47,"props":2299,"children":2300},{"style":54},[2301],{"type":20,"value":68},{"type":14,"tag":47,"props":2303,"children":2304},{"style":71},[2305],{"type":20,"value":1714},{"type":14,"tag":47,"props":2307,"children":2308},{"style":86},[2309],{"type":20,"value":2310}," RangePosition",{"type":14,"tag":47,"props":2312,"children":2313},{"style":54},[2314],{"type":20,"value":1724},{"type":14,"tag":47,"props":2316,"children":2317},{"class":49,"line":121},[2318],{"type":14,"tag":47,"props":2319,"children":2320},{"style":54},[2321],{"type":20,"value":118},{"type":14,"tag":47,"props":2323,"children":2324},{"class":49,"line":151},[2325,2329,2333,2338],{"type":14,"tag":47,"props":2326,"children":2327},{"style":71},[2328],{"type":20,"value":214},{"type":14,"tag":47,"props":2330,"children":2331},{"style":140},[2332],{"type":20,"value":181},{"type":14,"tag":47,"props":2334,"children":2335},{"style":54},[2336],{"type":20,"value":2337},"; ",{"type":14,"tag":47,"props":2339,"children":2340},{"style":164},[2341],{"type":20,"value":2342},"// we need a range reference\n",{"type":14,"tag":47,"props":2344,"children":2345},{"class":49,"line":160},[2346],{"type":14,"tag":47,"props":2347,"children":2348},{"style":54},[2349],{"type":20,"value":1338},{"type":14,"tag":47,"props":2351,"children":2352},{"class":49,"line":170},[2353],{"type":14,"tag":47,"props":2354,"children":2355},{"emptyLinePlaceholder":202},[2356],{"type":20,"value":205},{"type":14,"tag":47,"props":2358,"children":2359},{"class":49,"line":189},[2360,2365,2370,2374,2378,2382,2386,2390],{"type":14,"tag":47,"props":2361,"children":2362},{"style":86},[2363],{"type":20,"value":2364},"  RangePosition",{"type":14,"tag":47,"props":2366,"children":2367},{"style":86},[2368],{"type":20,"value":2369}," range",{"type":14,"tag":47,"props":2371,"children":2372},{"style":71},[2373],{"type":20,"value":1138},{"type":14,"tag":47,"props":2375,"children":2376},{"style":54},[2377],{"type":20,"value":438},{"type":14,"tag":47,"props":2379,"children":2380},{"style":86},[2381],{"type":20,"value":2038},{"type":14,"tag":47,"props":2383,"children":2384},{"style":54},[2385],{"type":20,"value":1877},{"type":14,"tag":47,"props":2387,"children":2388},{"style":140},[2389],{"type":20,"value":234},{"type":14,"tag":47,"props":2391,"children":2392},{"style":54},[2393],{"type":20,"value":1886},{"type":14,"tag":47,"props":2395,"children":2396},{"class":49,"line":198},[2397],{"type":14,"tag":47,"props":2398,"children":2399},{"emptyLinePlaceholder":202},[2400],{"type":20,"value":205},{"type":14,"tag":47,"props":2402,"children":2403},{"class":49,"line":208},[2404,2409,2414,2418,2422],{"type":14,"tag":47,"props":2405,"children":2406},{"style":71},[2407],{"type":20,"value":2408},"  int",{"type":14,"tag":47,"props":2410,"children":2411},{"style":86},[2412],{"type":20,"value":2413}," count",{"type":14,"tag":47,"props":2415,"children":2416},{"style":71},[2417],{"type":20,"value":1138},{"type":14,"tag":47,"props":2419,"children":2420},{"style":140},[2421],{"type":20,"value":143},{"type":14,"tag":47,"props":2423,"children":2424},{"style":54},[2425],{"type":20,"value":186},{"type":14,"tag":47,"props":2427,"children":2428},{"class":49,"line":252},[2429],{"type":14,"tag":47,"props":2430,"children":2431},{"emptyLinePlaceholder":202},[2432],{"type":20,"value":205},{"type":14,"tag":47,"props":2434,"children":2436},{"class":49,"line":2435},12,[2437],{"type":14,"tag":47,"props":2438,"children":2439},{"style":164},[2440],{"type":20,"value":2441},"  // iterate over cells inside a range\n",{"type":14,"tag":47,"props":2443,"children":2445},{"class":49,"line":2444},13,[2446,2451,2456,2461,2466,2470,2475,2479,2484,2488,2492],{"type":14,"tag":47,"props":2447,"children":2448},{"style":54},[2449],{"type":20,"value":2450},"  cell.Worksheet.",{"type":14,"tag":47,"props":2452,"children":2453},{"style":86},[2454],{"type":20,"value":2455},"IterateCells",{"type":14,"tag":47,"props":2457,"children":2458},{"style":54},[2459],{"type":20,"value":2460},"(range, (",{"type":14,"tag":47,"props":2462,"children":2463},{"style":86},[2464],{"type":20,"value":2465},"r",{"type":14,"tag":47,"props":2467,"children":2468},{"style":54},[2469],{"type":20,"value":94},{"type":14,"tag":47,"props":2471,"children":2472},{"style":86},[2473],{"type":20,"value":2474},"c",{"type":14,"tag":47,"props":2476,"children":2477},{"style":54},[2478],{"type":20,"value":94},{"type":14,"tag":47,"props":2480,"children":2481},{"style":86},[2482],{"type":20,"value":2483},"inCell",{"type":14,"tag":47,"props":2485,"children":2486},{"style":54},[2487],{"type":20,"value":104},{"type":14,"tag":47,"props":2489,"children":2490},{"style":71},[2491],{"type":20,"value":459},{"type":14,"tag":47,"props":2493,"children":2494},{"style":54},[2495],{"type":20,"value":464},{"type":14,"tag":47,"props":2497,"children":2499},{"class":49,"line":2498},14,[2500,2505,2509],{"type":14,"tag":47,"props":2501,"children":2502},{"style":71},[2503],{"type":20,"value":2504},"    double",{"type":14,"tag":47,"props":2506,"children":2507},{"style":86},[2508],{"type":20,"value":1859},{"type":14,"tag":47,"props":2510,"children":2511},{"style":54},[2512],{"type":20,"value":186},{"type":14,"tag":47,"props":2514,"children":2516},{"class":49,"line":2515},15,[2517],{"type":14,"tag":47,"props":2518,"children":2519},{"emptyLinePlaceholder":202},[2520],{"type":20,"value":205},{"type":14,"tag":47,"props":2522,"children":2524},{"class":49,"line":2523},16,[2525],{"type":14,"tag":47,"props":2526,"children":2527},{"style":164},[2528],{"type":20,"value":2529},"    // try get a number from cell data\n",{"type":14,"tag":47,"props":2531,"children":2533},{"class":49,"line":2532},17,[2534,2538,2543,2548,2553,2558],{"type":14,"tag":47,"props":2535,"children":2536},{"style":71},[2537],{"type":20,"value":127},{"type":14,"tag":47,"props":2539,"children":2540},{"style":54},[2541],{"type":20,"value":2542}," (ReoGridCellUtility.",{"type":14,"tag":47,"props":2544,"children":2545},{"style":86},[2546],{"type":20,"value":2547},"TryGetNumberData",{"type":14,"tag":47,"props":2549,"children":2550},{"style":54},[2551],{"type":20,"value":2552},"(inCell.Data, ",{"type":14,"tag":47,"props":2554,"children":2555},{"style":71},[2556],{"type":20,"value":2557},"out",{"type":14,"tag":47,"props":2559,"children":2560},{"style":54},[2561],{"type":20,"value":2562}," value) {\n",{"type":14,"tag":47,"props":2564,"children":2566},{"class":49,"line":2565},18,[2567,2572,2577,2582,2586,2590,2594,2598],{"type":14,"tag":47,"props":2568,"children":2569},{"style":86},[2570],{"type":20,"value":2571},"      if",{"type":14,"tag":47,"props":2573,"children":2574},{"style":54},[2575],{"type":20,"value":2576}," ((value ",{"type":14,"tag":47,"props":2578,"children":2579},{"style":71},[2580],{"type":20,"value":2581},"%",{"type":14,"tag":47,"props":2583,"children":2584},{"style":140},[2585],{"type":20,"value":1432},{"type":14,"tag":47,"props":2587,"children":2588},{"style":54},[2589],{"type":20,"value":104},{"type":14,"tag":47,"props":2591,"children":2592},{"style":71},[2593],{"type":20,"value":137},{"type":14,"tag":47,"props":2595,"children":2596},{"style":140},[2597],{"type":20,"value":143},{"type":14,"tag":47,"props":2599,"children":2600},{"style":54},[2601],{"type":20,"value":2602},") {\n",{"type":14,"tag":47,"props":2604,"children":2606},{"class":49,"line":2605},19,[2607,2612,2617],{"type":14,"tag":47,"props":2608,"children":2609},{"style":54},[2610],{"type":20,"value":2611},"        count",{"type":14,"tag":47,"props":2613,"children":2614},{"style":71},[2615],{"type":20,"value":2616},"++",{"type":14,"tag":47,"props":2618,"children":2619},{"style":54},[2620],{"type":20,"value":186},{"type":14,"tag":47,"props":2622,"children":2624},{"class":49,"line":2623},20,[2625],{"type":14,"tag":47,"props":2626,"children":2627},{"style":54},[2628],{"type":20,"value":2629},"      }\n",{"type":14,"tag":47,"props":2631,"children":2633},{"class":49,"line":2632},21,[2634],{"type":14,"tag":47,"props":2635,"children":2636},{"style":54},[2637],{"type":20,"value":195},{"type":14,"tag":47,"props":2639,"children":2641},{"class":49,"line":2640},22,[2642],{"type":14,"tag":47,"props":2643,"children":2644},{"emptyLinePlaceholder":202},[2645],{"type":20,"value":205},{"type":14,"tag":47,"props":2647,"children":2649},{"class":49,"line":2648},23,[2650],{"type":14,"tag":47,"props":2651,"children":2652},{"style":164},[2653],{"type":20,"value":2654},"    // continue iterating\n",{"type":14,"tag":47,"props":2656,"children":2658},{"class":49,"line":2657},24,[2659,2664,2669],{"type":14,"tag":47,"props":2660,"children":2661},{"style":54},[2662],{"type":20,"value":2663},"    return ",{"type":14,"tag":47,"props":2665,"children":2666},{"style":140},[2667],{"type":20,"value":2668},"true",{"type":14,"tag":47,"props":2670,"children":2671},{"style":54},[2672],{"type":20,"value":186},{"type":14,"tag":47,"props":2674,"children":2676},{"class":49,"line":2675},25,[2677],{"type":14,"tag":47,"props":2678,"children":2679},{"style":54},[2680],{"type":20,"value":2681},"  });\n",{"type":14,"tag":47,"props":2683,"children":2685},{"class":49,"line":2684},26,[2686],{"type":14,"tag":47,"props":2687,"children":2688},{"emptyLinePlaceholder":202},[2689],{"type":20,"value":205},{"type":14,"tag":47,"props":2691,"children":2693},{"class":49,"line":2692},27,[2694,2698],{"type":14,"tag":47,"props":2695,"children":2696},{"style":71},[2697],{"type":20,"value":480},{"type":14,"tag":47,"props":2699,"children":2700},{"style":54},[2701],{"type":20,"value":2702}," count;\n",{"type":14,"tag":47,"props":2704,"children":2706},{"class":49,"line":2705},28,[2707],{"type":14,"tag":47,"props":2708,"children":2709},{"style":54},[2710],{"type":20,"value":496},{"type":14,"tag":395,"props":2712,"children":2714},{"id":2713},"名前参照",[2715],{"type":20,"value":2713},{"type":14,"tag":2717,"props":2718,"children":2720},"h4",{"id":2719},"名前からセルへ",[2721],{"type":20,"value":2719},{"type":14,"tag":22,"props":2723,"children":2724},{},[2725],{"type":20,"value":2726},"名前参照がセルを指す場合、セルの値が取得されて関数に自動的に渡されます。",{"type":14,"tag":37,"props":2728,"children":2730},{"className":39,"code":2729,"language":41,"meta":7,"style":7},"worksheet.DefineNamedRange(\"r1\", \"A1\");\nsheet[\"r1\"] = (int)20;\nsheet[\"B1\"] = \"=myFunc(r1)\";\n",[2731],{"type":14,"tag":28,"props":2732,"children":2733},{"__ignoreMap":7},[2734,2769,2809],{"type":14,"tag":47,"props":2735,"children":2736},{"class":49,"line":50},[2737,2742,2747,2751,2756,2760,2764],{"type":14,"tag":47,"props":2738,"children":2739},{"style":54},[2740],{"type":20,"value":2741},"worksheet.",{"type":14,"tag":47,"props":2743,"children":2744},{"style":86},[2745],{"type":20,"value":2746},"DefineNamedRange",{"type":14,"tag":47,"props":2748,"children":2749},{"style":54},[2750],{"type":20,"value":527},{"type":14,"tag":47,"props":2752,"children":2753},{"style":60},[2754],{"type":20,"value":2755},"\"r1\"",{"type":14,"tag":47,"props":2757,"children":2758},{"style":54},[2759],{"type":20,"value":94},{"type":14,"tag":47,"props":2761,"children":2762},{"style":60},[2763],{"type":20,"value":888},{"type":14,"tag":47,"props":2765,"children":2766},{"style":54},[2767],{"type":20,"value":2768},");\n",{"type":14,"tag":47,"props":2770,"children":2771},{"class":49,"line":77},[2772,2776,2780,2784,2788,2792,2796,2800,2805],{"type":14,"tag":47,"props":2773,"children":2774},{"style":54},[2775],{"type":20,"value":1938},{"type":14,"tag":47,"props":2777,"children":2778},{"style":60},[2779],{"type":20,"value":2755},{"type":14,"tag":47,"props":2781,"children":2782},{"style":54},[2783],{"type":20,"value":68},{"type":14,"tag":47,"props":2785,"children":2786},{"style":71},[2787],{"type":20,"value":433},{"type":14,"tag":47,"props":2789,"children":2790},{"style":54},[2791],{"type":20,"value":438},{"type":14,"tag":47,"props":2793,"children":2794},{"style":71},[2795],{"type":20,"value":1959},{"type":14,"tag":47,"props":2797,"children":2798},{"style":54},[2799],{"type":20,"value":1964},{"type":14,"tag":47,"props":2801,"children":2802},{"style":140},[2803],{"type":20,"value":2804},"20",{"type":14,"tag":47,"props":2806,"children":2807},{"style":54},[2808],{"type":20,"value":186},{"type":14,"tag":47,"props":2810,"children":2811},{"class":49,"line":112},[2812,2816,2820,2824,2828,2833],{"type":14,"tag":47,"props":2813,"children":2814},{"style":54},[2815],{"type":20,"value":1938},{"type":14,"tag":47,"props":2817,"children":2818},{"style":60},[2819],{"type":20,"value":1985},{"type":14,"tag":47,"props":2821,"children":2822},{"style":54},[2823],{"type":20,"value":68},{"type":14,"tag":47,"props":2825,"children":2826},{"style":71},[2827],{"type":20,"value":433},{"type":14,"tag":47,"props":2829,"children":2830},{"style":60},[2831],{"type":20,"value":2832}," \"=myFunc(r1)\"",{"type":14,"tag":47,"props":2834,"children":2835},{"style":54},[2836],{"type":20,"value":186},{"type":14,"tag":2717,"props":2838,"children":2840},{"id":2839},"名前から範囲へ",[2841],{"type":20,"value":2839},{"type":14,"tag":22,"props":2843,"children":2844},{},[2845,2847,2852],{"type":20,"value":2846},"数式で範囲への名前参照が使用される場合、ReoGridはまず名前で範囲を検索し、次に",{"type":14,"tag":28,"props":2848,"children":2850},{"className":2849},[],[2851],{"type":20,"value":2038},{"type":20,"value":2853},"構造体を渡します。範囲参照と同様に処理できます。",{"type":14,"tag":37,"props":2855,"children":2857},{"className":39,"code":2856,"language":41,"meta":7,"style":7},"worksheet.DefineNamedRange(\"evenRange\", \"G2:K3\");\nworksheet[\"evenRange\"] = new object[] { 1, 2, 4, 6, 9, 11, 13, 14, 15, 17 };\nworksheet[\"I2\"] = \"=CountEvenNumber(evenRange)\";\nAssertSame(worksheet[\"I2\"], 4);\n",[2858],{"type":14,"tag":28,"props":2859,"children":2860},{"__ignoreMap":7},[2861,2893,3012,3041],{"type":14,"tag":47,"props":2862,"children":2863},{"class":49,"line":50},[2864,2868,2872,2876,2881,2885,2889],{"type":14,"tag":47,"props":2865,"children":2866},{"style":54},[2867],{"type":20,"value":2741},{"type":14,"tag":47,"props":2869,"children":2870},{"style":86},[2871],{"type":20,"value":2746},{"type":14,"tag":47,"props":2873,"children":2874},{"style":54},[2875],{"type":20,"value":527},{"type":14,"tag":47,"props":2877,"children":2878},{"style":60},[2879],{"type":20,"value":2880},"\"evenRange\"",{"type":14,"tag":47,"props":2882,"children":2883},{"style":54},[2884],{"type":20,"value":94},{"type":14,"tag":47,"props":2886,"children":2887},{"style":60},[2888],{"type":20,"value":2059},{"type":14,"tag":47,"props":2890,"children":2891},{"style":54},[2892],{"type":20,"value":2768},{"type":14,"tag":47,"props":2894,"children":2895},{"class":49,"line":77},[2896,2900,2904,2908,2912,2916,2920,2924,2928,2932,2936,2940,2945,2949,2954,2958,2963,2967,2972,2976,2981,2985,2990,2994,2998,3002,3007],{"type":14,"tag":47,"props":2897,"children":2898},{"style":54},[2899],{"type":20,"value":883},{"type":14,"tag":47,"props":2901,"children":2902},{"style":60},[2903],{"type":20,"value":2880},{"type":14,"tag":47,"props":2905,"children":2906},{"style":54},[2907],{"type":20,"value":68},{"type":14,"tag":47,"props":2909,"children":2910},{"style":71},[2911],{"type":20,"value":433},{"type":14,"tag":47,"props":2913,"children":2914},{"style":71},[2915],{"type":20,"value":2072},{"type":14,"tag":47,"props":2917,"children":2918},{"style":71},[2919],{"type":20,"value":609},{"type":14,"tag":47,"props":2921,"children":2922},{"style":54},[2923],{"type":20,"value":2081},{"type":14,"tag":47,"props":2925,"children":2926},{"style":140},[2927],{"type":20,"value":2086},{"type":14,"tag":47,"props":2929,"children":2930},{"style":54},[2931],{"type":20,"value":94},{"type":14,"tag":47,"props":2933,"children":2934},{"style":140},[2935],{"type":20,"value":2095},{"type":14,"tag":47,"props":2937,"children":2938},{"style":54},[2939],{"type":20,"value":94},{"type":14,"tag":47,"props":2941,"children":2942},{"style":140},[2943],{"type":20,"value":2944},"4",{"type":14,"tag":47,"props":2946,"children":2947},{"style":54},[2948],{"type":20,"value":94},{"type":14,"tag":47,"props":2950,"children":2951},{"style":140},[2952],{"type":20,"value":2953},"6",{"type":14,"tag":47,"props":2955,"children":2956},{"style":54},[2957],{"type":20,"value":94},{"type":14,"tag":47,"props":2959,"children":2960},{"style":140},[2961],{"type":20,"value":2962},"9",{"type":14,"tag":47,"props":2964,"children":2965},{"style":54},[2966],{"type":20,"value":94},{"type":14,"tag":47,"props":2968,"children":2969},{"style":140},[2970],{"type":20,"value":2971},"11",{"type":14,"tag":47,"props":2973,"children":2974},{"style":54},[2975],{"type":20,"value":94},{"type":14,"tag":47,"props":2977,"children":2978},{"style":140},[2979],{"type":20,"value":2980},"13",{"type":14,"tag":47,"props":2982,"children":2983},{"style":54},[2984],{"type":20,"value":94},{"type":14,"tag":47,"props":2986,"children":2987},{"style":140},[2988],{"type":20,"value":2989},"14",{"type":14,"tag":47,"props":2991,"children":2992},{"style":54},[2993],{"type":20,"value":94},{"type":14,"tag":47,"props":2995,"children":2996},{"style":140},[2997],{"type":20,"value":2148},{"type":14,"tag":47,"props":2999,"children":3000},{"style":54},[3001],{"type":20,"value":94},{"type":14,"tag":47,"props":3003,"children":3004},{"style":140},[3005],{"type":20,"value":3006},"17",{"type":14,"tag":47,"props":3008,"children":3009},{"style":54},[3010],{"type":20,"value":3011}," };\n",{"type":14,"tag":47,"props":3013,"children":3014},{"class":49,"line":112},[3015,3019,3024,3028,3032,3037],{"type":14,"tag":47,"props":3016,"children":3017},{"style":54},[3018],{"type":20,"value":883},{"type":14,"tag":47,"props":3020,"children":3021},{"style":60},[3022],{"type":20,"value":3023},"\"I2\"",{"type":14,"tag":47,"props":3025,"children":3026},{"style":54},[3027],{"type":20,"value":68},{"type":14,"tag":47,"props":3029,"children":3030},{"style":71},[3031],{"type":20,"value":433},{"type":14,"tag":47,"props":3033,"children":3034},{"style":60},[3035],{"type":20,"value":3036}," \"=CountEvenNumber(evenRange)\"",{"type":14,"tag":47,"props":3038,"children":3039},{"style":54},[3040],{"type":20,"value":186},{"type":14,"tag":47,"props":3042,"children":3043},{"class":49,"line":121},[3044,3049,3054,3058,3063,3067],{"type":14,"tag":47,"props":3045,"children":3046},{"style":86},[3047],{"type":20,"value":3048},"AssertSame",{"type":14,"tag":47,"props":3050,"children":3051},{"style":54},[3052],{"type":20,"value":3053},"(worksheet[",{"type":14,"tag":47,"props":3055,"children":3056},{"style":60},[3057],{"type":20,"value":3023},{"type":14,"tag":47,"props":3059,"children":3060},{"style":54},[3061],{"type":20,"value":3062},"], ",{"type":14,"tag":47,"props":3064,"children":3065},{"style":140},[3066],{"type":20,"value":2944},{"type":14,"tag":47,"props":3068,"children":3069},{"style":54},[3070],{"type":20,"value":2768},{"type":14,"tag":15,"props":3072,"children":3074},{"id":3073},"名前参照プロバイダーのカスタマイズ",[3075],{"type":20,"value":3073},{"type":14,"tag":22,"props":3077,"children":3078},{},[3079],{"type":20,"value":3080},".NETコードが提供する定数値を数式で使用することも可能です。以下の例では、異なる定数値を返す2つの名前を追加します。",{"type":14,"tag":37,"props":3082,"children":3084},{"className":39,"code":3083,"language":41,"meta":7,"style":7},"unvell.ReoGrid.Formula.FormulaExtension.NameReferenceProvider =\n  (cell, name) =>\n  {\n    if (name == \"myName1\")\n      return 10;\n    else if (name == \"myName2\")\n      return 20;\n    else\n      return null;\n  };\n",[3085],{"type":14,"tag":28,"props":3086,"children":3087},{"__ignoreMap":7},[3088,3100,3128,3135,3160,3176,3206,3222,3230,3245],{"type":14,"tag":47,"props":3089,"children":3090},{"class":49,"line":50},[3091,3096],{"type":14,"tag":47,"props":3092,"children":3093},{"style":54},[3094],{"type":20,"value":3095},"unvell.ReoGrid.Formula.FormulaExtension.NameReferenceProvider ",{"type":14,"tag":47,"props":3097,"children":3098},{"style":71},[3099],{"type":20,"value":74},{"type":14,"tag":47,"props":3101,"children":3102},{"class":49,"line":77},[3103,3107,3111,3115,3120,3124],{"type":14,"tag":47,"props":3104,"children":3105},{"style":54},[3106],{"type":20,"value":83},{"type":14,"tag":47,"props":3108,"children":3109},{"style":86},[3110],{"type":20,"value":89},{"type":14,"tag":47,"props":3112,"children":3113},{"style":54},[3114],{"type":20,"value":94},{"type":14,"tag":47,"props":3116,"children":3117},{"style":86},[3118],{"type":20,"value":3119},"name",{"type":14,"tag":47,"props":3121,"children":3122},{"style":54},[3123],{"type":20,"value":104},{"type":14,"tag":47,"props":3125,"children":3126},{"style":71},[3127],{"type":20,"value":109},{"type":14,"tag":47,"props":3129,"children":3130},{"class":49,"line":112},[3131],{"type":14,"tag":47,"props":3132,"children":3133},{"style":54},[3134],{"type":20,"value":118},{"type":14,"tag":47,"props":3136,"children":3137},{"class":49,"line":121},[3138,3142,3147,3151,3156],{"type":14,"tag":47,"props":3139,"children":3140},{"style":71},[3141],{"type":20,"value":127},{"type":14,"tag":47,"props":3143,"children":3144},{"style":54},[3145],{"type":20,"value":3146}," (name ",{"type":14,"tag":47,"props":3148,"children":3149},{"style":71},[3150],{"type":20,"value":137},{"type":14,"tag":47,"props":3152,"children":3153},{"style":60},[3154],{"type":20,"value":3155}," \"myName1\"",{"type":14,"tag":47,"props":3157,"children":3158},{"style":54},[3159],{"type":20,"value":148},{"type":14,"tag":47,"props":3161,"children":3162},{"class":49,"line":151},[3163,3167,3172],{"type":14,"tag":47,"props":3164,"children":3165},{"style":71},[3166],{"type":20,"value":176},{"type":14,"tag":47,"props":3168,"children":3169},{"style":140},[3170],{"type":20,"value":3171}," 10",{"type":14,"tag":47,"props":3173,"children":3174},{"style":54},[3175],{"type":20,"value":186},{"type":14,"tag":47,"props":3177,"children":3178},{"class":49,"line":160},[3179,3184,3189,3193,3197,3202],{"type":14,"tag":47,"props":3180,"children":3181},{"style":71},[3182],{"type":20,"value":3183},"    else",{"type":14,"tag":47,"props":3185,"children":3186},{"style":71},[3187],{"type":20,"value":3188}," if",{"type":14,"tag":47,"props":3190,"children":3191},{"style":54},[3192],{"type":20,"value":3146},{"type":14,"tag":47,"props":3194,"children":3195},{"style":71},[3196],{"type":20,"value":137},{"type":14,"tag":47,"props":3198,"children":3199},{"style":60},[3200],{"type":20,"value":3201}," \"myName2\"",{"type":14,"tag":47,"props":3203,"children":3204},{"style":54},[3205],{"type":20,"value":148},{"type":14,"tag":47,"props":3207,"children":3208},{"class":49,"line":170},[3209,3213,3218],{"type":14,"tag":47,"props":3210,"children":3211},{"style":71},[3212],{"type":20,"value":176},{"type":14,"tag":47,"props":3214,"children":3215},{"style":140},[3216],{"type":20,"value":3217}," 20",{"type":14,"tag":47,"props":3219,"children":3220},{"style":54},[3221],{"type":20,"value":186},{"type":14,"tag":47,"props":3223,"children":3224},{"class":49,"line":189},[3225],{"type":14,"tag":47,"props":3226,"children":3227},{"style":71},[3228],{"type":20,"value":3229},"    else\n",{"type":14,"tag":47,"props":3231,"children":3232},{"class":49,"line":198},[3233,3237,3241],{"type":14,"tag":47,"props":3234,"children":3235},{"style":71},[3236],{"type":20,"value":176},{"type":14,"tag":47,"props":3238,"children":3239},{"style":140},[3240],{"type":20,"value":181},{"type":14,"tag":47,"props":3242,"children":3243},{"style":54},[3244],{"type":20,"value":186},{"type":14,"tag":47,"props":3246,"children":3247},{"class":49,"line":208},[3248],{"type":14,"tag":47,"props":3249,"children":3250},{"style":54},[3251],{"type":20,"value":258},{"type":14,"tag":22,"props":3253,"children":3254},{},[3255,3261],{"type":14,"tag":28,"props":3256,"children":3258},{"className":3257},[],[3259],{"type":20,"value":3260},"NameReferenceProvider",{"type":20,"value":3262},"は以下のように定義されています。",{"type":14,"tag":22,"props":3264,"children":3265},{},[3266],{"type":20,"value":3267},"Func\u003CReoGridCell, string, object> NameReferenceProvider { get; set; }",{"type":14,"tag":22,"props":3269,"children":3270},{},[3271,3273,3279,3281],{"type":20,"value":3272},"セルに",{"type":14,"tag":28,"props":3274,"children":3276},{"className":3275},[],[3277],{"type":20,"value":3278},"=myName1",{"type":20,"value":3280},"を入力して名前1をテストします。 ",{"type":14,"tag":273,"props":3282,"children":3285},{"alt":3283,"src":3284},"171","/document/images/171.png",[],{"type":14,"tag":22,"props":3287,"children":3288},{},[3289,3291],{"type":20,"value":3290},"この名前は値10を返します。 ",{"type":14,"tag":273,"props":3292,"children":3295},{"alt":3293,"src":3294},"172","/document/images/172.png",[],{"type":14,"tag":22,"props":3297,"children":3298},{},[3299,3300,3306,3308],{"type":20,"value":3272},{"type":14,"tag":28,"props":3301,"children":3303},{"className":3302},[],[3304],{"type":20,"value":3305},"=myName2",{"type":20,"value":3307},"を入力します。 ",{"type":14,"tag":273,"props":3309,"children":3312},{"alt":3310,"src":3311},"173","/document/images/173.png",[],{"type":14,"tag":22,"props":3314,"children":3315},{},[3316,3318],{"type":20,"value":3317},"この名前は値20を返します。 ",{"type":14,"tag":273,"props":3319,"children":3322},{"alt":3320,"src":3321},"174","/document/images/174.png",[],{"type":14,"tag":395,"props":3324,"children":3326},{"id":3325},"数学定数の追加",[3327],{"type":20,"value":3325},{"type":14,"tag":22,"props":3329,"children":3330},{},[3331],{"type":20,"value":3332},"カスタム名前参照プロバイダーを使用して、数学定数を定義することもできます。以下のコードは定数プロバイダーを定義します。",{"type":14,"tag":22,"props":3334,"children":3335},{},[3336],{"type":20,"value":501},{"type":14,"tag":37,"props":3338,"children":3340},{"className":504,"code":3339,"language":506,"meta":7,"style":7},"Shared Function MathConstantProvider(cell As ReoGridCell, name As String) As Object\n  Select Case (name)\n    Case \"PI\"\n      Return Math.PI\n\n    Case \"E\"\n      Return Math.E\n\n    Case \"MyConst\"\n      Return 1.23456\n  End Select\n\n  Return Nothing\nEnd Function\n",[3341],{"type":14,"tag":28,"props":3342,"children":3343},{"__ignoreMap":7},[3344,3398,3416,3429,3447,3454,3466,3482,3489,3501,3513,3521,3528,3539],{"type":14,"tag":47,"props":3345,"children":3346},{"class":49,"line":50},[3347,3351,3355,3360,3364,3368,3372,3377,3381,3386,3390,3394],{"type":14,"tag":47,"props":3348,"children":3349},{"style":54},[3350],{"type":20,"value":742},{"type":14,"tag":47,"props":3352,"children":3353},{"style":71},[3354],{"type":20,"value":747},{"type":14,"tag":47,"props":3356,"children":3357},{"style":86},[3358],{"type":20,"value":3359},"MathConstantProvider",{"type":14,"tag":47,"props":3361,"children":3362},{"style":54},[3363],{"type":20,"value":757},{"type":14,"tag":47,"props":3365,"children":3366},{"style":71},[3367],{"type":20,"value":762},{"type":14,"tag":47,"props":3369,"children":3370},{"style":140},[3371],{"type":20,"value":767},{"type":14,"tag":47,"props":3373,"children":3374},{"style":54},[3375],{"type":20,"value":3376},", name ",{"type":14,"tag":47,"props":3378,"children":3379},{"style":71},[3380],{"type":20,"value":762},{"type":14,"tag":47,"props":3382,"children":3383},{"style":140},[3384],{"type":20,"value":3385}," String",{"type":14,"tag":47,"props":3387,"children":3388},{"style":54},[3389],{"type":20,"value":104},{"type":14,"tag":47,"props":3391,"children":3392},{"style":71},[3393],{"type":20,"value":762},{"type":14,"tag":47,"props":3395,"children":3396},{"style":140},[3397],{"type":20,"value":795},{"type":14,"tag":47,"props":3399,"children":3400},{"class":49,"line":77},[3401,3406,3411],{"type":14,"tag":47,"props":3402,"children":3403},{"style":71},[3404],{"type":20,"value":3405},"  Select",{"type":14,"tag":47,"props":3407,"children":3408},{"style":71},[3409],{"type":20,"value":3410}," Case",{"type":14,"tag":47,"props":3412,"children":3413},{"style":54},[3414],{"type":20,"value":3415}," (name)\n",{"type":14,"tag":47,"props":3417,"children":3418},{"class":49,"line":112},[3419,3424],{"type":14,"tag":47,"props":3420,"children":3421},{"style":71},[3422],{"type":20,"value":3423},"    Case",{"type":14,"tag":47,"props":3425,"children":3426},{"style":60},[3427],{"type":20,"value":3428}," \"PI\"\n",{"type":14,"tag":47,"props":3430,"children":3431},{"class":49,"line":121},[3432,3437,3442],{"type":14,"tag":47,"props":3433,"children":3434},{"style":71},[3435],{"type":20,"value":3436},"      Return",{"type":14,"tag":47,"props":3438,"children":3439},{"style":140},[3440],{"type":20,"value":3441}," Math",{"type":14,"tag":47,"props":3443,"children":3444},{"style":54},[3445],{"type":20,"value":3446},".PI\n",{"type":14,"tag":47,"props":3448,"children":3449},{"class":49,"line":151},[3450],{"type":14,"tag":47,"props":3451,"children":3452},{"emptyLinePlaceholder":202},[3453],{"type":20,"value":205},{"type":14,"tag":47,"props":3455,"children":3456},{"class":49,"line":160},[3457,3461],{"type":14,"tag":47,"props":3458,"children":3459},{"style":71},[3460],{"type":20,"value":3423},{"type":14,"tag":47,"props":3462,"children":3463},{"style":60},[3464],{"type":20,"value":3465}," \"E\"\n",{"type":14,"tag":47,"props":3467,"children":3468},{"class":49,"line":170},[3469,3473,3477],{"type":14,"tag":47,"props":3470,"children":3471},{"style":71},[3472],{"type":20,"value":3436},{"type":14,"tag":47,"props":3474,"children":3475},{"style":140},[3476],{"type":20,"value":3441},{"type":14,"tag":47,"props":3478,"children":3479},{"style":54},[3480],{"type":20,"value":3481},".E\n",{"type":14,"tag":47,"props":3483,"children":3484},{"class":49,"line":189},[3485],{"type":14,"tag":47,"props":3486,"children":3487},{"emptyLinePlaceholder":202},[3488],{"type":20,"value":205},{"type":14,"tag":47,"props":3490,"children":3491},{"class":49,"line":198},[3492,3496],{"type":14,"tag":47,"props":3493,"children":3494},{"style":71},[3495],{"type":20,"value":3423},{"type":14,"tag":47,"props":3497,"children":3498},{"style":60},[3499],{"type":20,"value":3500}," \"MyConst\"\n",{"type":14,"tag":47,"props":3502,"children":3503},{"class":49,"line":208},[3504,3508],{"type":14,"tag":47,"props":3505,"children":3506},{"style":71},[3507],{"type":20,"value":3436},{"type":14,"tag":47,"props":3509,"children":3510},{"style":140},[3511],{"type":20,"value":3512}," 1.23456\n",{"type":14,"tag":47,"props":3514,"children":3515},{"class":49,"line":252},[3516],{"type":14,"tag":47,"props":3517,"children":3518},{"style":71},[3519],{"type":20,"value":3520},"  End Select\n",{"type":14,"tag":47,"props":3522,"children":3523},{"class":49,"line":2435},[3524],{"type":14,"tag":47,"props":3525,"children":3526},{"emptyLinePlaceholder":202},[3527],{"type":20,"value":205},{"type":14,"tag":47,"props":3529,"children":3530},{"class":49,"line":2444},[3531,3535],{"type":14,"tag":47,"props":3532,"children":3533},{"style":71},[3534],{"type":20,"value":803},{"type":14,"tag":47,"props":3536,"children":3537},{"style":140},[3538],{"type":20,"value":566},{"type":14,"tag":47,"props":3540,"children":3541},{"class":49,"line":2498},[3542],{"type":14,"tag":47,"props":3543,"children":3544},{"style":71},[3545],{"type":20,"value":574},{"type":14,"tag":22,"props":3547,"children":3548},{},[3549],{"type":20,"value":3550},"この名前参照プロバイダーを適用します。",{"type":14,"tag":37,"props":3552,"children":3554},{"className":504,"code":3553,"language":506,"meta":7,"style":7},"FormulaExtension.NameReferenceProvider = AddressOf MathConstantProvider\n",[3555],{"type":14,"tag":28,"props":3556,"children":3557},{"__ignoreMap":7},[3558],{"type":14,"tag":47,"props":3559,"children":3560},{"class":49,"line":50},[3561,3566,3570],{"type":14,"tag":47,"props":3562,"children":3563},{"style":54},[3564],{"type":20,"value":3565},"FormulaExtension.NameReferenceProvider ",{"type":14,"tag":47,"props":3567,"children":3568},{"style":71},[3569],{"type":20,"value":433},{"type":14,"tag":47,"props":3571,"children":3572},{"style":54},[3573],{"type":20,"value":3574}," AddressOf MathConstantProvider\n",{"type":14,"tag":22,"props":3576,"children":3577},{},[3578],{"type":20,"value":3579},"そして数式で定数を使用します。",{"type":14,"tag":37,"props":3581,"children":3583},{"className":39,"code":3582,"language":41,"meta":7,"style":7},"worksheet(\"A1\") = \"=MyConst\"\n",[3584],{"type":14,"tag":28,"props":3585,"children":3586},{"__ignoreMap":7},[3587],{"type":14,"tag":47,"props":3588,"children":3589},{"class":49,"line":50},[3590,3595,3599,3603,3607,3611],{"type":14,"tag":47,"props":3591,"children":3592},{"style":86},[3593],{"type":20,"value":3594},"worksheet",{"type":14,"tag":47,"props":3596,"children":3597},{"style":54},[3598],{"type":20,"value":527},{"type":14,"tag":47,"props":3600,"children":3601},{"style":60},[3602],{"type":20,"value":888},{"type":14,"tag":47,"props":3604,"children":3605},{"style":54},[3606],{"type":20,"value":104},{"type":14,"tag":47,"props":3608,"children":3609},{"style":71},[3610],{"type":20,"value":433},{"type":14,"tag":47,"props":3612,"children":3613},{"style":60},[3614],{"type":20,"value":3615}," \"=MyConst\"\n",{"type":14,"tag":22,"props":3617,"children":3618},{},[3619,3621],{"type":20,"value":3620},"結果:\n",{"type":14,"tag":273,"props":3622,"children":3625},{"alt":3623,"src":3624},"181","/document/images/181.png",[],{"type":14,"tag":15,"props":3627,"children":3629},{"id":3628},"カスタム関数とカスタム名前プロバイダーの組み合わせ",[3630],{"type":20,"value":3628},{"type":14,"tag":22,"props":3632,"children":3633},{},[3634],{"type":20,"value":3635},"カスタム関数内でカスタム名前プロバイダーを使用することもサポートされています。名前は値に変換されて関数に渡されます。",{"type":14,"tag":37,"props":3637,"children":3639},{"className":39,"code":3638,"language":41,"meta":7,"style":7},"FormulaExtension.NameReferenceProvider = (cell, name) =>\n{\n  switch (name)\n  {\n    case \"Pi\": return Math.PI;\n    case \"E\": return Math.E;\n    default: return null;\n  }\n};\n",[3640],{"type":14,"tag":28,"props":3641,"children":3642},{"__ignoreMap":7},[3643,3678,3685,3697,3704,3732,3757,3781,3788],{"type":14,"tag":47,"props":3644,"children":3645},{"class":49,"line":50},[3646,3650,3654,3658,3662,3666,3670,3674],{"type":14,"tag":47,"props":3647,"children":3648},{"style":54},[3649],{"type":20,"value":3565},{"type":14,"tag":47,"props":3651,"children":3652},{"style":71},[3653],{"type":20,"value":433},{"type":14,"tag":47,"props":3655,"children":3656},{"style":54},[3657],{"type":20,"value":438},{"type":14,"tag":47,"props":3659,"children":3660},{"style":86},[3661],{"type":20,"value":89},{"type":14,"tag":47,"props":3663,"children":3664},{"style":54},[3665],{"type":20,"value":94},{"type":14,"tag":47,"props":3667,"children":3668},{"style":86},[3669],{"type":20,"value":3119},{"type":14,"tag":47,"props":3671,"children":3672},{"style":54},[3673],{"type":20,"value":104},{"type":14,"tag":47,"props":3675,"children":3676},{"style":71},[3677],{"type":20,"value":109},{"type":14,"tag":47,"props":3679,"children":3680},{"class":49,"line":77},[3681],{"type":14,"tag":47,"props":3682,"children":3683},{"style":54},[3684],{"type":20,"value":663},{"type":14,"tag":47,"props":3686,"children":3687},{"class":49,"line":112},[3688,3693],{"type":14,"tag":47,"props":3689,"children":3690},{"style":71},[3691],{"type":20,"value":3692},"  switch",{"type":14,"tag":47,"props":3694,"children":3695},{"style":54},[3696],{"type":20,"value":3415},{"type":14,"tag":47,"props":3698,"children":3699},{"class":49,"line":121},[3700],{"type":14,"tag":47,"props":3701,"children":3702},{"style":54},[3703],{"type":20,"value":118},{"type":14,"tag":47,"props":3705,"children":3706},{"class":49,"line":151},[3707,3712,3717,3722,3727],{"type":14,"tag":47,"props":3708,"children":3709},{"style":71},[3710],{"type":20,"value":3711},"    case",{"type":14,"tag":47,"props":3713,"children":3714},{"style":60},[3715],{"type":20,"value":3716}," \"Pi\"",{"type":14,"tag":47,"props":3718,"children":3719},{"style":54},[3720],{"type":20,"value":3721},": ",{"type":14,"tag":47,"props":3723,"children":3724},{"style":71},[3725],{"type":20,"value":3726},"return",{"type":14,"tag":47,"props":3728,"children":3729},{"style":54},[3730],{"type":20,"value":3731}," Math.PI;\n",{"type":14,"tag":47,"props":3733,"children":3734},{"class":49,"line":160},[3735,3739,3744,3748,3752],{"type":14,"tag":47,"props":3736,"children":3737},{"style":71},[3738],{"type":20,"value":3711},{"type":14,"tag":47,"props":3740,"children":3741},{"style":60},[3742],{"type":20,"value":3743}," \"E\"",{"type":14,"tag":47,"props":3745,"children":3746},{"style":54},[3747],{"type":20,"value":3721},{"type":14,"tag":47,"props":3749,"children":3750},{"style":71},[3751],{"type":20,"value":3726},{"type":14,"tag":47,"props":3753,"children":3754},{"style":54},[3755],{"type":20,"value":3756}," Math.E;\n",{"type":14,"tag":47,"props":3758,"children":3759},{"class":49,"line":170},[3760,3765,3769,3773,3777],{"type":14,"tag":47,"props":3761,"children":3762},{"style":71},[3763],{"type":20,"value":3764},"    default",{"type":14,"tag":47,"props":3766,"children":3767},{"style":54},[3768],{"type":20,"value":3721},{"type":14,"tag":47,"props":3770,"children":3771},{"style":71},[3772],{"type":20,"value":3726},{"type":14,"tag":47,"props":3774,"children":3775},{"style":140},[3776],{"type":20,"value":181},{"type":14,"tag":47,"props":3778,"children":3779},{"style":54},[3780],{"type":20,"value":186},{"type":14,"tag":47,"props":3782,"children":3783},{"class":49,"line":189},[3784],{"type":14,"tag":47,"props":3785,"children":3786},{"style":54},[3787],{"type":20,"value":1338},{"type":14,"tag":47,"props":3789,"children":3790},{"class":49,"line":198},[3791],{"type":14,"tag":47,"props":3792,"children":3793},{"style":54},[3794],{"type":20,"value":496},{"type":14,"tag":22,"props":3796,"children":3797},{},[3798,3800,3806],{"type":20,"value":3799},"カスタム関数で名前",{"type":14,"tag":28,"props":3801,"children":3803},{"className":3802},[],[3804],{"type":20,"value":3805},"Pi",{"type":20,"value":3807},"を使用します。",{"type":14,"tag":37,"props":3809,"children":3811},{"className":39,"code":3810,"language":41,"meta":7,"style":7},"worksheet[\"D3\"] = \"=Div100(Pi)\";\nAssertSame(worksheet[\"D3\"], Math.PI / 100);\n",[3812],{"type":14,"tag":28,"props":3813,"children":3814},{"__ignoreMap":7},[3815,3844],{"type":14,"tag":47,"props":3816,"children":3817},{"class":49,"line":50},[3818,3822,3827,3831,3835,3840],{"type":14,"tag":47,"props":3819,"children":3820},{"style":54},[3821],{"type":20,"value":883},{"type":14,"tag":47,"props":3823,"children":3824},{"style":60},[3825],{"type":20,"value":3826},"\"D3\"",{"type":14,"tag":47,"props":3828,"children":3829},{"style":54},[3830],{"type":20,"value":68},{"type":14,"tag":47,"props":3832,"children":3833},{"style":71},[3834],{"type":20,"value":433},{"type":14,"tag":47,"props":3836,"children":3837},{"style":60},[3838],{"type":20,"value":3839}," \"=Div100(Pi)\"",{"type":14,"tag":47,"props":3841,"children":3842},{"style":54},[3843],{"type":20,"value":186},{"type":14,"tag":47,"props":3845,"children":3846},{"class":49,"line":77},[3847,3851,3855,3859,3864,3869,3874],{"type":14,"tag":47,"props":3848,"children":3849},{"style":86},[3850],{"type":20,"value":3048},{"type":14,"tag":47,"props":3852,"children":3853},{"style":54},[3854],{"type":20,"value":3053},{"type":14,"tag":47,"props":3856,"children":3857},{"style":60},[3858],{"type":20,"value":3826},{"type":14,"tag":47,"props":3860,"children":3861},{"style":54},[3862],{"type":20,"value":3863},"], Math.PI ",{"type":14,"tag":47,"props":3865,"children":3866},{"style":71},[3867],{"type":20,"value":3868},"/",{"type":14,"tag":47,"props":3870,"children":3871},{"style":140},[3872],{"type":20,"value":3873}," 100",{"type":14,"tag":47,"props":3875,"children":3876},{"style":54},[3877],{"type":20,"value":2768},{"type":14,"tag":15,"props":3879,"children":3881},{"id":3880},"reoscript言語のカスタム関数の追加",[3882],{"type":20,"value":3883},"ReoScript言語のカスタム関数の追加",{"type":14,"tag":22,"props":3885,"children":3886},{},[3887],{"type":20,"value":3888},"ReoScriptモジュール拡張が有効な場合、ReoScript言語を使用してセルデータ、スタイル、罫線、データフォーマットなどを処理できます。ExcelのVBAに似た機能です。ReoScriptは.NET拡張をサポートしており、スクリプトから.NET関数を呼び出すことができます。",{"type":14,"tag":22,"props":3890,"children":3891},{},[3892],{"type":20,"value":3893},"ReoGridはReoScriptカスタム拡張関数の呼び出しをサポートしています。",{"type":14,"tag":3895,"props":3896,"children":3897},"blockquote",{},[3898],{"type":14,"tag":22,"props":3899,"children":3900},{},[3901,3907,3909],{"type":14,"tag":3902,"props":3903,"children":3904},"strong",{},[3905],{"type":20,"value":3906},"注意:",{"type":20,"value":3908}," ReoScript言語拡張はFullリリースパッケージでのみ利用可能です。\n",{"type":14,"tag":273,"props":3910,"children":3913},{"alt":3911,"src":3912},"178","/document/images/178.png",[],{"type":14,"tag":395,"props":3915,"children":3917},{"id":3916},"cでreoscript関数を追加する",[3918],{"type":20,"value":3919},"C#でReoScript関数を追加する",{"type":14,"tag":22,"props":3921,"children":3922},{},[3923],{"type":20,"value":3924},"コントロールを拡張するカスタム関数を追加します。",{"type":14,"tag":37,"props":3926,"children":3928},{"className":39,"code":3927,"language":41,"meta":7,"style":7},"workbook.Srm[\"sqrt\"] = new NativeFunctionObject(\"sqrt\", (ctx, owner, args) =>\n{\n    if (args.Length \u003C 1)\n        return NaNValue.Value;\n    else\n        return Math.Sqrt(ScriptRunningMachine.GetDoubleValue(args[0], 0));\n});\n",[3929],{"type":14,"tag":28,"props":3930,"children":3931},{"__ignoreMap":7},[3932,4005,4012,4035,4048,4055,4103],{"type":14,"tag":47,"props":3933,"children":3934},{"class":49,"line":50},[3935,3940,3945,3949,3953,3957,3962,3966,3970,3975,3980,3984,3989,3993,3997,4001],{"type":14,"tag":47,"props":3936,"children":3937},{"style":54},[3938],{"type":20,"value":3939},"workbook.Srm[",{"type":14,"tag":47,"props":3941,"children":3942},{"style":60},[3943],{"type":20,"value":3944},"\"sqrt\"",{"type":14,"tag":47,"props":3946,"children":3947},{"style":54},[3948],{"type":20,"value":68},{"type":14,"tag":47,"props":3950,"children":3951},{"style":71},[3952],{"type":20,"value":433},{"type":14,"tag":47,"props":3954,"children":3955},{"style":71},[3956],{"type":20,"value":2072},{"type":14,"tag":47,"props":3958,"children":3959},{"style":86},[3960],{"type":20,"value":3961}," NativeFunctionObject",{"type":14,"tag":47,"props":3963,"children":3964},{"style":54},[3965],{"type":20,"value":527},{"type":14,"tag":47,"props":3967,"children":3968},{"style":60},[3969],{"type":20,"value":3944},{"type":14,"tag":47,"props":3971,"children":3972},{"style":54},[3973],{"type":20,"value":3974},", (",{"type":14,"tag":47,"props":3976,"children":3977},{"style":86},[3978],{"type":20,"value":3979},"ctx",{"type":14,"tag":47,"props":3981,"children":3982},{"style":54},[3983],{"type":20,"value":94},{"type":14,"tag":47,"props":3985,"children":3986},{"style":86},[3987],{"type":20,"value":3988},"owner",{"type":14,"tag":47,"props":3990,"children":3991},{"style":54},[3992],{"type":20,"value":94},{"type":14,"tag":47,"props":3994,"children":3995},{"style":86},[3996],{"type":20,"value":99},{"type":14,"tag":47,"props":3998,"children":3999},{"style":54},[4000],{"type":20,"value":104},{"type":14,"tag":47,"props":4002,"children":4003},{"style":71},[4004],{"type":20,"value":109},{"type":14,"tag":47,"props":4006,"children":4007},{"class":49,"line":77},[4008],{"type":14,"tag":47,"props":4009,"children":4010},{"style":54},[4011],{"type":20,"value":663},{"type":14,"tag":47,"props":4013,"children":4014},{"class":49,"line":112},[4015,4019,4023,4027,4031],{"type":14,"tag":47,"props":4016,"children":4017},{"style":71},[4018],{"type":20,"value":127},{"type":14,"tag":47,"props":4020,"children":4021},{"style":54},[4022],{"type":20,"value":132},{"type":14,"tag":47,"props":4024,"children":4025},{"style":71},[4026],{"type":20,"value":354},{"type":14,"tag":47,"props":4028,"children":4029},{"style":140},[4030],{"type":20,"value":1687},{"type":14,"tag":47,"props":4032,"children":4033},{"style":54},[4034],{"type":20,"value":148},{"type":14,"tag":47,"props":4036,"children":4037},{"class":49,"line":121},[4038,4043],{"type":14,"tag":47,"props":4039,"children":4040},{"style":71},[4041],{"type":20,"value":4042},"        return",{"type":14,"tag":47,"props":4044,"children":4045},{"style":54},[4046],{"type":20,"value":4047}," NaNValue.Value;\n",{"type":14,"tag":47,"props":4049,"children":4050},{"class":49,"line":151},[4051],{"type":14,"tag":47,"props":4052,"children":4053},{"style":71},[4054],{"type":20,"value":3229},{"type":14,"tag":47,"props":4056,"children":4057},{"class":49,"line":160},[4058,4062,4067,4072,4077,4082,4086,4090,4094,4098],{"type":14,"tag":47,"props":4059,"children":4060},{"style":71},[4061],{"type":20,"value":4042},{"type":14,"tag":47,"props":4063,"children":4064},{"style":54},[4065],{"type":20,"value":4066}," Math.",{"type":14,"tag":47,"props":4068,"children":4069},{"style":86},[4070],{"type":20,"value":4071},"Sqrt",{"type":14,"tag":47,"props":4073,"children":4074},{"style":54},[4075],{"type":20,"value":4076},"(ScriptRunningMachine.",{"type":14,"tag":47,"props":4078,"children":4079},{"style":86},[4080],{"type":20,"value":4081},"GetDoubleValue",{"type":14,"tag":47,"props":4083,"children":4084},{"style":54},[4085],{"type":20,"value":229},{"type":14,"tag":47,"props":4087,"children":4088},{"style":140},[4089],{"type":20,"value":234},{"type":14,"tag":47,"props":4091,"children":4092},{"style":54},[4093],{"type":20,"value":3062},{"type":14,"tag":47,"props":4095,"children":4096},{"style":140},[4097],{"type":20,"value":234},{"type":14,"tag":47,"props":4099,"children":4100},{"style":54},[4101],{"type":20,"value":4102},"));\n",{"type":14,"tag":47,"props":4104,"children":4105},{"class":49,"line":170},[4106],{"type":14,"tag":47,"props":4107,"children":4108},{"style":54},[4109],{"type":20,"value":4110},"});\n",{"type":14,"tag":22,"props":4112,"children":4113},{},[4114],{"type":20,"value":4115},"テスト:",{"type":14,"tag":37,"props":4117,"children":4119},{"className":39,"code":4118,"language":41,"meta":7,"style":7},"var worksheet = workbook.CurrentWorksheet;\n\nworksheet[2, 1] = \"=sqrt(400)\";\n",[4120],{"type":14,"tag":28,"props":4121,"children":4122},{"__ignoreMap":7},[4123,4144,4151],{"type":14,"tag":47,"props":4124,"children":4125},{"class":49,"line":50},[4126,4131,4135,4139],{"type":14,"tag":47,"props":4127,"children":4128},{"style":71},[4129],{"type":20,"value":4130},"var",{"type":14,"tag":47,"props":4132,"children":4133},{"style":86},[4134],{"type":20,"value":1133},{"type":14,"tag":47,"props":4136,"children":4137},{"style":71},[4138],{"type":20,"value":1138},{"type":14,"tag":47,"props":4140,"children":4141},{"style":54},[4142],{"type":20,"value":4143}," workbook.CurrentWorksheet;\n",{"type":14,"tag":47,"props":4145,"children":4146},{"class":49,"line":77},[4147],{"type":14,"tag":47,"props":4148,"children":4149},{"emptyLinePlaceholder":202},[4150],{"type":20,"value":205},{"type":14,"tag":47,"props":4152,"children":4153},{"class":49,"line":112},[4154,4158,4162,4166,4170,4174,4178,4183],{"type":14,"tag":47,"props":4155,"children":4156},{"style":54},[4157],{"type":20,"value":883},{"type":14,"tag":47,"props":4159,"children":4160},{"style":140},[4161],{"type":20,"value":2095},{"type":14,"tag":47,"props":4163,"children":4164},{"style":54},[4165],{"type":20,"value":94},{"type":14,"tag":47,"props":4167,"children":4168},{"style":140},[4169],{"type":20,"value":2086},{"type":14,"tag":47,"props":4171,"children":4172},{"style":54},[4173],{"type":20,"value":68},{"type":14,"tag":47,"props":4175,"children":4176},{"style":71},[4177],{"type":20,"value":433},{"type":14,"tag":47,"props":4179,"children":4180},{"style":60},[4181],{"type":20,"value":4182}," \"=sqrt(400)\"",{"type":14,"tag":47,"props":4184,"children":4185},{"style":54},[4186],{"type":20,"value":186},{"type":14,"tag":22,"props":4188,"children":4189},{},[4190],{"type":14,"tag":273,"props":4191,"children":4194},{"alt":4192,"src":4193},"44","/document/images/44.png",[],{"type":14,"tag":22,"props":4196,"children":4197},{},[4198,4200],{"type":20,"value":4199},"セルをダブルクリックして数式を確認します。 ",{"type":14,"tag":273,"props":4201,"children":4204},{"alt":4202,"src":4203},"43","/document/images/43.png",[],{"type":14,"tag":22,"props":4206,"children":4207},{},[4208],{"type":20,"value":4209},"カスタム関数はスクリプト内でも使用できます。",{"type":14,"tag":15,"props":4211,"children":4213},{"id":4212},"reoscriptコンテキストでのカスタム関数",[4214],{"type":20,"value":4215},"ReoScriptコンテキストでのカスタム関数",{"type":14,"tag":22,"props":4217,"children":4218},{},[4219,4225,4227,4233,4235],{"type":14,"tag":28,"props":4220,"children":4222},{"className":4221},[],[4223],{"type":20,"value":4224},"workbook",{"type":20,"value":4226},"オブジェクトは、数式とスクリプトの両方で利用可能なグローバルオブジェクトです（JavaScriptの",{"type":14,"tag":28,"props":4228,"children":4230},{"className":4229},[],[4231],{"type":20,"value":4232},"window",{"type":20,"value":4234},"に似ています）。 ",{"type":14,"tag":273,"props":4236,"children":4239},{"alt":4237,"src":4238},"Custom Function","/document/images/45.png",[],{"type":14,"tag":22,"props":4241,"children":4242},{},[4243,4245],{"type":20,"value":4244},"上記のコードを一度実行してから、数式で使用します。 ",{"type":14,"tag":273,"props":4246,"children":4249},{"alt":4247,"src":4248},"Using Custom Function","/document/images/46.png",[],{"type":14,"tag":22,"props":4251,"children":4252},{},[4253,4255],{"type":20,"value":4254},"Enterを押します。 ",{"type":14,"tag":273,"props":4256,"children":4259},{"alt":4257,"src":4258},"View Result of Custom Function","/document/images/47-2.png",[],{"type":14,"tag":15,"props":4261,"children":4263},{"id":4262},"cでスクリプトを実行して関数を追加する",[4264],{"type":20,"value":4265},"C#でスクリプトを実行して関数を追加する",{"type":14,"tag":22,"props":4267,"children":4268},{},[4269],{"type":20,"value":4270},"C#でスクリプトを実行してReoScript関数を作成することも可能です。以下はReoScriptのラムダ式を使用して新しい関数を作成する例です。",{"type":14,"tag":37,"props":4272,"children":4274},{"className":39,"code":4273,"language":41,"meta":7,"style":7},"grid.RunScript(\"script.myfunc = data => '[' + data + ']';\");\n",[4275],{"type":14,"tag":28,"props":4276,"children":4277},{"__ignoreMap":7},[4278],{"type":14,"tag":47,"props":4279,"children":4280},{"class":49,"line":50},[4281,4286,4291,4295,4300],{"type":14,"tag":47,"props":4282,"children":4283},{"style":54},[4284],{"type":20,"value":4285},"grid.",{"type":14,"tag":47,"props":4287,"children":4288},{"style":86},[4289],{"type":20,"value":4290},"RunScript",{"type":14,"tag":47,"props":4292,"children":4293},{"style":54},[4294],{"type":20,"value":527},{"type":14,"tag":47,"props":4296,"children":4297},{"style":60},[4298],{"type":20,"value":4299},"\"script.myfunc = data => '[' + data + ']';\"",{"type":14,"tag":47,"props":4301,"children":4302},{"style":54},[4303],{"type":20,"value":2768},{"type":14,"tag":4305,"props":4306,"children":4307},"style",{},[4308],{"type":20,"value":4309},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":77,"depth":77,"links":4311},[4312,4313,4320,4324,4329,4332,4333,4336,4337],{"id":17,"depth":77,"text":17},{"id":290,"depth":77,"text":293,"children":4314},[4315,4316,4317,4318,4319],{"id":397,"depth":112,"text":397},{"id":577,"depth":112,"text":577},{"id":861,"depth":112,"text":861},{"id":1040,"depth":112,"text":1040},{"id":1348,"depth":112,"text":1348},{"id":1505,"depth":77,"text":1505,"children":4321},[4322,4323],{"id":1563,"depth":112,"text":1563},{"id":1782,"depth":112,"text":1782},{"id":2010,"depth":77,"text":2010,"children":4325},[4326,4327,4328],{"id":2015,"depth":112,"text":2015},{"id":2025,"depth":112,"text":2025},{"id":2713,"depth":112,"text":2713},{"id":3073,"depth":77,"text":3073,"children":4330},[4331],{"id":3325,"depth":112,"text":3325},{"id":3628,"depth":77,"text":3628},{"id":3880,"depth":77,"text":3883,"children":4334},[4335],{"id":3916,"depth":112,"text":3919},{"id":4212,"depth":77,"text":4215},{"id":4262,"depth":77,"text":4265},"markdown","content:document:8.formula:2.custom-function.md","content","document/8.formula/2.custom-function.md","document/8.formula/2.custom-function","md",{"loc":4},[4346,4668,4671,4674,4677,4680,4683,4686,4689],{"title":4347,"_path":4348,"children":4349},"Document","/document",[4350,4361,4366,4398,4415,4444,4476,4496,4507,4530,4541,4557,4580,4591,4611,4631,4660],{"title":4351,"_path":4352,"children":4353},"はじめに","/document/getting-started",[4354,4355,4358],{"title":4351,"_path":4352},{"title":4356,"_path":4357},"インストール","/document/getting-started/installation",{"title":4359,"_path":4360},"V3 から V4 への移行ガイド","/document/getting-started/migrate-from-v3",{"title":4362,"_path":4363,"children":4364},"ワークブック","/document/workbook",[4365],{"title":4362,"_path":4363},{"title":4367,"_path":4368,"children":4369},"ワークシート","/document/worksheet",[4370,4371,4374,4377,4380,4383,4386,4389,4392,4395],{"title":4367,"_path":4368},{"title":4372,"_path":4373},"行、列、ヘッダー","/document/worksheet/row-and-column",{"title":4375,"_path":4376},"範囲","/document/worksheet/range",{"title":4378,"_path":4379},"名前付き範囲","/document/worksheet/named-range",{"title":4381,"_path":4382},"セルの結合と解除","/document/worksheet/merge-and-unmerge",{"title":4384,"_path":4385},"パーシャルグリッド","/document/worksheet/partial-grid",{"title":4387,"_path":4388},"複数行ヘッダー","/document/worksheet/multiple-row-header",{"title":4390,"_path":4391},"ウィンドウ枠の固定","/document/worksheet/freeze",{"title":4393,"_path":4394},"ズーム","/document/worksheet/zoom",{"title":4396,"_path":4397},"設定とオプション","/document/worksheet/settings",{"title":4399,"_path":4400,"children":4401},"選択とナビゲーション","/document/selection",[4402,4403,4406,4409,4412],{"title":4399,"_path":4400},{"title":4404,"_path":4405},"フォーカスと選択","/document/selection/selection",{"title":4407,"_path":4408},"範囲の選択","/document/selection/pick-range",{"title":4410,"_path":4411},"クリップボード","/document/selection/clipboard",{"title":4413,"_path":4414},"テキスト検索","/document/selection/text-search",{"title":4416,"_path":4417,"children":4418},"データ管理","/document/data",[4419,4420,4423,4426,4429,4432,4435,4438,4441],{"title":4416,"_path":4417},{"title":4421,"_path":4422},"データソース","/document/data/datasource",{"title":4424,"_path":4425},"データフィルタリング","/document/data/data-filtering",{"title":4427,"_path":4428},"組み込みオートフィルター","/document/data/builtin-autofilter",{"title":4430,"_path":4431},"条件付きフィルター","/document/data/conditional-filter",{"title":4433,"_path":4434},"条件付きスタイル","/document/data/conditional-styles",{"title":4436,"_path":4437},"グループとアウトライン","/document/data/group-and-outline",{"title":4439,"_path":4440},"データバリデーション","/document/data/data-validation",{"title":4442,"_path":4443},"保護とロック","/document/data/protection",{"title":4445,"_path":4446,"children":4447},"セル","/document/cell",[4448,4449,4452,4455,4458,4461,4464,4467,4470,4473],{"title":4445,"_path":4446},{"title":4450,"_path":4451},"セルの編集","/document/cell/cell-edit",{"title":4453,"_path":4454},"スタイル","/document/cell/style",{"title":4456,"_path":4457},"罫線","/document/cell/border",{"title":4459,"_path":4460},"データ書式","/document/cell/data-format",{"title":4462,"_path":4463},"カスタムデータフォーマッター","/document/cell/custom-data-formatter",{"title":4465,"_path":4466},"データ連続入力","/document/cell/auto-fill",{"title":4468,"_path":4469},"リッチフォーマットテキスト","/document/cell/rich-format-text",{"title":4471,"_path":4472},"セルテキストの回転","/document/cell/rotate-cell-text",{"title":4474,"_path":4475},"セルの反復処理","/document/cell/iterate-cells",{"title":4477,"_path":4478,"children":4479},"セルタイプ","/document/cell-types",[4480,4481,4484,4487,4490,4493],{"title":4477,"_path":4478},{"title":4482,"_path":4483},"組み込みセルタイプ","/document/cell-types/built-in-cell-types",{"title":4485,"_path":4486},"カスタムセル","/document/cell-types/custom-cell",{"title":4488,"_path":4489},"ドロップダウンリストセル","/document/cell-types/dropdown-list-cell",{"title":4491,"_path":4492},"コンボリストセル","/document/cell-types/combo-list-cell",{"title":4494,"_path":4495},"列全体のセルタイプ","/document/cell-types/cells-type-for-entire-column",{"title":263,"_path":4497,"children":4498},"/document/formula",[4499,4500,4501,4504],{"title":263,"_path":4497},{"title":8,"_path":4},{"title":4502,"_path":4503},"数式関数","/document/formula/formula-functions",{"title":4505,"_path":4506},"VLOOKUP","/document/formula/vlookup",{"title":4508,"_path":4509,"children":4510},"チャート","/document/chart",[4511,4512,4515,4518,4521,4524,4527],{"title":4508,"_path":4509},{"title":4513,"_path":4514},"縦棒グラフ","/document/chart/column-chart",{"title":4516,"_path":4517},"横棒グラフ","/document/chart/bar-chart",{"title":4519,"_path":4520},"折れ線グラフ","/document/chart/line-chart",{"title":4522,"_path":4523},"面グラフ","/document/chart/area-chart",{"title":4525,"_path":4526},"2D円グラフ","/document/chart/pie-2d-chart",{"title":4528,"_path":4529},"ドーナツグラフ","/document/chart/doughnut-chart",{"title":4531,"_path":4532,"children":4533},"フローティングオブジェクト","/document/floating",[4534,4535,4538],{"title":4531,"_path":4532},{"title":4536,"_path":4537},"描画シェイプ","/document/floating/drawing-shapes",{"title":4539,"_path":4540},"フローティング画像","/document/floating/floating-image",{"title":4542,"_path":4543,"children":4544},"イベント","/document/events",[4545,4546,4548,4551,4554],{"title":4542,"_path":4543},{"title":4542,"_path":4547},"/document/events/events",{"title":4549,"_path":4550},"キーボードイベント","/document/events/keyboard-events",{"title":4552,"_path":4553},"マウスイベント","/document/events/mouse-events",{"title":4555,"_path":4556},"SelectionRangeChanged","/document/events/selection-events",{"title":4558,"_path":4559,"children":4560},"カスタマイズ","/document/customization",[4561,4562,4565,4568,4571,4574,4577],{"title":4558,"_path":4559},{"title":4563,"_path":4564},"コントロールの外観","/document/customization/control-appearance",{"title":4566,"_path":4567},"シートタブコントロール","/document/customization/sheet-tab-control",{"title":4569,"_path":4570},"使用可能なホットキー","/document/customization/hot-keys",{"title":4572,"_path":4573},"言語ローカライズ","/document/customization/language-localization",{"title":4575,"_path":4576},"アドレスバーと数式バー","/document/customization/formula-bar",{"title":4578,"_path":4579},"ReoGridEditor","/document/customization/editor",{"title":4581,"_path":4582,"children":4583},"アクション","/document/actions",[4584,4585,4588],{"title":4581,"_path":4582},{"title":4586,"_path":4587},"ReoGridアクションフレームワーク","/document/actions/actions",{"title":4589,"_path":4590},"組み込みワークシートアクション","/document/actions/built-in-actions",{"title":4592,"_path":4593,"children":4594},"ファイル形式","/document/io",[4595,4596,4599,4602,4605,4608],{"title":4592,"_path":4593},{"title":4597,"_path":4598},"Excelファイル形式 (xlsx)","/document/io/excel-file-format",{"title":4600,"_path":4601},"CSV形式","/document/io/csv-format",{"title":4603,"_path":4604},"RGF形式","/document/io/rgf-format",{"title":4606,"_path":4607},"Excel形式とRGF形式の違い","/document/io/difference-between-excel-and-rgf-format",{"title":4609,"_path":4610},"HTMLとしてエクスポート","/document/io/export-as-html",{"title":4612,"_path":4613,"children":4614},"高度な機能","/document/advanced",[4615,4616,4619,4622,4625,4628],{"title":4612,"_path":4613},{"title":4617,"_path":4618},"メモリワークブック","/document/advanced/memory-workbook",{"title":4620,"_path":4621},"ページングと印刷","/document/advanced/paging-and-print",{"title":4623,"_path":4624},"コントロールのリセット","/document/advanced/reset-control",{"title":4626,"_path":4627},"パフォーマンス","/document/advanced/performance",{"title":4629,"_path":4630},"設定","/document/advanced/settings",{"title":4632,"_path":4633,"children":4634},"ハウツーガイド","/document/how-to",[4635,4636,4639,4642,4645,4648,4651,4654,4657],{"title":4632,"_path":4633},{"title":4637,"_path":4638},"ReoGridの推奨プラクティス","/document/how-to/recommended-practice-for-using-reogrid",{"title":4640,"_path":4641},"DataTableでスプレッドシートを埋める","/document/how-to/fill-grid-with-datatable",{"title":4643,"_path":4644},"遅延読み込みモードによる大量データの高速読み込み","/document/how-to/fast-load-large-data-with-lazy-load-mode",{"title":4646,"_path":4647},"カスタムドロップダウンセルの作成","/document/how-to/create-custom-drop-down-cell",{"title":4649,"_path":4650},"日付ピッカーセルの作成","/document/how-to/create-date-picker-cell",{"title":4652,"_path":4653},"Excelファイルからすべての画像を読み取る","/document/how-to/read-all-images-from-excel-file",{"title":4655,"_path":4656},"VB.NETでReoGridを使用するためのヒント","/document/how-to/use-reogrid-in-vb-net",{"title":4658,"_path":4659},"全選択チェックボックスヘッダーの作成","/document/how-to/create-select-all-checkbox-header",{"title":4661,"_path":4662,"children":4663},"トラブルシューティング","/document/troubleshooting",[4664,4665],{"title":4661,"_path":4662},{"title":4666,"_path":4667},"PInvoke例外の修正","/document/troubleshooting/fix-pinvoke-exception",{"title":4669,"_path":4670},"エディション・機能一覧","/editions-features",{"title":4672,"_path":4673},"個人情報保護方針","/privacy-policy",{"title":4675,"_path":4676},"動作環境","/requirements",{"title":4678,"_path":4679},"ReoGrid利用許諾契約書","/terms",{"title":4681,"_path":4682},"ReoGrid利用許諾契約書(Ver.3)","/terms-v3",{"title":4684,"_path":4685},"ReoGrid利用許諾契約書(Ver.4)","/terms-v4",{"title":4687,"_path":4688},"ReoGrid 4 トライアルライセンスポリシー","/terms-v4-trial",{"title":4690,"_path":4691},"ReoGrid Web Edition 利用許諾契約書","/terms-web",1786025046182]