Improve some documentation (#1474)

* Delete removed symbol from PRINTLN examples

* Touch up `SHIFT` docs

Co-authored-by: Sylvie <35663410+Rangi42@users.noreply.github.com>
This commit is contained in:
Eldred Habert
2024-08-19 20:29:20 +02:00
committed by GitHub
parent 8c96293b11
commit 8f47fb494b

View File

@@ -1874,16 +1874,18 @@ then
will expand to will expand to
.Ql \e<42> . .Ql \e<42> .
.Pp .Pp
Another way to access more than nine macro arguments is the The
.Ic SHIFT .Ic SHIFT
command, a special command only available in macros. directive is only available inside macros.
It will shift the arguments by one to the left, and decrease It will shift the arguments by one to the left, and decrease
.Dv _NARG .Dv _NARG
by 1. by 1:
.Ic \e1 .Ic \e1
will get the value of takes the value of
.Ic \e2 , \e2 .Ic \e2 ,
will get the value of then
.Ic \e2
takes the value of
.Ic \e3 , .Ic \e3 ,
and so forth. and so forth.
.Pp .Pp
@@ -1892,9 +1894,9 @@ can optionally be given an integer parameter, and will apply the above shifting
A negative parameter will shift the arguments in reverse. A negative parameter will shift the arguments in reverse.
.Pp .Pp
.Ic SHIFT .Ic SHIFT
is useful in is especially useful in
.Ic REPT .Ic REPT
blocks to repeat the same commands with multiple arguments. loops, to repeat the same commands but with different arguments each time.
.Ss Printing things during assembly .Ss Printing things during assembly
The The
.Ic PRINT .Ic PRINT
@@ -1907,7 +1909,6 @@ PRINT "Hello world!\en"
PRINTLN "Hello world!" PRINTLN "Hello world!"
PRINT _NARG, " arguments\en" PRINT _NARG, " arguments\en"
PRINTLN "sum: ", 2+3, " product: ", 2*3 PRINTLN "sum: ", 2+3, " product: ", 2*3
PRINTLN "Line #", __LINE__
PRINTLN STRFMT("E = %f", 2.718) PRINTLN STRFMT("E = %f", 2.718)
.Ed .Ed
.Bl -inset .Bl -inset