FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 25
→
Aula 1050 - WinDev - Json 001/... - Deserialise
Aula 1050 - WinDev - Json 001/... - Deserialise
Débuté par amarildo, 28 jan. 2017 08:15 - 2 réponses
Connectez-vous…
amarildo
#1
Membre enregistré
535 messages
Popularité : +14 (14 votes)
Posté le 28 janvier 2017 - 08:15
// 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
Signaler
0
0
BOLLER
#2
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 08 février 2017 - 16:16
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Signaler
0
0
BOLLER
#3
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 11 août 2017 - 14:18
//-- 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/
Signaler
0
0
→ Revenir à WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte