18 Set 2020 10:15
FUNCTION JSON_GTPLAN()
LOCAL hRet:=HB_Hash(), cRet:='', oELEMENTO, oELEMENTO1, a01, a02
cRET:=MEMOREAD( [C:\GTPLAN.TXT] )
hb_JsonDecode( cRet, @hRet )
If Len(hRet) != 0
If HB_HHasKey( hRet, 'bids' )
For EACH oElemento IN hRet['bids']
A01 := oElemento["id_bid"]
hwg_msginfo(a01)
IF HB_HHasKey( hRet, 'items' )
For EACH oElemento1 IN hRet['items']
A02 := oElemento1['id_bid_item']
hwg_msginfo(a02)
NEXT
ELSE
HWG_MSGINFO([Nao achei])
ENDIF
Next
Else
hwg_msginfo('ERRO: '+hb_UTF8ToStr(hRet['Msg']))
Endif
Else
hwg_msginfo('ERRO: Erro no Envio da Chave')
EndIf
RETURN
18 Set 2020 11:02
18 Set 2020 13:02
18 Set 2020 13:27
FUNCTION JSON_GTPLAN()
LOCAL hRet:=HB_Hash(), cRet:='', oELEMENTO, o, a02, A03
cRET:=MEMOREAD( [C:\Users\gilbe\Desktop\GTPLAN.TXT] )
hb_JsonDecode( cRet, @hRet )
//hwg_msginfo(valtoprg(hRet))
If Len(hRet) != 0
If HB_HHasKey( hRet, 'bids' )
For EACH oElemento IN hRet['bids']
//HWG_MSGINFO(HB_ValToExp(oELEMENTO))
A01 := oElemento["id_bid"]
hwg_msginfo(a01)
for each o in oElemento['items']
//HWG_MSGINFO(HB_ValToExp(o))
A02 := o['id_bid_item']
A03 := o['desc_item']
hwg_msginfo( ALLTRIM(a02)+[ ]+ALLTRIM(A03))
next
Next
Else
hwg_msginfo('ERRO: '+hb_UTF8ToStr(hRet['Msg']))
Endif
Else
hwg_msginfo('ERRO: Erro no Envio da Chave')
EndIf
RETURN(.T.)