Quantcast
Channel: Silk Performer
Viewing all articles
Browse latest Browse all 4084

Wiki Page: How can I write out the value of a variable from SilkPerformer into a multi-column .csv file?

$
0
0
How can I write out the value of a variable from SilkPerformer into a multi-column .csv file? Using string concatenation, it is possible to add variables, plus relevant delimiters (comma or semi-colon) to a multi-column data file. The following sample code below shows how you can use the "FWrite" function and string concatenation to write the contents of a variable out into a two column csv file, with a comma delimiter. transaction TMain var hFile, nWritten : number ; sString1 : string ; sString2 : string ; begin // create a file in the temporary directory FOpen(hFile, "c:\\temp\\dummyfile.csv" , OPT_FILE_ACCESS_READWRITE, OPT_FILE_CREATE); // write string to open file sString1 := "One" ; sString2 := "Two" ; //set up string concatenation and specify your delimiter character FWrite(hFile, sString1 + "," + sString2, STRING_COMPLETE, OPT_FILE_APPEND, nWritten); // close file FClose(hFile); end TMain; Old KB# 17233

Viewing all articles
Browse latest Browse all 4084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>