Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Escape special char sequence in string
#1
Hi,

I'm trying to create a simple utility macro to receive a list of variable names and incorporate them into formatted lines for output/logging, like so :

Code:
Copy      Help
out "var1 = %s" var1

..so I can just copy and paste the QM output into a macro.

I have been unsuccessful in my attempts to escape the char sequence "%s" so it shows up as is in the QM output. In other words, I need a plain text version of "%s" (i.e. not processed) to appear where indicated in the below macro.


Macro
Code:
Copy      Help
str outform
if(!inp(outform "" "" "[]")) ret
ARRAY(str) a=outform
int i
for(i 0 a.len) out "out ''%s = <need to insert escaped percent+s here>'' %s" a[i] a[i]

Thanks,

S


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)