summaryrefslogtreecommitdiffstats
path: root/src/doc
diff options
context:
space:
mode:
authorPim Snel <pim@lingewoud.nl>2020-02-06 00:43:04 +0100
committerPim Snel <pim@lingewoud.nl>2020-02-06 00:43:04 +0100
commit2110c0b8e2b7007f5de0d7f0084dac15817aae8e (patch)
tree09a383cab4b4faa7c375ab06943c715680c89643 /src/doc
parentf5dc8c67ae07c7be9a96c835c043097336f06b52 (diff)
add noninteractie scripting documentation
Diffstat (limited to 'src/doc')
-rwxr-xr-xsrc/doc301
1 files changed, 268 insertions, 33 deletions
diff --git a/src/doc b/src/doc
index e443677..f70eab5 100755
--- a/src/doc
+++ b/src/doc
@@ -1367,38 +1367,39 @@ Commands for handling cell content:
==============================================================================
&LUA Scripts and Triggers&
- SC-IM was extended with LUA capabilities and also provided with helper
- Function for manipulate SC-IM data with Lua at runtime. Since it is a
- fully functional Lua, you can use all Lua packages also for sc-im lua
- scripts. Use luarocks to install additional packages.
-
- Function provided to lua script/triggers :
-
- sc.lgetnum (c, r) - get numeric value of cell c,r (c/r is number
- column/row) returns value
- sc.lsetnum (c, r, val) - set numeric value to a cell c,t
- sc.lsetform (c, r, str) - set formula to a cell. Basically it does "let
- cell= str"
- sc.lsetstr(c, r, str) - set string to a cell
- sc.lgetstr(c, r, str) - get string from a cell
- sc.lquery(str) - query input from user, but first prints str.
- Use with care!!
- Dont use this function within triggers!!
- returns string
- sc.sc(str) - send str to sc-im parser
- sc.a2colrow(str) - convert ascii cell representation to numeric
- column/row returns column, row example:
- c,r=sc.a2colrow("c5")
- sc.colrow2a(c,r) - returns ascii representation of numeric
- column/row
- sc.maxcols() - return current maximum columns
- sc.maxrows() - return current maximum rows
- sc.curcol() - return current column
- sc.currow() - return current row
-
- The search patch for LUA scripts files is $PWD/lua or
- $HOME/.scim/lua/ or /usr/local/share/scim/lua (in that order)
- Example can be found in sc-im/examples/lua in source code tree.
+
+ SC-IM was extended with LUA capabilities and also provided with helper
+ Function for manipulate SC-IM data with Lua at runtime. Since it is a
+ fully functional Lua, you can use all Lua packages also for sc-im lua
+ scripts. Use luarocks to install additional packages.
+
+ Function provided to lua script/triggers :
+
+ sc.lgetnum (c, r) - get numeric value of cell c,r (c/r is number
+ column/row) returns value
+ sc.lsetnum (c, r, val) - set numeric value to a cell c,t
+ sc.lsetform (c, r, str) - set formula to a cell. Basically it does "let
+ cell= str"
+ sc.lsetstr(c, r, str) - set string to a cell
+ sc.lgetstr(c, r, str) - get string from a cell
+ sc.lquery(str) - query input from user, but first prints str.
+ Use with care!!
+ Dont use this function within triggers!!
+ returns string
+ sc.sc(str) - send str to sc-im parser
+ sc.a2colrow(str) - convert ascii cell representation to numeric
+ column/row returns column, row example:
+ c,r=sc.a2colrow("c5")
+ sc.colrow2a(c,r) - returns ascii representation of numeric
+ column/row
+ sc.maxcols() - return current maximum columns
+ sc.maxrows() - return current maximum rows
+ sc.curcol() - return current column
+ sc.currow() - return current row
+
+ The search patch for LUA scripts files is $PWD/lua or
+ $HOME/.scim/lua/ or /usr/local/share/scim/lua (in that order)
+ Example can be found in sc-im/examples/lua in source code tree.
==============================================================================
@@ -1482,4 +1483,238 @@ Commands for handling cell content:
Note: Setting the --output parameter implies setting the --nocurses flag.
- vim:tw=78:ts=8:ft=help:norl:
+ SC-IM script function names are case insensitive.
+ 'LET A0=1' is the same as 'let A0=1'
+
+ Almost every interactive SC-IM command is available for non-interactive
+ scripting. Search the equivelent interactive commands for usage
+ information.
+
+ SC-IM has these commands for available for external scripts.
+
+ LET {[COL][ROW]}={expr}
+ Sets the contents of a cell with a value or an expression. E.g.
+ 'LET A1=A2*A2'
+
+ LABEL {[COL][ROW]}={expr}
+ Sets the label of a cell with to a string value.
+
+ EXECUTE "{STRING}"
+ Call an internal COMMAND MODE command. Examples:
+ EXECUTE "load! /tmp/test.xls"
+ EXECUTE "e! mkd /path/test.md"
+
+ RECALC
+ Recalculates a formulas in all cells
+
+ GETNUM {[COL][ROW]}
+ Get numeric value from cell and print to STDOUT
+
+ GETSTRING {[COL][ROW]}
+ Get text value from cell and print to STDOUT
+
+ GETEXP {[COL][ROW]}
+ Get expression from cell and print to STDOUT
+
+ GETFORMAT {COL}
+ Get format from cell and print to STDOUT
+
+ GETFMT {[COL][ROW]}
+ Get format from cell and print to STDOUT
+
+ QUIT
+ Quits SC-IM.
+
+ Other available commands for scripting are:
+
+ DETAIL {var}
+ LEFTSTRING {var_or_range}
+ RIGHTSTRING {var_or_range}
+ LEFTJUSTIFY {var_or_range}
+ RIGHTJUSTIFY {var_or_range}
+ CENTER {var_or_range}
+ FORMAT {COL} {NUMBER} {NUMBER} {NUMBER}
+ FMT {var_or_range} {STRING}
+ DATEFMT {var_or_range} {STRING}
+ DATEFMT {STRING}
+ HIDE {COL}
+ HIDE {NUMBER}
+ SHOW {COL}
+ SHOW {NUMBER}
+ HIDECOL {COL}
+ SHOWCOL {COL}
+ HIDEROW {NUMBER}
+ SHOWROW {NUMBER}
+ SHOWCOL {COL} : {COL}
+ SHOWROW {NUMBER} : {NUMBER}
+ HIDECOL {COL} : {COL}
+ HIDEROW {NUMBER} : {NUMBER}
+ SHIFT {var_or_range} {STRING}
+ MARK {COL} {var_or_range}
+ MARK {COL} {var_or_range} {var_or_range}
+ FILL {var_or_range} {num} {num}
+ FILL {num} {num}
+ UNFREEZE
+ FREEZE {range}
+ FREEZE {NUMBER} : {NUMBER}
+ FREEZE {NUMBER}
+ FREEZE {COL} : {COL}
+ FREEZE {COL}
+ SORT {range} {STRING}
+ SUBTOTAL {range} {COL} {STRING} {COL}
+ RSUBTOTAL {range} {COL} {STRING} {COL}
+ FILTERON {range}
+ AUTOJUS {COL} : {COL}
+ AUTOJUS {COL}
+ GOTO {var_or_range} {var_or_range}
+ GOTO {var_or_range}
+ GOTO {num}
+ GOTO {STRING}
+ GOTO # {STRING}
+ GOTO % {STRING}
+ CCOPY {range}
+ CPASTE
+ LOCK {var_or_range}
+ UNLOCK {var_or_range}
+ NMAP {STRING} {STRING}
+ IMAP {STRING} {STRING}
+ NNOREMAP {STRING} {STRING}
+ INOREMAP {STRING} {STRING}
+ NUNMAP {STRING}
+ IUNMAP {STRING}
+ COLOR {STRING}
+ CELLCOLOR {var_or_range} {STRING}
+ TRIGGER {var_or_range} {STRING}
+ UNTRIGGER {var_or_range}
+ CELLCOLOR {STRING}
+ UNFORMAT {var_or_range}
+ UNFORMAT
+ REDEFINE_COLOR {STRING} {NUMBER} {NUMBER} {NUMBER}
+ FCOPY
+ FCOPY {strarg}
+ FSUM
+ PAD {NUMBER} {COL} : {COL}
+ PAD {NUMBER} {COL}
+ PAD {NUMBER} {var_or_range}
+ PLOT {STRING} {var_or_range}
+ SET {setlist}
+ DEFINE {strarg} {range}
+ DEFINE {strarg} {var}
+ UNDEFINE {var_or_range}
+ EVAL{expr}
+ REBUILD_GRAPH
+ PRINT_GRAPH
+ SYNCREFS
+ UNDO
+ REDO
+ SEVAL{expr}
+ ERROR {STRING}
+
+ The commands below can be used for calculations.
+
+ @MONTH ({expr})
+ @DAY ({expr})
+ @YEAR ({expr})
+ @NOW
+ @DTS ({expr},{expr},{expr})
+ {NUMBER} . {NUMBER} . {NUMBER}
+ @TTS ({expr},{expr},{expr})
+ @STON ({expr})
+ @SLEN ({expr})
+ @EQS ({expr},{expr})
+ @DATE ({expr})
+ @DATE ({expr},{expr})
+ @FMT ({expr},{expr})
+ @UPPER ({expr})
+ @LOWER ({expr})
+ @CAPITAL ({expr})
+ @INDEX ( {range} ,{expr})
+ @INDEX ({expr}, {range} )
+ @INDEX ( {range} ,{expr},{expr})
+ @LOOKUP ( {range} ,{expr})
+ @LOOKUP ({expr}, {range} )
+ @HLOOKUP ( {range} ,{expr},{expr})
+ @HLOOKUP ({expr}, {range} ,{expr})
+ @VLOOKUP ( {range} ,{expr},{expr})
+ @VLOOKUP ({expr}, {range} ,{expr})
+ @STINDEX ( {range} ,{expr})
+ @STINDEX ({expr}, {range} )
+ @STINDEX ( {range} ,{expr},{expr})
+ @EXT ({expr},{expr})
+ @LUA ({expr},{expr})
+ @NVAL ({expr},{expr})
+ @SVAL ({expr},{expr})
+ @REPLACE ({expr},{expr},{expr})
+ @SUBSTR ({expr},{expr},{expr})
+ FNUMBER
+ @PI
+ @FILENAME ({expr})
+ @MYROW
+ @MYCOL
+ @LASTROW
+ @LASTCOL
+ @COLTOA ({expr})
+ @ASCII ({expr})
+ @SET8BIT ({expr})
+ @CHR ({expr})
+ @ERR
+ ERR
+ @REF
+ REF
+
+ The commands below set runtime configuration values:
+
+ OVERLAP = {NUMBER}
+ OVERLAP
+ NOOVERLAP
+ AUTOBACKUP = {NUMBER}
+ NOAUTOBACKUP
+ AUTOCALC
+ AUTOCALC = {NUMBER}
+ NOAUTOCALC
+ DEBUG
+ DEBUG = {NUMBER}
+ NODEBUG
+ TRG
+ TRG = {NUMBER}
+ NOTRG
+ EXTERNAL_FUNCTIONS
+ EXTERNAL_FUNCTIONS = {NUMBER}
+ NOEXTERNAL_FUNCTIONS
+ HALF_PAGE_SCROLL
+ HALF_PAGE_SCROLL = {NUMBER}
+ NOHALF_PAGE_SCROLL
+ QUIT_AFTERLOAD
+ QUIT_AFTERLOAD = {NUMBER}
+ NOQUIT_AFTERLOAD
+ XLSX_READFORMULAS
+ XLSX_READFORMULAS = {NUMBER}
+ NOXLSX_READFORMULAS
+ NOCURSES
+ NOCURSES = {NUMBER}
+ CURSES
+ NUMERIC
+ NUMERIC = {NUMBER}
+ NONUMERIC
+ IGNORECASE
+ IGNORECASE = {NUMBER}
+ NOIGNORECASE
+ NUMERIC_DECIMAL
+ NUMERIC_DECIMAL = {NUMBER}
+ NONUMERIC_DECIMAL
+ NUMERIC_ZERO
+ NUMERIC_ZERO = {NUMBER}
+ NONUMERIC_ZERO
+ NEWLINE_ACTION
+ NEWLINE_ACTION = {WORD}
+ DEFAULT_COPY_TO_CLIPBOARD_CMD = {strarg}
+ DEFAULT_PASTE_FROM_CLIPBOARD_CMD = {strarg}
+ COPY_TO_CLIPBOARD_DELIMITED_TAB
+ COPY_TO_CLIPBOARD_DELIMITED_TAB = {NUMBER}
+ NOCOPY_TO_CLIPBOARD_DELIMITED_TAB
+ NEWLINE_ACTION = {NUMBER}
+ TM_GMTOFF
+ TM_GMTOFF = {num}
+
+
+vim:tw=78:ts=8:ft=help:norl: