I made a drop down list for positive/negative. I get an error message if I try using the list and if I use the block at all then it reports 'Error!'. Here's my code for this:
('%P of %n' #r #negative: 'negative'That's from Scratch-Objects->ScriptableScratchMorph->Class->blockspecs->blockspecs
I'm not doing everything on the page of Scratch-Blocks->CommandBlockMorph->--all-- ->
uncoloredArgMorphFor: I'm just doing my list because I can't copy off of that for some reason.
$P = t2 IfTrue: [ChoiceOrExpressionArgMorph new getOptionsSelector: #negpos; choice: 'negative'
Here's Scratch-Objects->ScriptableScratchMorph->other ops-> negative:
negative: t1 to:t2 t2 < 0 and t1 = 'positive' IfTrue: [^ t2 + t2* t2]. t2 > 0 and t1 = 'negative' IfTrue: [^ t2 - t2* t2]. ^ 'Error!'
Now, if you remember
Scratch-Objects->ScriptableScratchMorph->Class->blockspecs->blockspecs
broadcasted to make the method posneg Here's
Scratch-Objects>ScriptableScratchMorph->other ops-> negpos:
negpos
^ #('negative' 'positive')Thanks for using your time to help me. You guys are awesome!
Offline
uncoloredargmorph:
$P = t2 IfTrue: [ChoiceOrExpressionArgMorph new getOptionsSelector: #negpos;
choice: 'negative'.
method:
negative: t1 to: t2 t1 = 'positive' ifTrue: [^ t2 abs]. t1 = 'negative' ifTrue: [^ (t2 abs) * -1]. ^ self error
Not sure if these will work...
Keep your other stuff.
Offline
thanks! But still nothing.
Last edited by ImagineIt (2011-07-07 09:04:49)
Offline
GP1 wrote:
You can only cut-and-paste, you can't copy-and-pste for some reason, I don't know why, for some reason
In Bingo, I modified the 'copy' menu entry so that it cuts, then pastes automatically. It looks like nothing happened but it copied the stuff to the clipboard. Useful when your ALT key is broken
(Consider this post as a rare occasion where I have internet during vacation)
Offline