Run with or without Debugger:
Code: Select all
Repeat
Select MessageRequester("See toggle Work?", Str(t)+" <<Yes to toggle this value.", #MB_YESNO)
Case #IDYES
t = ~ t
Case #IDNO
Break
EndSelect
Debug t
ForEver
End
Code: Select all
Repeat
Select MessageRequester("See toggle Work?", Str(t)+" <<Yes to toggle this value.", #MB_YESNO)
Case #IDYES
t = ~ t
Case #IDNO
Break
EndSelect
Debug t
ForEver
End
Code: Select all
#PB_MessageRequester_YesNo
#PB_MessageRequester_Yes
#PB_MessageRequester_No
Code: Select all
t = Bool(Not t)
Code: Select all
a=6
a!4
Debug a
a!4
Debug a
a!4
Debug a
Code: Select all
a=~4
Debug 4&a|2
a=~a
Debug 4&a|2
a=~a
Debug 4&a|2
Wow!! Didn't think it would offend anyone. Have it your way...Bisonte wrote: Thu Aug 21, 2025 7:35 am If this is supposed to be a tip, and it is found by a beginner...
they will be confused at first.
What are these constants?
Please use PureBasic constants and not API constants
Thank you.
Code: Select all
Repeat
Select MessageRequester("See toggle Work?", Str(t)+" <<Yes to toggle this value.", #PB_MessageRequester_YesNo)
Case #PB_MessageRequester_Yes
t = ~ t
Case #PB_MessageRequester_No
Break
EndSelect
Debug t
ForEver
End
Sorry its no offend... But your codes often have some mystical things (for beginners), their areRandy Walker wrote: Thu Aug 21, 2025 7:56 pmWow!! Didn't think it would offend anyone. Have it your way...Bisonte wrote: Thu Aug 21, 2025 7:35 am If this is supposed to be a tip, and it is found by a beginner...
they will be confused at first.
What are these constants?
Please use PureBasic constants and not API constants
Thank you.
...
Sorry its no offend... But your codes often have some mystical things (for beginners), their areBisonte wrote: Fri Aug 22, 2025 7:18 am Wow!! Didn't think it would offend anyone. Have it your way...
...
if you want to toggle a Bool just do a 0 check!Code: Select all
t= #True Repeat Select MessageRequester("See toggle Work?", Str(t)+" <<Yes to toggle this value.", #MB_YESNO) Case #IDYES t = ~ t Case #IDNO Break EndSelect Debug Bool(t) ForEver End
Code: Select all
Macro ToggleBool(_val_)
Bool(_val_=0)
EndMacro
t = 1234
Debug Str(t) + " : " + Bool(t)
Debug ""
For I = 1 To 10
t = ToggleBool(t)
Debug t
Next
Great!! Thanks for pointing that out. Makes my Original post even more worth while.
Code: Select all
Macro Toggle(x)
x=~x&1
EndMacro
a=#True
Toggle(a)
Debug a
Toggle(a)
Debug a
Toggle(a)
Debug a