| GOLF(2gg) | Development | GOLF(2gg) |
NAME¶
pf-out - (output)
PURPOSE¶
Outputs a formatted string without encoding.
SYNTAX¶
pf-out <format> , <variable> [ , <variable> ]... \
[ to-error ] \
[ to <string> ]
DESCRIPTION¶
pf-out formats a string according to the <format> string and a list of <variable>s and then outputs the result without any encoding (meaning a string is output exactly as it is, and the client may interpret such text in any way it sees fit).
FORMAT
<format> string must be a literal. Variables must follow <format> separated by commas in the same order as placeholders. If you use any placeholders other than specified below, or the type of variables you use do not match the type of a corresponding placeholder in <format>, your program will error out. You can use the following placeholders in <format> (see trace-run for an example of usage):
<format> string must be present and there must be at least one <variable> (it means if you want to print out a simple string literal you still have to use "%s" as format).
If "to-error" clause is used, the output is sent to "stderr", or standard output stream.
If "to" clause is used, then the output of pf-out is stored into <string>.
EXAMPLES¶
To output data (the string output is "the number is 20"):
pf-out "%s is %d", "the number", 20
Create a query text string by means of write-string statement:
// / Construct the run-time text of dynamic SQL // write-string qry_txt @select * from <<pf-out "%s where id="%ld", table_name, id_num>> end-write-string
SEE ALSO¶
Output
finish-output flush-output output-statement pf-out pf-url pf-web p-num p-out p-path p-source-file p-source-line p-url p-web See all documentation
| $VERSION | $DATE |