Android Question KeyValueStore get <> value o.O

Douglas Farias

Expert
Licensed User
Longtime User
HI
i m using the kvs on my main to put this value
my idsocial as string
idsocial = 112847041627280480255
kv.Initialize(fp, "data")
kv.PutSimple("idsocial",idsocial)

Log(kv.GetSimple("redesocial")) = 1.12847e+20

why this o_O?
 

Mahares

Expert
Licensed User
Longtime User
Try this Douglas, It should work for you. By the way, I hope you did not lose sleep over Brazil losing the match.
B4X:
Dim idsocial As String = "12847041627280480255"
kv.Initialize(File.DirRootExternal, "data")
kv.PutObject("idsocial",idsocial)  
Log(kv.GetObject("idsocial")) 'displays 12847041627280480255
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
jajaja i dont like soccer xD
I was rooting for any other team and not for Brazil.
the Brazil this crap. and our president spending with world cup :mad:

about the code i m using with last character c
12847041627280480255c < as string and now works *-*
thx
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
jajaja i dont like soccer xD
I was rooting for any other team and not for Brazil.
the Brazil this crap. and our president spending with world cup :mad:

about the code i m using with last character c
12847041627280480255c < as string and now works *-*
thx

The problem is that the value 12847041627280480255 is interpreted in the log-command as an NUMBER which is too big so you get the result of 1.12847e+20

you dont need the c at the end... Try using putOBJECT to write this value OR create a string first and then read the value to this this string before you use log.

B4X:
idsocial = 112847041627280480255
kv.Initialize(fp, "data")
kv.PutSimple("idsocial",idsocial)
dim idsocial2 as string
idsocial2 = kv.GetSimple("idsocial")
'                                         ^^^^ In your code you have read the value with
'                                                     kv.GetSimple("redesocial") (probalby an other
'                                                     value which you expected.
log(idsocial2)
 
Last edited:
Upvote 0
Top