[C++] Profan²

A

AND1

Gast
Profan²

Hi!
Hab seid Oktober Informatik.Unser Lehrer hat nur Erfahrung mit Basic und C++.Er hat sich genau wie ich und 2 Andere der Klasse von http://www.profan.de/ und wir kommen nicht weiter.Das Problem liegt dabei,dass wir mal oder geteilt nicht aktivieren können.
Hab mal versucht geteilt einzu fügen,aber es startet nicht.Auf jeden Fall hier das Programm(mit meiner geteilt lösung(läuft aber ohne fehler)) :

SetErrorLevel 0

DECLARE EE%,win1%,EE1%,back1%,OK%,info%
DECLARE hilfe%,plus%,minus%,mal%,teil%,ende%
DECLARE eing1!,eing2!,ergebnis!
DECLARE eing1$,eing2$,ergebnis$
DECLARE txt%,font1%,font2%
DECLARE programm$
'------------------------------------
DECIMALS 5 'hier kannst Du die Nachkommastellen bestimmen
programm$= "Unvertiger Rechner"
'------------------------------------
font1%=CREATEFONT("Times New Roman",20,0,1,0,0)
font2%=CREATEFONT("Times New Roman",16,6,0,0,0)
'------------------------------------
PROC MINUS
eing1$=""
eing2$=""
win1%=CREATEDIALOG(%HWnd," Subtraktion",SUB(DIV(%MaxX,2),170),SUB(DIV(%MaxY,2),20),345,195)
txt%=CREATETEXT(win1%,"Erste Eingabe:",45,15,100,20)
SetFont txt%,font2%
txt%=CREATETEXT(win1%,"Zweite Eingabe:",35,50,110,20)
SetFont txt%,font2%
eing1!=CREATEEDIT(win1%,eing1$,160,10,150,25)
eing2!=CREATEEDIT(win1%,eing2$,160,45,150,25)
CREATEGROUPBOX(win1%,"",20,80,300,40)
back1%=CREATEBUTTON(win1%,"&Abbrechen",30,135,100,25)
SetFont back1%,font2%
OK%=CREATEBUTTON(win1%,"&ERGEBNIS",210,135,100,25)
SetFont OK%,font2%
EE1%=0
SetFocus(eing1!)
WhileNot EE1%
WAITINPUT
IF OR(GetFocus(back1%),ScanKey(65))
DesTroyWindow(win1%)
EE1%=1
EndIf
IF OR(GetFocus(OK%),EQU(%Key,13))
eing1$=GETTEXT$(eing1!)
eing2$=GETTEXT$(eing2!)
eing1!=VAL(eing1$)
eing2!=VAL(eing2$)
ergebnis!=SUB(eing1!,eing2!)
ergebnis$=STR$(ergebnis!)
txt%=CREATETEXT(win1%,ergebnis$,35,93,250,20)
SetFont txt%,font1%
ENDIF
WEND
ENDPROC
'---------------------------------------
PROC PLUS
eing1$=""
eing2$=""
win1%=CREATEDIALOG(%HWnd," Addidtion",SUB(DIV(%MaxX,2),170),SUB(DIV(%MaxY,2),20),345,195)
txt%=CREATETEXT(win1%,"Erste Eingabe:",45,15,100,20)
SetFont txt%,font2%
txt%=CREATETEXT(win1%,"Zweite Eingabe:",35,50,110,20)
SetFont txt%,font2%
eing1!=CREATEEDIT(win1%,eing1$,160,10,150,25)
eing2!=CREATEEDIT(win1%,eing2$,160,45,150,25)
CREATEGROUPBOX(win1%,"",20,80,300,40)
back1%=CREATEBUTTON(win1%,"&Abbrechen",30,135,100,25)
SetFont back1%,font2%
OK%=CREATEBUTTON(win1%,"&ERGEBNIS",210,135,100,25)
SetFont OK%,font2%
EE1%=0
SetFocus(eing1!)
WhileNot EE1%
WAITINPUT
IF OR(GetFocus(back1%),ScanKey(65))
DesTroyWindow(win1%)
EE1%=1
EndIf
IF OR(GetFocus(OK%),EQU(%Key,13))
eing1$=GETTEXT$(eing1!)
eing2$=GETTEXT$(eing2!)
eing1!=VAL(eing1$)
eing2!=VAL(eing2$)
ergebnis!=ADD(eing1!,eing2!)
ergebnis$=STR$(ergebnis!)
txt%=CREATETEXT(win1%,ergebnis$,35,93,250,20)
SetFont txt%,font1%
ENDIF
WEND
ENDPROC
'---------------------------------------
PROC TEIL
eing1$=""
eing2$=""
win1%=CREATEDIALOG(%HWnd," Division",SUB(DIV(%MaxX,2),170),SUB(DIV(%MaxY,2),20),345,195)
txt%=CREATETEXT(win1%,"Erste Eingabe:",45,15,100,20)
SetFont txt%,font2%
txt%=CREATETEXT(win1%,"Zweite Eingabe:",35,50,110,20)
SetFont txt%,font2%
eing1!=CREATEEDIT(win1%,eing1$,160,10,150,25)
eing2!=CREATEEDIT(win1%,eing2$,160,45,150,25)
CREATEGROUPBOX(win1%,"",20,80,300,40)
back1%=CREATEBUTTON(win1%,"&Abbrechen",30,135,100,25)
SetFont back1%,font2%
OK%=CREATEBUTTON(win1%,"&ERGEBNIS",210,135,100,25)
SetFont OK%,font2%
EE1%=0
SetFocus(eing1!)
WhileNot EE1%
WAITINPUT
IF OR(GetFocus(back1%),ScanKey(65))
DesTroyWindow(win1%)
EE1%=1
EndIf
IF OR(GetFocus(OK%),EQU(%Key,13))
eing1$=GETTEXT$(eing1!)
eing2$=GETTEXT$(eing2!)
eing1!=VAL(eing1$)
eing2!=VAL(eing2$)
ergebnis!=DIV(eing1!,eing2!)
ergebnis$=STR$(ergebnis!)
txt%=CREATETEXT(win1%,ergebnis$,35,93,250,20)
SetFont txt%,font1%
ENDIF
WEND
ENDPROC
'------------------------------------
PROC INFORMATION
DECLARE text$
text$="Huldigt Satan, \n\n"
text$=text$;"wenn nicht werdet ihr sterben."
MESSAGEBOX(text$," Information",64)
ENDPROC
'------------------------------------
PROC HILFETEXT
Addstring ""
Addstring "Ich gratuliere;"
Addstring "sie haben mit diesem Knopfdruck"
Addstring "ihr Dummheit bestätigt."
Addstring ""
Addstring "Vergest nicht: "Nur Idioten brauchen Hilfe.""
ENDPROC
'------------------------------------
PROC HILFE
DECLARE help%,list%,back2%,EE2%
WindowStyle 48
CLEARLIST
help%=CREATEWINDOW(%HWnd,ADD$(" Hilfe für den ",programm$),SUB(DIV(%MaxX,2),150),SUB(DIV(%MaxY,2),200),300,400)
list%=CREATELISTBOX(help%,"",5,5,282,330)
SetFont list%,font2%
back2%=CREATEBUTTON(help%,"&Schliessen",100,345,100,25)
SetFont back2%,font2%
HILFETEXT
MoveListToList(list%)
EE2%=0
WhileNot EE2%
WAITINPUT
IF OR(ScanKey(83),GetFocus(back2%))
EE2%=1
DesTroyWindow(help%)
EndIf
WEND
ENDPROC
'------------------------------------
HAUPTPROGRAMM:
SetTrueColor 1
WindowStyle 24
WINDOW SUB(DIV(%MaxX,2),200),SUB(DIV(%MaxY,2),200)-400,400
WindowTitle programm$
USEICON "COMPUTER"
TextColor rgb(0,0,150),-1
UseBrush 1,rgb(170,180,190)
RECTANGLE 0,0-400,400
LOADSIZEDBMP ADD$($WINPATH,"\SETUP.BMP"),35,180-330,160;0
hilfe%=CREATEBUTTON(%HWnd,"F1 Hilfe",1,1,100,30)
SetFont hilfe%,font1%
ende%=CREATEBUTTON(%HWnd,"ESC Ende",295,1,100,30)
SetFont ende%,font1%
info%=CREATEBUTTON(%HWnd,"",180,50,36,36)
CREATEICON(info%,"A",1,1)
'-------------------------------------------------
plus%=CREATEBUTTON(%HWnd,"&Plus",1,50,100,36)
SetFont plus%,font1%
minus%=CREATEBUTTON(%HWnd,"minu&S",1,100,100,36)
SetFont minus%,font1%
'-------------------------------------------------
mal%=CREATEBUTTON(%HWnd,"&Malnehmen",295,50,100,36)
SetFont mal%,font1%
teil%=CREATEBUTTON(%HWnd,"&Teilen",295,100,100,36)
SetFont teil%,font1%
'-------------------------------------------------
EE%=0
WhileNot EE%
WAITINPUT
CREATEICON(info%,"A",1,1)
Case OR(GetFocus(hilfe%),ScanKey(112)):HILFE
Case OR(GetFocus(ende%),ScanKey(27)):EE%=1
Case OR(GetFocus(plus%),ScanKey(80)):PLUS
Case OR(GetFocus(minus%),ScanKey(83)):MINUS
Case GetFocus(info%):INFORMATION
WEND
END

Vielen Dank im Vorraus.
 
Zurück
Oben