"Operand Expected" error

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default "Operand Expected" error

    I am trying to create a "slider" function that works with a gauge needle. Basically, the lever moves vertically and with each pixel movement, the gauge needle needs to move so many degrees. I've received the following code from somewhere else, but I'm getting the "Operand Expected" error. Anyone have any idea what the deal is? What is wrong?

    property thisSprite, animateMe, zeroPoint
    property constraintSprite, constraintHeight
    property dialSprite, minRotation, maxRotation

    on getPropertyDescriptionList
    myPropList = [:]
    myPropList.addProp(#constraintSprite, [#comment: "enter the constraint sprite number:", #format: #integer, #default: 5])
    myPropList.addProp(#dialSprite, [#comment: "enter the dial sprite number", #format: #integer, #default: 10])
    myPropList.addProp(#minRotation, [#comment: "select the minimum dial rotation value:", #format: #integer, #range: [#min: 0, #max: 90], #default: 0])

    myPropList.addProp(#maxRotation, [#comment: "select the maximum dial rotation value:", #format: #integer, #range: [#min: 180, #max: 270], #default: 180])
    return myPropList
    end

    on beginSprite me
    thisSprite = me.spriteNum
    zeroPoint = sprite(constraintSprite).bottom
    constraintHeight = sprite(constraintSprite).height
    animateMe = 0
    end

    on mouseDown me
    animateMe = 1
    end

    on mouseUp me
    animateMe = 0
    end

    on mouseUpOutside me
    animateMe = 0
    end

    on prepareFrame me
    if (animateMe) then
    sprite(thisSprite).locV = constrainV(constraintSprite, the mouseV)
    sprite(dialSprite).rotation = ((zeroPoint -
    sprite(thisSprite).locV)/float(constraintHeight)*(maxRotation - minRotation)) &#43 minRotation
    end if
    end


    Gon2001 webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. #39588 [NEW]: unpack("a*", "abc\0") does not work as expected
      From: pprasse at actindo dot de Operating system: linux 2.6.10 PHP version: 4.4.4 PHP Bug Type: Scripting Engine problem Bug...
    2. Whats a "operand"
      **Error** Scene=Page 1, layer=17, frame=2:Line 10: Operator 'add' must be followed by an operand t add tilenumber add .tilepick = myArrayb I...
    3. "Acrobat PDF file format is having difficulties expected a non-negative integer"
      Posted this in a wrong folder before. Opening many of my AI 10 docs in AI CS is getting me this error message: "Acrobat PDF file format is having...
    4. "Expected a dict object" with Acrobat Prof 6.0 = lock up
      Trying to view a PDF from a website (www.skidmorednagenealogy.com)(PDF entitled "Family Genetics Project") Using Adobe Acrobat Professional 6.0...
    5. execute + ArraySearch causes "Expected end of statement" error - Why?
      Here is the function ArraySearch: '-------------------------------------------------------------------------------------- 'ArraySearch will...
  3. #2

    Default Re: "Operand Expected" error

    On 02 Dec 2003, "Gon2001" [email]webforumsuser@macromedia.com[/email] wrote:
    > I am trying to create a "slider" function that works with a gauge
    > needle. Basically, the lever moves vertically and with each pixel
    > movement, the gauge needle needs to move so many degrees. I've
    > received the following code from somewhere else, but I'm getting the
    > "Operand Expected" error. Anyone have any idea what the deal is? What
    > is wrong?
    [snip]
    > on prepareFrame me
    > if (animateMe) then
    > sprite(thisSprite).locV = constrainV(constraintSprite, the mouseV)
    > sprite(dialSprite).rotation = ((zeroPoint -
    > sprite(thisSprite).locV)/float(constraintHeight)*(maxRotation -
    > minRotation)) &#43 minRotation
    > end if
    > end
    I'm guessing you have a word-wrap problem there. The last three lines
    beginning with 'sprite(dialSprite).rotation =' are probably supposed to be
    on one line or used with the line continuation character. As it is now,
    'zeroPoint -' is missing the operand that the subtraction operator is
    supposed to use.

    on prepareFrame me
    if (animateMe) then
    sprite(thisSprite).locV = constrainV(constraintSprite, the mouseV)
    sprite(dialSprite).rotation = ((zeroPoint -\
    sprite(thisSprite).locV)/float(constraintHeight)\
    *(maxRotation - minRotation)) &#43 minRotation
    end if
    end

    But I have doubts as to the validity of that '&#43 minRotation' at the end.


    --
    Mark A. Boyd
    Keep-On-Learnin' :)
    Mark A. Boyd Guest

  4. #3

    Default Re: "Operand Expected" error

    Well, I too was COMPLETELY oblivious to the validity of the '&#43 minRotation' at the end also. I didn't even realize that the lines were thrown off by not paying attention continuation character. I've looked at what I have now and I think that is causing me a problem.

    I've posted this issue at 5 different forums and you're the only one that has responded. Let's just hope it works or functions in some way by tomorrow. (thats when the assignment is due) No matter the outcome, I appreciate the feedback.

    Still learning :o)



    Gon2001 webforumsuser@macromedia.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139