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

#1 2011-06-23 15:58:30

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

repeat until in smalltalk

Sorry, quick question, how do you do repeat until (value 1) = (value 2) in smalltalk?

I imagine it's some sort of while statement with curly brackets to contain the code but I don't know the syntax!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#2 2011-06-23 16:12:32

Baderous
New Scratcher
Registered: 2011-04-14
Posts: 100+

Re: repeat until in smalltalk

[value1 = value2] whileFalse: [ value1=value1+1. ]

I didn't test but it should be something like this.

Offline

 

#3 2011-06-23 17:01:20

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: repeat until in smalltalk

Thanks. This is giving me the error "Message not understood: asLowercase" Even though there is no asLowercase attribute in the code!

Code:

|t1 path format lib content|
path_ 'C:\Users\Username\blocks\'.
format_'.blk'.
lib_'http://dl.dropbox.com/u/6273449/'.
t1_'1'.

[self readLine: '2' FromUrl: lib, t1, '.txt' = '<html>']whileFalse:[ 
content_self readFromUrl: lib, t1, '.txt'. 
self clearFile: path, t1, format.
self writeText: content  toFile: path, t1, format.
t1_ t1 + '1'.
]

Last edited by sparks (2011-06-23 17:01:33)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#4 2011-06-25 08:57:35

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

Re: repeat until in smalltalk

It may be calling a method which as 'asLowercase' in it and it is causing an error.


You can now reach me on Twitter @johnnydean1_

Offline

 

#5 2011-06-25 09:28:29

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: repeat until in smalltalk

sparks wrote:

Thanks. This is giving me the error "Message not understood: asLowercase" Even though there is no asLowercase attribute in the code!

Code:

|t1 path format lib content|
path_ 'C:\Users\Username\blocks\'.
format_'.blk'.
lib_'http://dl.dropbox.com/u/6273449/'.
t1_'1'.

[self readLine: '2' FromUrl: lib, t1, '.txt' = '<html>']whileFalse:[ 
content_self readFromUrl: lib, t1, '.txt'. 
self clearFile: path, t1, format.
self writeText: content  toFile: path, t1, format.
t1_ t1 + '1'.
]

Sparks, debug it and look where asLowercase is, hats what I do.  tongue  Click debug and look in the methods it has on the debug list for asLowercase.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#6 2011-06-25 09:47:59

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: repeat until in smalltalk

sparks wrote:

Thanks. This is giving me the error "Message not understood: asLowercase" Even though there is no asLowercase attribute in the code!

Code:

|t1 path format lib content|
path_ 'C:\Users\Username\blocks\'.
format_'.blk'.
lib_'http://dl.dropbox.com/u/6273449/'.
t1_'1'.

[self readLine: '2' FromUrl: lib, t1, '.txt' = '<html>']whileFalse:[ 
content_self readFromUrl: lib, t1, '.txt'. 
self clearFile: path, t1, format.
self writeText: content  toFile: path, t1, format.
t1_ t1 + '1'.
]

I have the same problem with my bounce block, but it says "NOT MIN" and all that other *


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

Board footer