Creating menthods 
Author Message
 Creating menthods

I'm doing a course on Smalltalk and I need to create a method which
will simulate an Alarm Clock.  I have to create the method so that a
certain time is reached, the system will produce a dialogue box (a
number of times) stating the time & a message of the users choice.
This is the part I'm stuck at!

The method heading I've to use is this below and the body is what I've
done so far:

waitUntil: aTime withMessgae: aString repeat: aNumber

              [Time now < aTime]
               whileTrue: [].
               Dialog warn:

This is the part I'm stuck at.  I need to be able to put in a Dialog
warn: message which when evaluated in an evaluation pane, the user can
enter any message they want - e.g. 'Time to wake up!'

I really hope this makes sense to someone out there!

Cheers

Julie :)



Tue, 19 Oct 2004 18:58:29 GMT  
 Creating menthods


Quote:
> I'm doing a course on Smalltalk and I need to create a method which
> will simulate an Alarm Clock.  I have to create the method so that a
> certain time is reached, the system will produce a dialogue box (a
> number of times) stating the time & a message of the users choice.
> This is the part I'm stuck at!

The general idea would be this:

  [(Delay forSeconds: 10) wait.
  Dialog warn: 'gotcha'] fork

Making it sleep until a given time rather than for a fixed interval is an
exercise to the reader. :)

--

VisualWorks Engineering
[:s | s, s printString] value: '[:s | s, s printString] value: '



Tue, 19 Oct 2004 23:57:22 GMT  
 Creating menthods
Julie... woah woah Julie

Sorry. Shakin Stevens is living in my head.

Go to this site and ask again, very helpful people here.
http://communities.msn.co.uk/M206StudentsONLY



Wed, 20 Oct 2004 06:29:19 GMT  
 Creating menthods

Quote:

> Julie... woah woah Julie

> Sorry. Shakin Stevens is living in my head.

> Go to this site and ask again, very helpful people here.
> http://communities.msn.co.uk/M206StudentsONLY

Thanks very much - a whole site dedicated to us AND the questions and
answers make so much sense.

Cheers

Julie :)



Sat, 23 Oct 2004 15:44:30 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. how to create a new application with a dictionnary already created

2. Creating a control at runtime - using Create()

3. How to replace or create a file using the open/create/replace.vi

4. Threads creating threads creating threads...

5. GNU ST: getting user-created classes to create new instances

6. How to create 'Creating Data Files' window on opening program...

7. Proper create method, !! or create ?

8. mixing Java byte code created from Ada95 and Java byte code created from Java?

9. Create a program

10. RFC: Creating a "STEP" Site

11. Creating collections - dynamic list operator {...}

12. Creating collections - dynamic list operator - braces

 

 
Powered by phpBB® Forum Software