Page 1 of 1

Multiple Instances of Repeat

Posted: Mon Jun 23, 2003 12:33 pm
by jim.richards
Hi All,

Is it possible to have multiple instances of Repeat? I am trying to break out the event handling for a multiple windowed app.

Thanks
Jim

Posted: Mon Jun 23, 2003 1:01 pm
by Fred
without problem.

Re: Multiple Instances

Posted: Mon Jun 23, 2003 2:57 pm
by jim.richards
So I assume it would be handled as follows:

Procedure Window_1
Repeat
Until
EndProcedure

Procedure Window_2
Repeat
Until
EndProcedure

Thanks For Feedback

Posted: Mon Jun 23, 2003 3:45 pm
by freak
Best way to handle multiple windows would be this:

Code: Select all

Repeat
  Event.l = WaitWindowEvent()  ; save the event

  Select EventWindowID()  ; check which window the Event.l was on

    Case 0  
      ; The Event occured on Window 0
      ; 0 is the number you gave the window at OpenWindow(0, ...)

      ; now see what event it was...
      ; so this is the event handling for window 0
      Select Event.l
      
        ; ...
      EndSelect

    Case 1
      ; Event was on Window 1
      ; put event handling for window 1 here

    ; ...

  EndSelect
Until Whatever = Something ; continue until your end cóndition is met
The Events from all windows will arrive here, one at a time, so there is
no need for different loops for all the windows.

Timo