Encodes a CSV
string to key-value data. Note that in the CSV keys will be in the even positions and values in the odd positions, such that if is the index of a key, its corresponding value will be at index in the input CSV
.
When the function is called with:
wasCSVToKeyValueData("position, <1,1,0>,toggle, on")
it will return the key-value data:
position=<1,1,0>&toggle=on
Note that calling:
string data = wasCSVToKeyValueData("position, <1,1,0>, toggle, on");
is equivalent to:
string data = wasKeyValueEncode(llCSV2List("position, <1,1,0>, toggle, on"));
/////////////////////////////////////////////////////////////////////////// // Copyright (C) 2014 Wizardry and Steamworks - License: CC BY 2.0 // /////////////////////////////////////////////////////////////////////////// string wasCSVToKeyValueData(string csv) { list temp = llCSV2List(csv); list data = []; do { data += llList2String(temp, 0) + "=" + llList2String(temp, 1); temp = llDeleteSubList(temp, 0, 1); } while(llGetListLength(temp) != 0); return llDumpList2String(data, "&"); }