Harsh lessons in binaryDecode

Mark Schonewille m.schonewille at economy-x-talk.com
Sat May 27 08:56:50 EDT 2006


Hi Alex,

You are right about the crash, but you don't need additional  
variables to avoid it.

on mouseUp
   local lVal1, lVal2, lVal3
   put "1234 5678 123456789012 and some more" into myBin
   get binaryDecode("a4xa4xa12",myBin, lVal1,,lVal2,,lVal3)
   put it && lVal1, lVal2, lVal3
end mouseUp

This is good to know, if you are decoding large amounts of data.

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Salery is the easiest way to get your own web store on-line: http:// 
www.salery.biz/salery.html



Op 27-mei-2006, om 14:33 heeft Alex Tweedly het volgende geschreven:

> Here's the recipe - switch the commented out lines to see the  
> problem ...
>
> [ in the script of a button ]
> local lV
> on mouseUp
>  put "1234 5678 123456789012 and some more" into lV
>  doit
> end mouseUp
>
> on doit
>  local tVal1, tVal2, tVal3
>  local x1, x2
>  --  get binaryDecode("a4xa4xa12", lV, tVal1, tVal2, tVal3)
>  get binaryDecode("a4xa4xa12", lV, tVal1, x1, tVal2, x2, tVal3)
>  put it && tVal1, tVal2, tVal3 & cr after msg
> end doit
>
>
> Moral of the day, for those who've made it this far ...
>  I've spent more hours with this problem than I will ever save  
> seconds in run time from this efficiency :-)
>
> -- 
> Alex Tweedly




More information about the use-livecode mailing list