Wert x wird nicht erkannt
Verfasst: 22.10.2005 17:22
Hallo,
folgender Code:
Wenn dieser Code ausgeführt wird, wird der Wert x in der Zeile
konsequent als 0 interpretiert, obwohl der Wert x oben bei Random alles andere als 0 ist. Wie kommt das?
PB42
folgender Code:
Code: Alles auswählen
OpenWindow(0,300,300,500,250,#PB_Window_SystemMenu|#PB_Window_screencentered|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget,"") And CreateGadgetList(WindowID(0))
arial=LoadFont(#PB_any, "Arial", 15, #PB_Font_Highquality)
x = Random(100) + 1
y = Random(10) + 1
x + y = z
StringGadget(1,180,80,50,30,"")
ButtonGadget(2,240,80,50,30,"OK")
SetGadgetState(1,2)
ActivateGadget(1)
StartDrawing(WindowOutput())
FrontColor(0,0,200)
DrawingMode(1)
Locate(50,10)
DrawingFont(UseFont(arial))
DrawText("")
Locate(50, 80)
DrawText(Str(x) + " + " + Str(y) + " = ")
StopDrawing()
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_EventCloseWindow
Code: Alles auswählen
DrawText(Str(x) + " + " + Str(y) + " = ")
PB42