Re: Working with a 64 bit Integer in an object
On Nov 4, 2017, at 2:00 PM, Jim Crate wrote: > Have you tried your favorite scripting language? Most (ruby/python/perl) have > good JSON support. > > Alternatively, you could try a standalone binary parser, possibly in > combination with curl. I haven’t used this one but it looks interesting. You > might be able to simply reformat the json so the value you need is a string > so you can access it with 4D. Probably a PHP library out there you could use from inside 4D that handles JSON 64bit integers. That is if you can finagle it into workings. Sometimes those PHP libraries need to be massaged a bit to make them work with 4D. Check this link out: https://stackoverflow.com/questions/44383612/json-encoding-unsigned-64-bit-integers-in-php Tim Tim Nevels Innovative Solutions 785-749-3444 timnev...@mac.com ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Working with a 64 bit Integer in an object
On Nov 1, 2017, at 3:47 PM, Justin Leavens via 4D_Tech <4d_tech@lists.4d.com> wrote: > Is it possible to work with a 64 bit integer that's being returned to me in > an object from an HTTP call? I can't seem to avoid it being turned into > "-1.502644539978e+18". I also have a POST that requires me to pass back the > 64-bit int value. I would use 4D or NTK for the object handling if it made a > difference. Have you tried your favorite scripting language? Most (ruby/python/perl) have good JSON support. Alternatively, you could try a standalone binary parser, possibly in combination with curl. I haven’t used this one but it looks interesting. You might be able to simply reformat the json so the value you need is a string so you can access it with 4D. https://stedolan.github.io/jq/ Jim Crate ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Working with a 64 bit Integer in an object
Hi Justin, in this case, use low-level routines for the communication (receive BLOB for example or some equivalent using Keisukes cUrl Plugin) and parse the received data „by hand“. Tedious, but you have full control. > Am 03.11.2017 um 00:12 schrieb Justin Leavens via 4D_Tech > <4d_tech@lists.4d.com>: > > Keisuke Miyako wrote >> it seems correct that a number is mapped to real, according to JSON >> specification >> ... >> >> if you must exchange Int64, I think it is the responsibility of the sender >> to use string. >> >>> 2017/11/03 3:56、Justin Leavens via 4D_Tech < > >> 4d_tech@.4d > >>> のメール: >>> Unfortunately, 4D seems to munge the value immediately within the object >>> when the HTTP response is returned in an object. > > I'm sure you are correct. Unfortunately, I don't have the power to force a > change from the provider. > > > > -- > Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Working with a 64 bit Integer in an object
Keisuke Miyako wrote > it seems correct that a number is mapped to real, according to JSON > specification > ... > > if you must exchange Int64, I think it is the responsibility of the sender > to use string. > >> 2017/11/03 3:56、Justin Leavens via 4D_Tech < > 4d_tech@.4d >> のメール: >> Unfortunately, 4D seems to munge the value immediately within the object >> when the HTTP response is returned in an object. I'm sure you are correct. Unfortunately, I don't have the power to force a change from the provider. -- Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Working with a 64 bit Integer in an object
it seems correct that a number is mapped to real, according to JSON specification > number > int > int frac > int exp > int frac exp > int > digit > digit1-9 digits > - digit > - digit1-9 digits > frac > . digits > exp > e digits > digits > digit > digit digits > e > e > e+ > e- > E > E+ > E- http://json.org if you must exchange Int64, I think it is the responsibility of the sender to use string. > 2017/11/03 3:56、Justin Leavens via 4D_Tech <4d_tech@lists.4d.com> のメール: > Unfortunately, 4D seems to munge the value immediately within the object > when the HTTP response is returned in an object. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Working with a 64 bit Integer in an object
4D Tech mailing list wrote > Yeah, if 4D isn't working, try NTK. In either case, if you can get at the > value as raw text then you'll be able to find text --> 64-bit conversion > code. The question in 4D at that point is how to store it. I know it's a > field type, but can you touch it with anything other than SQL? Unfortunately, 4D seems to munge the value immediately within the object when the HTTP response is returned in an object. And the same happens when I use NTK's JSON Get Number. So unfortunately I'm a little stuck. I've asked Rob if he can figure out how to return the value in a string. -- Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Working with a 64 bit Integer in an object
> Le 1 nov. 2017 à 21:16, David Adams via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > I know it's a field type, but can you touch it with anything other than SQL? I'm wondering since a while about this: 64 bit is 128/2, 128 is a uuid, a uuid can be managed in langage as hexadecimal string and there is a uuid type field. Unfortunately I don't know how to convert a 64 bit number to hexadecimal. -- Arnaud de Montard ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Working with a 64 bit Integer in an object
Yeah, if 4D isn't working, try NTK. In either case, if you can get at the value as raw text then you'll be able to find text --> 64-bit conversion code. The question in 4D at that point is how to store it. I know it's a field type, but can you touch it with anything other than SQL? ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **