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

#1 2011-05-30 03:06:52

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Useful Squeak Code

I am making this topic to contain helpful Smalltalk-1080 (AKA - Squeak). It's not a guide to get started, but rather a guide to help those who already know the language.

Please do NOT post here with comments like 'Cool'. Only post if you are submitting more code or asking questions.


You can now reach me on Twitter @johnnydean1_

Offline

 

#2 2011-05-30 03:13:41

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Useful Squeak Code

cool!  lol

sorry, I have a bad sense of humour, but I do have a question - Do you know Squeak?


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#3 2011-05-30 03:17:03

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Useful Squeak Code

Repeating Commands
LENGTH timesRepeat: [ COMMANDS TO REPEAT ].

LENGTH = No. Times to repeat
COMMANDS TO REPEAT = Squeak code to use.


You can now reach me on Twitter @johnnydean1_

Offline

 

#4 2011-05-30 03:18:52

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Useful Squeak Code

jji7skyline wrote:

cool!  lol

sorry, I have a bad sense of humour, but I do have a question - Do you know Squeak?

Yes, Now can you delete your question.


You can now reach me on Twitter @johnnydean1_

Offline

 

#5 2013-03-30 10:25:06

mrsrec
Scratcher
Registered: 2010-11-14
Posts: 100+

Re: Useful Squeak Code

This Isn't Going So Well.
Quote This In The First Post:

beep

Code:

('beep' #- #beep)

For A Block. If You Want To Use It In A Method, Use

Code:

self beep

Or

Code:

Object beep

Check Out Kernel-Objects > Object > Instance > Error Handling > Beep
big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile
Boxing
BlockSpec:

Code:

('make dialog label %s text %s' #- #doDialogWTitle:text: 'Hi!' 'Mrsrec Is The Best Scratcher!')

Now The Method YOU MUST HAVE THIS FOR THE BLOCK TO WORK, UNLIKE BEEP!
The Method Goes Under Instance, And Any Category To The Right Of The One That Says ScriptableScratchMorph, You Can Choose Any Of Them. If You Choose All, It Goes To A Cateogry Called "As Yet Unclassified". The Method:

Code:

doDialogWTitle: t1 text: t2
      DialogBoxMorph inform: t2 title: t1

big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile   big_smile


Random Scraps Of Code :

Code:

(Smalltalk isMacOSX) ifTrue: [  ] ifFalse: [  ]

Code:

Smalltalk snapshot: false andQuit: true

Code:

HandMorph openScratchFrame

Well, All For Now! Thanks!

Last edited by mrsrec (2013-03-30 10:28:09)


Scratchy Scratcher Scratched Scratch Scratches When He Scratchy Scratches Scratch Projects. These Scratch Projects Were Started From Scratch.
http://internetometer.com/image/37716.png

Offline

 

Board footer