View/Edit #38:to_csv

Switch to edit mode.

Name(s): to_csv
1:  "Converts a 2D array of MOO strings into a list of strings in CSV format."
2:  "Code from Digital Routes Ltd"
3:  {array} = args
4:  csv = {}
5:  for arg in (array)
6:    line = ""
7:    for datum in (arg)
8:      if (index(datum, ",") || index(datum, "\""))
9:        datum = "\"" + strsub(datum, "\"", "\"\"") + "\""
10:     endif
11:     line = line + "," + datum
12:   endfor
13:   line && (line = line[2..$])
14:   csv = {@csv, line}
15:   $command_utils:suspend_if_needed(0)
16: endfor
17: return csv
18: "Last modified by Dax (#789) on Sun Oct 21 09:24:02 2001 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Hacker (#60)

You are not logged in.

[home | help | who | search | setup | code]