Alaska Software Inc. - how to break loop in GUI ?
Username: Password:
AuthorTopic: how to break loop in GUI ?
AUGE_OHRhow to break loop in GUI ?
on Mon, 01 May 2006 00:36:56 +0200
hi,

with Cl*pper i use :

nKey := 0
DO WHILE .NOT. MORE_MP3_INFO(oPlayer)
        nKey := INKEY()
        IF nKey = K_ESC
             EXIT
         ENDIF
ENDDO

now i try in Xbase++ GUI :

nKey := 0
DO WHILE .NOT. MORE_MP3_INFO(oPlayer)
        nKey := AppEvent( @mp1, @mp2, @oXbp )
        IF nKey = xbeP_Keyboard .AND. mp1 == xbeK_ESC
             EXIT
        ENDIF
        SLEEP(10)
ENDDO

but it do not "break" loop ...

what does i miss ?

greetings by OHR
Jimmy
James Loughner Re: how to break loop in GUI ?
on Sun, 30 Apr 2006 21:18:28 -0400
Are you declaring mp1 anywhere?

Jim

AUGE_OHR wrote:
> hi,
> 
> with Cl*pper i use :
> 
> nKey := 0
> DO WHILE .NOT. MORE_MP3_INFO(oPlayer)
>         nKey := INKEY()
>         IF nKey = K_ESC
>              EXIT
>          ENDIF
> ENDDO
> 
> now i try in Xbase++ GUI :
> 
> nKey := 0
> DO WHILE .NOT. MORE_MP3_INFO(oPlayer)
>         nKey := AppEvent( @mp1, @mp2, @oXbp )
>         IF nKey = xbeP_Keyboard .AND. mp1 == xbeK_ESC
>              EXIT
>         ENDIF
>         SLEEP(10)
> ENDDO
> 
> but it do not "break" loop ...
> 
> what does i miss ?
> 
> greetings by OHR
> Jimmy
> 
>
AUGE_OHRRe: how to break loop in GUI ?
on Mon, 01 May 2006 04:55:33 +0200
hi,

> Are you declaring mp1 anywhere?

yes i do have as usual :
PROCEDURE XYZ
LOCAL nEvent , mp1 , mp2, oXbp, bBlock
...

greetings by OHR
Jimmy
James Loughner Re: how to break loop in GUI ?
on Sun, 30 Apr 2006 23:16:25 -0400
Is this a pure GUI app or a hybrid?

try
nKey := AppEvent( @mp1, @mp2, @oXbp, 1 )

Jim

AUGE_OHR wrote:
> hi,
> 
>> Are you declaring mp1 anywhere?
> 
> yes i do have as usual :
> PROCEDURE XYZ
> LOCAL nEvent , mp1 , mp2, oXbp, bBlock
> ...
> 
> greetings by OHR
> Jimmy
> 
>
AUGE_OHRRe: how to break loop in GUI ?
on Mon, 01 May 2006 13:09:11 +0200
hi,

> Is this a pure GUI app or a hybrid?

full GUI

> try
> nKey := AppEvent( @mp1, @mp2, @oXbp, 1 )

ah .. with "timeout" ... ok i wll test it.

thx, greetings by OHR
JImmy
Joe Carrick Re: how to break loop in GUI ?
on Sun, 30 Apr 2006 20:04:33 -0700
Hi Jimmy,

Are you sure you ever really get to this loop in the Xbase++ App?

It would really help to see the code.  If you have other event loops in 
this App, it may be that the loop you are showing us never gets executed 
at all.

-Joe

