Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Smart Pause
#2
Add a correctly written _EXIT subroutine and you'd have to use Task manager to close it. Big Grin 

I always coded my own pause routines for my apps. Sleep is nice for pausing when debugging. You can use it with INKEY$ and still get input...

Code: (Select All)
Sleep
b$ = InKey$
Print b$
End

...but that's a pretty Mickey Mouse way to avoid a loop.

You know in 2005 you could do something like this in QuickBasic...

Code: (Select All)
Z1 = Timer: Z3 = Timer
Do
    '''IF MSE >= 0 THEN EX% = 2: CALL MDRIVER(EX%, B$, POP)
    Z2 = Timer
    If Z1 > Timer Then Z1 = Z1 - 86400: Rem MIDNIGHT ISSUES
    If Z3 > Timer Then Z3 = Z2: Rem MIDNIGHT ISSUES
    If Abs(Z2 - Z3) > .2 Then Sound 3000, 3: Z1 = Z2: Rem PROG WAS MINIMIZED
    '''IF ABS(Z1 - Z2) > TM THEN CALL SSR
    B$ = InKey$
    If B$ <> "" Then
        '''IF MSE >= 0 THEN EX% = -1: CALL MDRIVER(EX%, B$, POP)
        Exit Do
    End If
    Z3 = Z2
Loop

However QB64 doesn't have the lag problem on min, so this little nugget has turned into fool's gold... Oh unless you developers want to break QB64 to make it more 100% QuickBasic compatible!  Big Grin Big Grin Big Grin

Pause for a moment and think about it...

Fun stuff.

Pete
Reply


Messages In This Thread
Smart Pause - by SMcNeill - 03-28-2024, 02:45 AM
RE: Smart Pause - by Pete - 03-29-2024, 01:33 AM



Users browsing this thread: 1 Guest(s)