Jump to content
Fivewin Brasil

Tag em Json (Resolvido)


betovsp

Recommended Posts

Olá pessoal, tudo bem?

Preciso verificar se dentro de um array multidimensional, possui uma tag específica, no harbour tem uma função pra isso, mas no xharbour eu não sei.

Alguém já teve essa necessidade e resolveu?

Obrigado.

Link to comment
Share on other sites

Eu uso xharbour 1.2.3

Geralmente eu transformo o JSON em HASH e depois procuro no Hash

hHash     := Hash()

cJSON:='{'+;
                '"message": "Segue documento para assinatura.",'+;
                '"skip_email": "0",'+;
                '"workflow": "1"'+;      
             '}'

hb_jsondecode( cJSON, @hHash ) // aqui transforma o JSON em HASH

IF HHasKey( hHash, 'workflow' )   

? 'EXISTE'

ELSE

? 'NÃO EXISTE'

ENDIF

 

Link to comment
Share on other sites

4 horas atrás, sygecom disse:

Eu uso xharbour 1.2.3

Geralmente eu transformo o JSON em HASH e depois procuro no Hash

hHash     := Hash()

cJSON:='{'+;
                '"message": "Segue documento para assinatura.",'+;
                '"skip_email": "0",'+;
                '"workflow": "1"'+;      
             '}'

hb_jsondecode( cJSON, @hHash ) // aqui transforma o JSON em HASH

IF HHasKey( hHash, 'workflow' )   

? 'EXISTE'

ELSE

? 'NÃO EXISTE'

ENDIF

 

Show, era isso mesmo, ontem já havia localizado, esqueci de postar aquio.

Vlw.

Link to comment
Share on other sites

  • betovsp changed the title to Tag em Json (Resolvido)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...