Problem with BinaryEncode and variable params
m.schonewille at economy-x-talk.com
Mon Dec 18 04:35:17 EST 2006
Do you know that item 1 of 0,0,0+1 doesn't make much sense and is the
same as item 1 of 0,0,1 which will return 0?
Consultancy and Software Engineering
Get your store on-line within minutes with Salery Web Store software.
Download at http://www.salery.biz
Op 16-dec-2006, om 17:06 heeft Bryan McCormick het volgende geschreven:
> I am a bit baffled here. I have seen many sample scripts where
> variables are passed as parameter to binaryEncode (in my case, for
> imageData) but no matter how I try to pass the known numeric
> values, the compiler throws an error.
> For example:
> take a string of the form 0,206,0 as returned from the color
> picker, let's call this tColors
> Then I put each value into a separate param
> put item 1 of tColors+0 into c1
> put item 2 of tColors+0 into c2
> put item 3 of tColors+0 into c3
> (I added the +0 to make sure the var was seen as a number, I tried
> it without as well with the same error)
> Then I call:
> put binaryEncode("CCCC",0,c1,c2,c3) into varNewImageData
> and it fails.
> I tried to pass all the params as a quoted string, concatenated,
> you name it I have tried it.
> It's likely dead simple. But for the life of me I cannot get it.
> This is in 2.7.4
More information about the Use-livecode