Category:S-lang: Difference between revisions
Content added Content deleted
mNo edit summary |
mNo edit summary |
||
Line 15: | Line 15: | ||
For simplicity, many of the S-Lang tasks use the print() |
For simplicity, many of the S-Lang tasks use the print() |
||
function. This is not part of S-Lang per se, but is normally |
function. This is not part of S-Lang per se, but is normally |
||
included in the |
included in the S-Lang shell "slsh". If it is missing, or you're |
||
using some other S-Lang environment, options include a C-like |
using some other S-Lang environment, options include a C-like |
||
sprintf() and printf(). Their format and parameters work about |
sprintf() and printf(). Their format and parameters work about |
||
like you'd expect in a C-inspired interpreted language. |
like you'd expect in a C-inspired interpreted language. |
||
sprintf(f, d..) [f=string format, d..=zero or more data items] |
<code>sprintf(f, d..)</code> [f=string format, d..=zero or more data items] |
||
returns a string. printf(f, d..) prints to "stdout" and returns |
returns a string. <code>printf(f, d..)</code> prints to "stdout" and returns |
||
the number of items formatted: remember S-Lang is a "stack |
the number of items formatted: remember S-Lang is a "stack |
||
language", so even if you don't care about that number, your code |
language", so even if you don't care about that number, your code |