Problem with BinaryEncode and variable params
revcompgeek at gmail.com
Mon Dec 25 16:05:03 EST 2006
On 12/18/06, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:
> If I execute the following
> put "0,0,1" into x
> put x+0
> I get the error
> Type: Operator (+: error in left operand)
> Object: button id 1003 of card id 1002 of stack "Untitled 1"
> Object name: Button
> Line: put x+0 (row 3 col 7)
> Here, x is a string rather than a number and you can't do
> calculations on it. I bet a similar problem causes your data type
> error. Can you check what is in the variable before you execute
> Consultancy and Software Engineering
> Get your store on-line within minutes with Salery Web Store software.
> Download at http://www.salery.biz
> Op 17-dec-2006, om 17:12 heeft Bryan McCormick het volgende geschreven:
> > Mark,
> > Thanks for the work around, however it would be nice if we could
> > get to the bottom of this and figure out why binaryEncode isn't
> > taking the variable as it should. It ought to work, there are
> > examples out there which did work seemingly in the past using this
> > method.
> > To be clear it is binaryEncode which is throwing the error of
> > "wrong data type". See previous first post where it is pretty clear
> > that binaryEncode should be seeing the vars as numbers.
> > Thanks all.
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
As an answer to your question if I did
put "0,1,0" into temp
put item 1 of temp + 1
It will put "1" in the message box because the "item 1 of temp" is executed
first, giving "0", and then +1 is executed, adding 1 to the result of the
first, which is then send to the message box. Therefore, (item 1 of temp) +
1 is the same as item 1 of temp + 1.
More information about the Use-livecode