08-16-2012 07:38 AM
@josy wrote:
Hi,
@ How can we convert a byte array into its original form?Suppose one data is represented as 4 bytes in a byte array how can we reconverted it into one value.I tried some ways using 'flatten to string' but it is returning the values in a non readable form(ie: @^,.5%..).Anybody any suggestions?
I don't know what you mean by "its original form". What is the data type you have now and what are you trying to convert to? An example of an input and its corresponding output would be helpful too.
08-16-2012 07:49 AM
Sorry.If my way of explanation is not good.I will specify an example:-
If we are representing the value '2' in IEEE byte conversion as '63 00 00 00'(4 bytes 1 byte per array index).How to reconvert it into 1.If array contains some more elements we have to take 4 bytes and reconvert them into string.
Thankyou.
08-16-2012 07:55 AM
I'm still not understanding.
My best guess is you either want the Byte Array to String or the Number to Hexidecimal String.
08-16-2012 09:14 AM
You want typecast to convert those 4 bytes into a Single precision floating point number.
08-17-2012 01:07 AM
Thanks guys I did it.In my former post I asked about converting a time stamp into byte.Now I want to know how to reconvert it again into time stamp?
Also If Iam displaying it in a listbox.I want to see the previous time also.That is the previous time I dont want to be deleted.To be more clear 8:30 in first row of listbox,8:31,8:32.....in the coming rows.How can it be?
08-17-2012 07:55 AM - edited 08-17-2012 07:55 AM
Ok, so what you are calling byte is really a string.
08-21-2012 06:50 AM - edited 08-21-2012 06:53 AM
Thanks crossrulz,
But Iam asking can we convert the 'appended array'(Format Timestamp.png 19 KB ) into the timestamp.And not by directly taking from Format Date/Time String.And Iam trying to do the same thing from 'appended array' it is showing Error1 in Scan From String Function.
08-21-2012 11:40 AM
You have to reverse the conversion of the array into a string again. Index out the array using Array Index, use the Format String function with "%s-%s-%s%s%s%s.%s" as you format. You can then use the same conversion I showed earlier.
08-22-2012 03:30 AM - edited 08-22-2012 03:30 AM
Hi crossrulz,
I tried but it is giving the error that too much of format specifiers.So I tried using only one %s.And then used the same conversion as you showed earlier.
That time it is giving error 1.Why it is giving such type of error?
08-22-2012 08:22 AM
@josy wrote:
Hi crossrulz,
I tried but it is giving the error that too much of format specifiers.So I tried using only one %s.And then used the same conversion as you showed earlier.
That time it is giving error 1.Why it is giving such type of error?
Post your code an we'll see what we can find.