CoolFace
Datasetpublic

hschumann2/TempleOS-Source-Code

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes838downloads
Print.txt115 linesDownload Raw Back to Doc
1 2                                 Print Fmt Strs3 4<fmt_arg> := %[-][0][<width>][.<decimals>][<flags>][h<aux_fmt_num>]<fmt_code>5 6See StrPrintJoin().7 8<flags>:9 10  't' truncate to <width>.11  ',' add commas every three digits or four nibbles.12  '$' makes %Q convert '$' to "\x24".13  '/' makes %Q and %q convert '%' to "%%".14 15<aux_fmt_num>:16 17  For "%n", "%d" or "%u", the <aux_fmt_num> causes thousands mode.  "%h?n" will18  pick a var exponent multiples of three unit, while "%h-3n" will display milli19  units or "%h6n" will display mega units.  The 'k' flag is always on for "%n".20  See ::/Demo/Print.HC.21 22For "%c" or "%C", the <aux_fmt_num> repeats the char that many times.23 24<fmt_code>:25 26  "%n" floating point in engineering notation, exponents being multiples of27  three.  If it has a <aux_fmt> code, it will display scientific units letters.28 29  "%S" Define() entry.30 31  "%C" ToUpper() character.32 33  "%h25c",'\n'; 25 new-lines.34 35  "%h*c",25,'\n'; 25 new-lines.36 37  "%F" text file by filename.38 39  "%$F" DolDoc file in memory.40 41  "%p" ptr.42 43  "%,p" ptr with no offset.44 45  "%P" link to ptr.46 47  "%,P" link to ptr with no offset.48 49  "%D" date.  Pass a CDate.50 51  "%T" time.  Pass a CDate.52 53  "%z" sub_entry of an enumerated list of text entries.  See LstSub().  Pass54  sub_entry_num first, list second.55 56  "%Z" DefineLstLoad() subentry.  Pass sub_entry_num first, define_name second.57 58  "%Q" convert "\" to "\\" and quote to backslash quote. (For use in creating59  strs in strs.)60 61  "%q" rev a "%Q".62 63 64                                  Print Family65 66MStrPrint(U8 *fmt,...) is like StrPrint(U8 *dst,U8 *fmt,...) but it returns a67MAllocated str.  It is vary handy because you don't have to worry about68overflow.69 70CatPrint(U8 *_dst,U8 *fmt,...) concatenates a formated string.71 72In(U8 *fmt,...) sends text to the current task's input buffer.73InStr(U8 *fmt,...) sends text of an InFile to the keyboard stream of the current74TASK but can also do mouse cmds.75 76XTalk(CTask *task,U8 *fmt,...) and text to another task's input buffer.77XTalkStr(CTask *task,U8 *fmt,...) sends text of an InFile to the keyboard stream78of another TASK but can also do mouse cmds.79 80DocPrint(CDoc *doc,U8 *fmt,...) sends text to a document.  You can buffer to a81Doc and save it, providing the functionality of fprintf.  See82::/Demo/Dsk/FPrintF.HC.83 84Adam(U8 *fmt,...) sends text to the Adam Task to be compiled and run.85AdamLog(U8 *fmt,...) and AdamErr(U8 *fmt,...) send text to the Adam Task to be86displayed.87 88StreamPrint(U8 *fmt,...) sends text to the stream of code being compiled and89must reside in a #exe{} blk.90 91GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...) and GrVPrint() plots text in graphics92mode.93 94TextPrint(CTask *task,I64 x,I64 y,I64 attr,U8 *fmt,...) plots to gr.text_base.95 96ExePrint(U8 *fmt,...) compiles and execute a string.  Note: It returns the res97of the last executed expression.98 99Once(U8 *fmt,...) Writes User code to Registry to be executed next boot.100 101AOnce(U8 *fmt,...) Writes Adam code to Registry to be executed next boot.102 103InPrint(I64 mS,U8 *fmt,...) PutChars()s one at a time with a delay.104 105RawPrint(I64 mS,U8 *fmt,...) sends direct to scrn memory, bypassing window106manager.107 108User(U8 *fmt,...) Spawns a user and execute a string on start-up.109 110PopUpPrint(U8 *fmt,...) compiles and execute a string in a pop-up win.  Note: It111returns the res of the last executed expression.112PopUpViewPrint(U8 *fmt,...) creates a pop-up window and views text.113 114Note: Use Print("%s",src) if you need an unmodified string.115