PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
Aula 1050 - WinDev - Json 001/... - Deserialise
Aula 1050 - WinDev - Json 001/... - Deserialise
Started by amarildo, Jan., 28 2017 8:15 AM - 2 replies
Connect yourself…
amarildo
#1
Registered member
535 messages
Popularité : +14 (14 votes)
Posted on January, 28 2017 - 8:15 AM
// Nessa aula vou mostrar como retirar campos do Json
SAI_
TextoJson
=
[
{"cep":"93410130","tipoDeLogradouro":"Rua","logradouro":"Paraiba","bairro":"Patria Nova","cidade":"Novo Hamburgo","estado":"RS"}
]
_cep_ is
structure
cep is
string
tipoDeLogradouro is
string
logradouro is
string
bairro is
string
cidade is
string
estado is
string
END
Estrutura_json is _cep_
Deserialize
(
Estrutura_json
,
SAI_
TextoJson
,
psdJSON
)
EDT_
rua
=
Estrutura_json.logradouro
EDT_
bairro
=
Estrutura_json.bairro
EDT_
Cidade
=
Estrutura_json.cidade
EDT_
Estado
=
Estrutura_json.estado
EDT_
TipodeLogradouro
=
Estrutura_json.tipoDeLogradouro
http://windevdesenvolvimento.blogspot.com.br/2017/01/aula-1050-windev-json-001-deserialise.html
Report
0
0
BOLLER
#2
Registered member
3,662 messages
Popularité : +175 (223 votes)
Posted on February, 08 2017 - 4:16 PM
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Report
0
0
BOLLER
#3
Registered member
3,662 messages
Popularité : +175 (223 votes)
Posted on August, 11 2017 - 2:18 PM
//-- le o arquivo Json anexado ao projeto --//
gs
PerguntasJson
is ANSI string
=
fLoadText
(
fDataDir
(
)
+
"/questoes.json"
)
gs
PerguntasJson
=
UTF8ToAnsi
(
gs
PerguntasJson
)
//info(gsPerguntasJson)
//-----------------------------------------------------------------------------------------//
//-- agora coloca os dados em um array apos ler a estrrutura e grava na tabela Perguntas --//
//-----------------------------------------------------------------------------------------//
//--estrutura do Json
JsonStru
is structure
pergunta
is ANSI string
resp_a
is ANSI string
resp_b
is ANSI string
resp_c
is ANSI string
resp_d
is ANSI string
resp_e
is ANSI string
resp_f
is ANSI string
resp_g
is ANSI string
resposta
is ANSI string
explicacao
is ANSI string
END
gst
DadosJson
is array of
JsonStru
Deserialize
(
gst
DadosJson
,
gs
PerguntasJson
,
psdJSON
)
//Info( ArrayCount(gstDadosJson))
//Info( gstDadosJson[1].pergunta )
FOR
E
ACH
st
_linha_json OF
gst
DadosJson
Info
(
st
_linha_json.explicacao
)
END
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text