[SOLVED] SUB GLB_ON_RESUME

Previous topic - Next topic

Hemlos

SUB GLB_ON_RESUME

For windows....doesnt seem to work at all.

I tried adjusting type based variables and GLOBALs, and ran comparisons in the main loop to no effect.
Bing ChatGpt is pretty smart :O

MrTAToad

It doesn't work in debug mode, but does in release mode :

Code (glbasic) Select
GLOBAL a$=""

WHILE TRUE
PRINT "a$="+a$,100,100
SHOWSCREEN
WEND

SUB GLB_ON_RESUME:
a$="glb_on_resume"
ENDSUB

Hemlos

Bing ChatGpt is pretty smart :O

Hemlos

oh by the way...i was using a float not a string
Bing ChatGpt is pretty smart :O

MrTAToad

I used a string to show it worked :)

Hemlos

yea but numbers are more useful, did you try that?
Bing ChatGpt is pretty smart :O

MrTAToad

Something like :

Code (glbasic) Select
LOCAL x%,y%

GETDESKTOPSIZE x%,y%
GLOBAL onResume%=TRUE
LOCAL text$

WHILE TRUE
text$="Program paused : "
IF onResume%
INC text$,"No"
ELSE
INC text$,"Yes"
ENDIF

PRINT text$+" ("+onResume%+")",0,0
SHOWSCREEN
WEND

SUB GLB_ON_RESUME:
onResume%=TRUE
ENDSUB

SUB GLB_ON_PAUSE:
onResume%=FALSE
ENDSUB