AUGE_OHR wrote:
> hi,
> 
> with Cl*pper i use :
> 
> nKey := 0
> DO WHILE .NOT. MORE_MP3_INFO(oPlayer)
>         nKey := INKEY()
>         IF nKey = K_ESC
>              EXIT
>          ENDIF
> ENDDO
> 
> now i try in Xbase++ GUI :
> 
> nKey := 0
> DO WHILE .NOT. MORE_MP3_INFO(oPlayer)
>         nKey := AppEvent( @mp1, @mp2, @oXbp )
>         IF nKey = xbeP_Keyboard .AND. mp1 == xbeK_ESC
>              EXIT
>         ENDIF
>         SLEEP(10)
> ENDDO
> 
> but it do not "break" loop ...
> 
> what does i miss ?
> 
> greetings by OHR
> Jimmy
> 
>
AUGE_OHRRe: how to break loop in GUI ?
on Mon, 01 May 2006 13:08:14 +0200
hi,

> Are you sure you ever really get to this loop in the Xbase++ App?

yes it is going into MORE_MP3_INFO(oPlayer)

> It would really help to see the code.  If you have other event loops in
> this App, it may be that the loop you are showing us never gets executed
> at all.

it shoud ... ok i have to make a sample

thx for help
greetings by OHR
Jimmy
Bernd ReinhardtRe: how to break loop in GUI ?
on Fri, 05 May 2006 21:40:55 +0200
Hi.
Is the problem the ESC key or the EXIT.
If you press the ESC key are you sure you are in the IF case ( EXIT)?
 IF nKey = xbeP_Keyboard .AND. mp1 == xbeK_ESC
    altd() or msgbox("ESC")
             EXIT
        ENDIF

I have a routine similar to this example:
do while nEvent <> xbeP_Close
 nKey := AppEvent( @mp1, @mp2, @oXbp )
   if nKey == xbeK_ESC
     exit
   else
      oXbp:handleEvent( nEvent, mp1, mp2 )
   endif
enddo
regards
Bernd


"AUGE_OHR" <AUGE_OHR*AT*CSI.COM> schrieb im Newsbeitrag
news:61946dd9$680fa2e$cecc4@news.alaska-software.com...
> hi,
>
> > Are you sure you ever really get to this loop in the Xbase++ App?
>
> yes it is going into MORE_MP3_INFO(oPlayer)
>
> > It would really help to see the code.  If you have other event loops in
> > this App, it may be that the loop you are showing us never gets executed
> > at all.
>
> it shoud ... ok i have to make a sample
>
> thx for help
> greetings by OHR
> Jimmy
>
>
AUGE_OHRresolved
on Fri, 05 May 2006 23:20:39 +0200
hi,

> > it shoud ... ok i have to make a sample

after all it was MORE_MP3_INFO(oPlayer) consuming to much time
and SLEEP() was to short so CPU goes to 100%.

after adjust SLEEP() and AppEvent( @mp1, @mp2, @oXbp, nTimeout )
it now works

thx for help
greetings by OHR
Jimmy
Thomas Braun
Re: resolved
on Mon, 08 May 2006 12:47:39 +0200
AUGE_OHR wrote:

> hi,
> 
>>> it shoud ... ok i have to make a sample
> 
> after all it was MORE_MP3_INFO(oPlayer) consuming to much time
> and SLEEP() was to short so CPU goes to 100%.
> 
> after adjust SLEEP() and AppEvent( @mp1, @mp2, @oXbp, nTimeout )
> it now works

Please try to not open a new discussion-thread for the solution of a
problem the next time. 

Or use this as the new subject: "Resolved, was: how to break loop in GUI ?"

This makes it much easier (later on) for anyone else to follow the
discussion and benefit from your solution.

Thomas
AUGE_OHRRe: resolved
on Mon, 08 May 2006 16:15:18 +0200
hi,

> Please try to not open a new discussion-thread for the solution of a
> problem the next time.

ok

> Or use this as the new subject: "Resolved, was: how to break loop in GUI
?"

no, i wanted to set a "endmark"

> This makes it much easier (later on) for anyone else to follow the
> discussion and benefit from your solution.

this i did not think of

thx, gretings by OHR
Jimmy