Page 1 of 1

Posted: Mon Jan 27, 2003 2:15 pm
by BackupUser
Restored from previous forum. Originally posted by JoRo.

See someone here a msitake in the following code?
Under XP home closing the window genareates a Window errormessage.

Form1_hWnd=OpenWindow(0,100,100,400,400,#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget|#PB_Window_SystemMenu,"LIW-Organizer F. E.")
If Form1_hWnd=0 Or CreateGadgetList(Form1_hWnd)=0 : End : EndIf

Fenster1=WindowID()
close.s: Close.s="nein"

CreateMenu(1,Form1_hWnd)
MenuTitle("Hilfe")
MenuItem (73,"Versionsinfo")


Repeat
EventID=WaitWindowEvent()
Window = EventWindowID()
Select Window
Case 0
Select EventID
Case #PB_EventCloseWindow:Close="ja"
Case #PB_EventMenu
Select EventMenuID()
Case 73: Gosub Version
EndSelect
EndSelect
EndSelect
Until Close="ja"

Version:
Form4_hWnd=OpenWindow(3,WinX,WinY,620,520,#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget, "Versionsinfo")

Return


Johannes

Posted: Mon Jan 27, 2003 2:45 pm
by BackupUser
Restored from previous forum. Originally posted by Pupil.

Put 'End' after the repeat:until loop and it works, without this the program return with an error the instant the command 'Return' is run after you've closed the window.

Posted: Tue Jan 28, 2003 12:55 pm
by BackupUser
Restored from previous forum. Originally posted by JoRo.

ups, where was it gone, my end? :)

thanks, Johannes