[Csnd] how to write content of a variable to a file

Dear community,
I would like to know if one can print the content of a variable into a file.
In the following example it would be the variable icps.

Here’s the snippet:

-odac -m0d ; ==============================================

sr = 44100
nchnls = 2
0dbfs = 1
seed 0
instr 1
idur = p3
icps random 440,880
iamp = ampdb(-12)
aenv expseg 1,idur,0.0001
asine poscil iamp*aenv,icps
outs asine, asine
endin

; ============================================== i1 0 1 i1 + 1 i1 + 1

Thanks for Your help!
Stefan

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

May 24 2021, Stefan Thomas has written:

Dear community,
I would like to know if one can print the content of a variable into a file.

Stefan, if you want to print just a numeric value (i- or k-rate
variables) you could use different functions. The most general, which
will also work for strings is fprints or fprintks.

Moreover, there is the fout family of opcodes and, when you work with
ftables, you have ftsave and ftsavek.

HTH and best wishes,

Jeanette

...

Thanks!
fouti did the job for me!