[Newbies] Open that fucking thing.
werbung at hans-schueren.de
Thu Dec 11 12:54:32 UTC 2014
Who says that programming in smalltalk is different from others ?
You can write smalltalk with a simple Texteditor. However.
I have written a simple program here , with smalltalk V 2.0 , 16bit
1. The programs name is : Prozentrechnung
Only one class is the programm. Only one method is the program.
ok. there could be more interdependencies such like "subroutines"
not important for understanding
2. The method "startUpApplication" from the class "Notification"
is responsible for opening the own programm. ( itself a class
So the only thing you have to do is to tell the
the program Name. here Prozentrechnung new open. thats all
3. Now you have to type a Method named open. for Notification to
4. In most cases is is self and then the startmethod of your own
Here in my program the Promter is asking first with a simple window
to INPUT DATA !
Very simple and easy.
I dont care about the endless procedures in other smalltalk implementations
but one thing is shure . " i have opened that fucking thing here in
smalltalk ! "
Object subclass: #Prozentrechnung
poolDictionaries: '' !
!Prozentrechnung class methods ! !
!Prozentrechnung methods !
"Simple Percentage Calculation"
| x y ergebnis |
x := Prompter prompt: 'Input a sum' default: ' '.
x := x asInteger.
y := Prompter prompt: 'Input percentage % : ' default: ' '.
y := y asInteger.
ergebnis := x * (y/100).
MessageBox message: 'Ergebnis ist: ' , ergebnis printString!
"Open that fucking thing"
self calculate! !
"Opens up the the run-time application window.
oldWindows are the windows that were opened when
the image was saved."
"Replace the below code with the startup code for you
Puzzle15 new open."
Prozentrechnung new open.
More information about the Beginners