Pf out

Purpose: Outputs a formatted string without encoding.

 pf-out <format> , <variable> [ , <variable> ]... \
     [ to-error ] \
     [ to <string> ]

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 correspoding 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


Copyright (c) 2019-2024 Gliim LLC. All contents on this web site is "AS IS" without warranties or guarantees of any kind.