Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is a solution I worked out which may be useful as a basis for doing something similar:</p> <pre><code>function labTab(ind){ var tab,com,a; tab = "\t"; com = []; for(a = 0; a &lt; ind; a+=1){ com.push(tab) } return com.join(""); } function nsetEntry(tab,o,obj){ return tab + '"'+ o + '":' + JSON.stringify(obj[o]); } function nsetObject(tab,o,obj,arr,ind){ var start; start = tab + '"'+ o + '":{'; return [start,nsetConstructor(obj[o],arr,ind)].join("\n") + "\n" + tab +"}"; } function nsetConstructor(obj,arr,ind){ var narr,tab,o,entry; narr = []; ind += 1; tab = labTab(ind); for(o in obj){ if(obj[o].constructor === Object){ entry = nsetObject(tab,o,obj,arr,ind); narr.push(entry); } else{ entry = nsetEntry(tab,o,obj); narr.push(entry); } } return narr.join(",\n"); } function nsetLevels(obj,arr,ind){ var o,start,tab; tab = labTab(ind); for(o in obj){ if(obj[o].constructor === Object){ entry = nsetObject(tab,o,obj,arr,ind); arr.push(entry); } else{ entry = nsetEntry(tab,o,obj); arr.push(entry); } } return arr.join(",\n"); } function nsetSave(){ var json,o,ind,tab,obj,start,head,tail; json = []; for(o in nset){ ind = 1; tab = labTab(ind); start = tab + '"'+ o + '":{'; ind = 2; tab = labTab(ind); obj = nset[o]; json.push([start,nsetLevels(obj,[],ind)].join("\n")) } head = "{\n"; tail = "\n\t}\n}" FW.Write([head,json.join("\n\t},\n"),tail].join(""),"xset.json") } </code></pre> <p>I could not figure out how to do replace as some members go down five levels,so I recreated the whole thing. The solution is not so hot but I got what I wanted to achieve - sample below:</p> <pre><code> "Key":{ "Label":{ "Change":["Input"], "Repeat":{ "Name":[["Top_level","All"],[[1,1]]], "Link":[["Top_level"],[[1,1]]] }, "Delete":["Confirm","Cancel"], "Move":["Up","Down"], "Number":["Ascending","Descending"] }, "Class":{ "Change":["Input"] }, </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload