This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-01-01 18:37:33

nsmbodabor
New Scratcher
Registered: 2011-07-19
Posts: 37

(Help) "Symbol(Object)>>doesNotUnderstand: []"

Right, so I just attempted to add a load of variable blocks from panther into my scratch Mod, but upon closing and reopening the scratch window I get the following error:

Symbol(Object)>>error:
Symbol(Object)>>doesNotUnderstand:
[] in ScratchSpriteMorph(ScriptableScratchMorph)>>addGenericVariableBlocksTo:x:y:
Array(SequenceableCollection)>>do:
ScratchSpriteMorph(ScriptableScratchMorph)>>addGenericVariableBlocksTo:x:y:
ScratchSpriteMorph(ScriptableScratchMorph)>>variablesPage
ScratchSpriteMorph(ScriptableScratchMorph)>>viewerPageForCategory:
ScratchViewerMorph>>updateContents
ScratchViewerMorph>>categoryChanged:
ScratchStageMorph(ScriptableScratchMorph)>>addVariable:

From reading it I assume it has something to do with this section, but then again I'm a noob so I have no idea....

addVariable: varName
    "Add a new user variable with the given name to this object. Do nothing if the variable already exists or is built in."
   
    | sFrame stage isGlobal |
    isGlobal _ false.
    (sFrame _ self ownerThatIsA: ScratchFrameMorph) ifNil: [
        (sFrame _ self ownerThatIsA: OffscreenWorldMorph) ifNotNil: [
            sFrame _ sFrame frame.
            stage _ sFrame workPane.
            isGlobal _ stage varNames includes: varName asString.
            ((vars includesKey: varName asString) or: [isGlobal = true]) ifFalse: [
                vars at: varName asString put: 0.
            ].
        ].
    ]
    ifNotNil: [
        (stage _ self ownerThatIsA: ScratchStageMorph)
            ifNotNil: [isGlobal _ stage varNames includes: varName asString].
        ((vars includesKey: varName asString) or: [isGlobal = true]) ifFalse: [
            vars at: varName asString put: 0].
        sFrame viewerPane categoryChanged: 'variables'.].

Any help is much appreciated  wink

Offline

 

#2 2013-01-01 20:13:52

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: (Help) "Symbol(Object)>>doesNotUnderstand: []"

nsmbodabor wrote:

Right, so I just attempted to add a load of variable blocks from panther into my scratch Mod, but upon closing and reopening the scratch window I get the following error:
(Code removed to shorten post.)
Any help is much appreciated  wink

Maybe there is another method that you need to add to your mod. I tried to make an "add variable" blocks to my mod a while ago (without copying from another mod), but it wouldn't create global variables. I do not have Panther on my Mac, so I can't help right now... I am sure someone else can help you though.

Also, use the [code ] [/code ] tags for code and errors.

Last edited by nathanprocks (2013-01-01 20:16:55)


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#3 2013-01-01 20:16:00

nsmbodabor
New Scratcher
Registered: 2011-07-19
Posts: 37

Re: (Help) "Symbol(Object)>>doesNotUnderstand: []"

Thanks, I'll leave it until tommorrow seeing as it's 01:16am, maybe I'll have some new replies in the morning.
Thanks for all your help though  smile

Offline

 

#4 2013-01-02 07:57:27

nsmbodabor
New Scratcher
Registered: 2011-07-19
Posts: 37

Re: (Help) "Symbol(Object)>>doesNotUnderstand: []"

Bump?

Offline

 

#5 2013-01-02 08:20:26

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: (Help) "Symbol(Object)>>doesNotUnderstand: []"

please can we have your Scratch Stage/Scratch/Sprite Morph blockspecs?


http://i.imgur.com/1QqnHxQ.png

Offline

 

#6 2013-01-02 08:24:37

nsmbodabor
New Scratcher
Registered: 2011-07-19
Posts: 37

Re: (Help) "Symbol(Object)>>doesNotUnderstand: []"

Never mind, problem solved now  smile

Offline

 

Board footer