BinaryEncode

Mark Schonewille m.schonewille at economy-x-talk.com
Sat Dec 6 17:53:08 EST 2008


Hi JB,

BinaryEncode encodes data as binary data. BinaryDecode decodes binary  
data into something else, e.g. hex. You get an error because you are  
trying to encode data while indicating that you are using hex data,  
but you are using plain text (which you might assume to be binary).

Since you want to store your stack as non-binary in a field, you want  
to decode it, using

binaryDecode("h*",theBinaryData,myHexData)
put myHexData into fld id 1009

The reason why you're having problems is not that you're trying to  
transfer binary data, though. It is because you are trying to store  
binary data in a field. When you try to store binary data in a field  
and then retrieve it again, your data gets easily mixed up. If you  
store the data in a custom property instead of a field, it should work  
fine.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz
Dutch forum: http://runrev.info/rrforum

Color Converter has been updated! Get it at
http://colorconverter.economy-x-talk.com !

On 6 dec 2008, at 23:35, -= JB =- wrote:

> Hi Mark,
>
> When I try the code below I get an error dialog.
>
> on mouseUp
>    put "Hello Mark" into theData
>    put binaryencode("h*",theData) into dataEncoded
>    put dataEncoded into fld id 1009
> end mouseUp
>
> Should I be able to put the encoded data in a field without
> decoding it?  Any idea why this does not put something into
> the field?
>
> thanks,
> -=>JB<=-
>
>
>
> On Dec 6, 2008, at 1:56 PM, Mark Schonewille wrote:
>
>> Hi JB,
>>
>> put binaryencode("h*",mySourceVar) into myDestVar
>> get binaryDecode("h*",myDestVar,mySourceVar)
>>
>> What kind of data do you want to encode and what do you want to do  
>> with it?
>>
>> --
>> Best regards,
>>
>> Mark Schonewille
>>
>> Economy-x-Talk Consulting and Software Engineering
>> http://economy-x-talk.com
>> http://www.salery.biz
>> Dutch forum: http://runrev.info/rrforum
>>
>> Color Converter has been updated! Get it at
>> http://colorconverter.economy-x-talk.com !
>>
>> On 6 dec 2008, at 21:47, -= JB =- wrote:
>>
>>> The Rev Dictionary provides info about  the BinaryEncode function  
>>> and it mentions,
>>>
>>>    use the BinaryEncode function to encode one or more values as  
>>> binary data.
>>>
>>> Does this mean I can put a whole field into the BinaryEncode  
>>> function and encode it
>>> and if so does someone have an example of using a whole field?
>>>
>>>
>>> -=>JB<=-
>>
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list