From facd7fe05be3a701e63f72064f7727942b219ad0 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Fri, 28 Aug 2020 21:36:56 +0430 Subject: [PATCH] Spreadsheet: Document the behaviour of the 'R' function/tag --- Base/res/js/Spreadsheet/runtime.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Base/res/js/Spreadsheet/runtime.js b/Base/res/js/Spreadsheet/runtime.js index 1519c879c6..ed209a2a3c 100644 --- a/Base/res/js/Spreadsheet/runtime.js +++ b/Base/res/js/Spreadsheet/runtime.js @@ -34,11 +34,12 @@ function split(str, sep) { splitIndex = str.indexOf(sep); if (splitIndex == -1) { if (str.length) parts.push(str); - return parts; + break; } parts.push(str.substring(0, splitIndex)); str = str.slice(splitIndex + sep.length); } + return parts; } function R(fmt, ...args) { @@ -106,6 +107,19 @@ range.__documentation = JSON.stringify({ }, }); +R.__documentation = JSON.stringify({ + name: "R", + argc: 1, + argnames: ["range specifier"], + doc: + "Generates a list of cell names in a rectangle defined by " + + "_range specifier_, which must be two cell names " + + "delimited by a comma ':'. Operates the same as `range`", // TODO: Add support for hyperlinks. + examples: { + "R`A1:C4`": "Generate the range A1:C4", + }, +}); + select.__documentation = JSON.stringify({ name: "select", argc: 3,