numlines
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | numlines [2006/08/01 20:54] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: numlines.txt, | ||
+ | ======Synopsis: | ||
+ | $__numlines__(< | ||
+ | |||
+ | ======Technical: | ||
+ | This function tells you the number of lines that the given string would | ||
+ | occupy after final display in a window with a width of < | ||
+ | |||
+ | ======Practical: | ||
+ | This function can be used to determine how many lines a particular string will | ||
+ | occupy in particular window. One thing this could be used for is scripting a | ||
+ | file pager that will correctly pause between each screen of output, regardless | ||
+ | of long lines and [[SET]] [[set CONTINUED_LINE|CONTINUED_LINE]]|[[set | ||
+ | INDENT|INDENT]]. | ||
+ | |||
+ | ======Returns: | ||
+ | number of lines < | ||
+ | width of < | ||
+ | |||
+ | ======Examples: | ||
+ | < | ||
+ | $numlines(6 foo bar baz) returns 2 | ||
+ | $numlines($word(0 $geom()) foo bar baz) | ||
+ | $numlines(foo bar baz) returns nothing | ||
+ | </ | ||
+ | |||
+ | ======Notes: | ||
+ | This does NOT take into account [[SET]] [[set OUTPUT_REWRITE|OUTPUT_REWRITE]] | ||
+ | so you may want to turn it off before outputting anything that may depend on | ||
+ | $numlines() being accurate. | ||
numlines.txt · Last modified: 2006/08/01 20:54 by 127.0.0.1