
#--------------------------------------------------------------
#for printing
#--------------------------------------------------------------
func ToCode(aInput)
cCode = "["
lStart = True
for item in aInput
if !lStart cCode += ","+Char(32) else lStart = False ok
if isString(item)
item2 = item
item2 = substr(item2,'"','"+char(34)+"')
cCode += Char(32) +'"' + item2 + '"'
but isnumber(item)
cCode += Char(32) +""+item
but islist(item)
cCode += Windowsnl()
cCode += ToCode(item)
but isobject(item)
aAttribut = attributes(item)
cCode += '['
lStart = True
for attribut in aAttribut
if !lStart cCode += "," else lStart = False ok
value = getattribute(item,attribut)
cCode +=':'+ attribut + '='
if isString(value)
cCode += '"' + value + '"'
but isNumber(value)
cCode += value
but isList(value)
cCode += ToCode(value)
but isobject(value)
cCode += ToCode(value)
ok
next
cCode += " ]" +Windowsnl()
ok
next
cCode += Char(32)+"]"
return cCode


--
---
You received this message because you are subscribed to a topic in the Google Groups "The Ring Programming Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ring-lang/i49djQwL4GU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ring-lang+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/545dd49f-d488-4615-b96d-5180d228f9a3n%40googlegroups.com.