/* TbDmpS - Prints a table with an introducing string at i-time DESCRIPTION Prints the content of a table, with an additional string as 'introduction' at i-time (= once at the initialization of an instrument). You may have to set the flag -+max_str_len=10000 for avoiding buffer overflow. See TbDmpSk for the k-rate variant SYNTAX TbDmpS ifn, String [,istart [,iend [,iprec [,ippr]]]] INITIALIZATION ifn - function table number String - string to be printed as introduction istart - first index to be printed (default = 0) iend - first index not to be printed (default = -1: end of table) iprec - float precision while printing (default = 3) ippr - parameters per row (default = 10, maximum = 32) CREDITS joachim heintz 2012 */ opcode TbDmpS, 0, iSojjo ifn, String, istart, iend, iprec, ippr xin ippr = (ippr == 0 ? 10 : ippr) iend = (iend == -1 ? ftlen(ifn) : iend) iprec = (iprec == -1 ? 3 : iprec) indx = istart Sformat sprintf "%%.%df, ", iprec Sdump sprintf "%s[", String loop: ival tab_i indx, ifn Snew sprintf Sformat, ival Sdump strcat Sdump, Snew imod = (indx+1-istart) % ippr if imod == 0 && indx != iend-1 then puts Sdump, 1 Sdump = "" endif loop_lt indx, 1, iend, loop ilen strlen Sdump Slast strsub Sdump, 0, ilen-2 printf_i "%s]\n", 1, Slast endop