Hallo,
is there a function to read such a hash:
{"UUID"=>"value", "anrede1"=>"frau", "anrede2"=>"", "gender"=>"", "titel"=>"DI", "staat"=>"Indien", "Passnummer"=>"1234", "EmailCheck"=>"Anmelden", "Vorname1"=>"V1", "Nachname1"=>"N1", "GebDatum1"=>"2020-05-12", "Vorname2"=>"V2", "Nachname2"=>"N2", "GebDatum2"=>"2020-05-05", "Vorname3"=>"V3", "Nachname3"=>"N3", "GebDatum3"=>"2020-04-27", "Vorname4"=>"V4", "Nachname4"=>"N4", "GebDatum4"=>"2020-05-04", "Vorname5"=>"V5", "Nachname5"=>"N5", "GebDatum5"=>"2020-05-05", "Email"=>"iris%40atzwanger.com", "herkunft"=>"Italien", "anreise"=>"2020-05-11", "abreise"=>"12052020"}
Thank you in advance
Otto
How to read a hash from a file
How to read a hash from a file
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
Re: How to read a hash from a file
It's not enough with
Code: Select all
hb_JsonDecode( MemoRead( cFile ), @h )
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Re: How to read a hash from a file
Dear Cristobal,
this is working for me only if the hash is like this
{"selected":["117","119","110","111","112","113","101"], "res":{"rooms":["101"]} }
So I will format => to : and insert [] with strtran-function.
Best regards
Otto
this is working for me only if the hash is like this
{"selected":["117","119","110","111","112","113","101"], "res":{"rooms":["101"]} }
So I will format => to : and insert [] with strtran-function.
Best regards
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
Re: How to read a hash from a file
Dear Otto, try withOtto wrote:Dear Cristobal,
this is working for me only if the hash is like this
{"selected":["117","119","110","111","112","113","101"], "res":{"rooms":["101"]} }
So I will format => to : and insert [] with strtran-function.
Best regards
Otto
Code: Select all
hb_JsonDecode( StrTran( MemoRead( cFile ), "=>", ":" ), @h )
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Re: How to read a hash from a file
Dear Cristobal,
Thank you.
Now it is working fine.
In mod harbour I write
Then I download the file with FTP.
Best regards,
Otto
Thank you.
Now it is working fine.
In mod harbour I write
Code: Select all
function Main()
local hPairs := AP_PostPairs()
local cLog
cLog := hb_jsonEncode( ValToChar( hPairs ) )
cSaveTXT := cNewFileName( AP_GETENV( 'DOCUMENT_ROOT' ) + "/meldemax/meldeblatt", "txt" )
MEMOWRIT( cSaveTXT , cLog, .f. )
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: How to read a hash from a file
Otto wrote:Hallo,
is there a function to read such a hash:
{"UUID"=>"value", "anrede1"=>"frau", "anrede2"=>"", "gender"=>"", "titel"=>"DI", "staat"=>"Indien", "Passnummer"=>"1234", "EmailCheck"=>"Anmelden", "Vorname1"=>"V1", "Nachname1"=>"N1", "GebDatum1"=>"2020-05-12", "Vorname2"=>"V2", "Nachname2"=>"N2", "GebDatum2"=>"2020-05-05", "Vorname3"=>"V3", "Nachname3"=>"N3", "GebDatum3"=>"2020-04-27", "Vorname4"=>"V4", "Nachname4"=>"N4", "GebDatum4"=>"2020-05-04", "Vorname5"=>"V5", "Nachname5"=>"N5", "GebDatum5"=>"2020-05-05", "Email"=>"iris%40atzwanger.com", "herkunft"=>"Italien", "anreise"=>"2020-05-11", "abreise"=>"12052020"}
Thank you in advance
Otto
Code: Select all
hHash := &( MEMOREAD( <cfile> ) )
Then if you want you can test the hash with
Code: Select all
XBROWSER hHash
Code: Select all
cJson := HB_JsonEncode( hHash )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India