Jsonlib questions

20 views
Skip to first unread message

stefano cerbioni

unread,
May 6, 2022, 11:39:59 AMMay 6
to The Ring Programming Language
Hi guys  i have  a problem with jsonlib 
my api cal return this  code
[{"symbol":"UTKUSDT","id":11644515,"orderId":113414526,"orderListId":-1,"price":"0.36400000","qty":"27.00000000","quoteQty":"9.82800000","commission":"0.00001612","commissionAsset":"BNB","time":1635407720681,"isBuyer":true,"isMaker":false,"isBestMatch":true},{"symbol":"UTKUSDT","id":11998083,"orderId":116030031,"orderListId":-1,"price":"0.49690000","qty":"27.00000000","quoteQty":"13.41630000","commission":"0.00001575","commissionAsset":"BNB","time":1636996238875,"isBuyer":false,"isMaker":false,"isBestMatch":true}]1ef9c4390983595840ff5d605","price":"0.00013870","origQty":"5.40000000","executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"NEW","timeInForce":"GTC","type":"LIMIT","side":"SELL","stopPrice":"0.00000000","icebergQty":"0.00000000","time":1641120707750,"updateTime":1641120707750,"isWorking":true,"origQuoteOrderQty":"0.00000000"}]

when i pass it  in this part of  code (in Zio i have json write up )
aList = Json2List(Zio)
?aList
mysee(aList,1)

it return  in vertical all
[
        [
        {
        "
        s
        y
        m
        b
        o
        l
        "
        :
        "
        U
        T
        K
        U
        S
        D
        T
        "
        ,
etc...

but  when arrive the second call
[{"symbol":"BTCUSDT","id":1329342920,"orderId":10231939038,"orderListId":-1,"price":"40618.82000000","qty":"0.00049000","quoteQty":"19.90322180","commission":"0.00003549","commissionAsset":"BNB","time":1650359679517,"isBuyer":true,"isMaker":false,"isBestMatch":true},{"symbol":"BTCUSDT","id":1329359216,"orderId":10232147255,"orderListId":-1,"price":"40640.77000000","qty":"0.00048000","quoteQty":"19.50756960","commission":"0.00003480","commissionAsset":"BNB","time":1650361575322,"isBuyer":false,"isMaker":false,"isBestMatch":true},{"symbol":"BTCUSDT","id":1334594017,"orderId":10283805783,"orderListId":-1,"price":"39762.74000000","qty":"0.00052000","quoteQty":"20.67662480","commission":"0.00003837","commissionAsset":"BNB","time":1650788957484,"isBuyer":false,"isMaker":false,"isBestMatch":true},{"symbol":"BTCUSDT","id":1334609287,"orderId":10283916456,"orderListId":-1,"price":"39722.72000000","qty":"0.00050000","quoteQty":"19.86136000","commission":"0.00003699","commissionAsset":"BNB","time":1650790871223,"isBuyer":true,"isMaker":false,"isBestMatch":true}]


its  return  human readable 
[
    [
        [
            [
                    symbol
                    BTCUSDT
            ]

            [
                    id
                    1329342920
            ]

            [
                    orderId
                    10231939038
            ]

            [
                    orderListId
                    -1
            ]

            [
                    price
                    40618.82000000
            ]


why ???  anyone can help me  ?? thanks

Mahmoud Fayed

unread,
May 6, 2022, 2:54:25 PMMay 6
to The Ring Programming Language
Hello Stefano

>> "why ???  anyone can help me  ?? thanks"

Looks like you wrote a new function called mysee() and this problem is related to it

Displaying the Symbol letters (a letter in each line) means that in your function you treated the String as a List
Before using (a for loop) and (len) to print the list items - be sure that it's a list (Not a String)

I.e. using isList() and isString() to check the type

Greetings,
Mahmoud

stefano cerbioni

unread,
May 9, 2022, 5:59:00 AMMay 9
to Mahmoud Fayed, The Ring Programming Language
thanks
> --
>
> ---
> 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/Wu-wsyyaZjw/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/62a1448f-c5e6-40f9-b183-9b8bc7ca01c9n%40googlegroups.com.
>
Reply all
Reply to author
Forward
0 new messages