R RB Smissaert Well-Known Member Licensed User Longtime User Jul 25, 2023 #1 Just wondering if this is possible. If I store to KVS a double value 1: Code: 'cMP.dMilliSecsPerMapTile will be 1 Starter.kvs.Put("Milli seconds per map tile download", cMP.dMilliSecsPerMapTile) and read the blob by connecting to the KVS database I get these bytes: i: 0, byte: 120 i: 1, byte: -100 i: 2, byte: 99 i: 3, byte: 99 i: 4, byte: 0 i: 5, byte: -125 i: 6, byte: 15 i: 7, byte: -10 i: 8, byte: 0 i: 9, byte: 2 i: 10, byte: 94 i: 11, byte: 1 i: 12, byte: 54 Looking at this I guess it is not possible, without knowing how exactly KVS stores these double values. RBS
Just wondering if this is possible. If I store to KVS a double value 1: Code: 'cMP.dMilliSecsPerMapTile will be 1 Starter.kvs.Put("Milli seconds per map tile download", cMP.dMilliSecsPerMapTile) and read the blob by connecting to the KVS database I get these bytes: i: 0, byte: 120 i: 1, byte: -100 i: 2, byte: 99 i: 3, byte: 99 i: 4, byte: 0 i: 5, byte: -125 i: 6, byte: 15 i: 7, byte: -10 i: 8, byte: 0 i: 9, byte: 2 i: 10, byte: 94 i: 11, byte: 1 i: 12, byte: 54 Looking at this I guess it is not possible, without knowing how exactly KVS stores these double values. RBS
Erel B4X founder Staff member Licensed User Longtime User Jul 25, 2023 #2 It looks like you are doing something wrong. maybe dMilliSecsPerMapTile is declared as byte. Upvote 0
R RB Smissaert Well-Known Member Licensed User Longtime User Jul 25, 2023 #3 Erel said: It looks like you are doing something wrong. maybe dMilliSecsPerMapTile is declared as byte. Click to expand... No, dMilliSecsPerMapTile is declared as double: in B4XMainPage: Code: Sub Class_Globals Public dMilliSecsPerMapTile As Double RBS Upvote 0
Erel said: It looks like you are doing something wrong. maybe dMilliSecsPerMapTile is declared as byte. Click to expand... No, dMilliSecsPerMapTile is declared as double: in B4XMainPage: Code: Sub Class_Globals Public dMilliSecsPerMapTile As Double RBS
R RB Smissaert Well-Known Member Licensed User Longtime User Jul 25, 2023 #4 Erel said: It looks like you are doing something wrong. maybe dMilliSecsPerMapTile is declared as byte. Click to expand... All solved now and all I have to do is deserialize ( B4XSerializator) the byte array with for example: Code: Dim dRes As Double = ser.ConvertBytesToObject(arrBytes) RBS Upvote 0
Erel said: It looks like you are doing something wrong. maybe dMilliSecsPerMapTile is declared as byte. Click to expand... All solved now and all I have to do is deserialize ( B4XSerializator) the byte array with for example: Code: Dim dRes As Double = ser.ConvertBytesToObject(arrBytes) RBS