[Newbies] Open that fucking thing.
Hans Schueren
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
uhhhhhhhhh )
So the only thing you have to do is to tell the
strartUpApplication method
the program Name. here Prozentrechnung new open. thats all
3. Now you have to type a Method named open. for Notification to
READ.
4. In most cases is is self and then the startmethod of your own
program.
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
instanceVariableNames:
'Berechnung '
classVariableNames: ''
poolDictionaries: '' !
!Prozentrechnung class methods ! !
!Prozentrechnung methods !
calculate
"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
"Open that fucking thing"
self calculate! !
startUpApplication: oldWindows
"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
application.
For example:
Puzzle15 new open."
Prozentrechnung new open.
More information about the Beginners
mailing list