function

savecsv . string . sncode

VERSIONlatest Stores array to a file.

SAVECSV

NAME

savecsv - Stores arrays to a comma-separated file.

SYNOPSIS

savecsv(input,file,delimiter,enclosure,escape)

PARAMETERS

input
Array to be stored.
file
File name.
delimiter
Sets the field delimiter. By default, it is set to a backslash (,).
enclosure
Sets the field enclosure character. By default, it is set to a backslash (").
escape
Sets the escape character. By default, it is set to a backslash (").
error
Context to store error messages. Contains errmsg and errcode.

RETURN

Returns true if the operation has succeeded.

EXAMPLES

 if savecsv(
                [
                        ['title1','title2',1.5],
                        ['aaa',123,2.6],
                        [124,'dfg']
                ]
                ,'/test.csv',v) == true
         then
                "true"; else "Can't save CSV"; v; endif;
        if savecsv(
                [
                        ['title1','title2',1.5],
                        ['aaa',123,2.6],
                        [124,'dfg']
                ]
                ,'/test.csv',v) == true
         then
                v.errcode; else "Can't save CSV"; v; endif;
        if savecsv(
                [
                        ['title1','title2',1.5],
                        ['aaa',123,2.6],
                        [124,'dfg']
                ]
                ,'/test.csv') == true
         then
                v; else "Can't save CSV"; v; endif;

        if savecsv(
                input:[
                        ['title1','title2',1.5],
                        ['aaa',123,2.6],
                        [124,'dfg']
                ]
                ,file:'../../../../test.csv',error:v) == true
         then
                "true"; else v; endif

AUTHOR

Written by Pusnei Sergey and Caroline Laplante, <sergey@sednove.com>