Not Option.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Not Option.

Post by Shannara »

Quote from Readme.html
If Not b
Debug "Ok"
EndIf

If a = 1 And Not b
Debug "Ok"
EndIf

If a = 1 And Not (b=1 or b=3)
Debug "Ok"
EndIf
I thought, cool. Any chance we can add the ability to do the following?

Code: Select all

  Visible.b = #True
  HideWindow(#Window, Not Visible)
This would allow a two lines instead of ...

Code: Select all

  Visible.b = #True
  Select Visible
    Case #True
      HideWindow(#Window, #False)
    Case
      HideWindow(#Window, #True)
  EndSelect
Seven :) Please maychance it is easier to follow.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

try it

not 1 = 0
not 0 = 1

think it works
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

You can still use:

Code: Select all

HideWindow(#Window, 1-Visible)
it should does the job.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

@Shannara
wait a minute...

if visible then HideWindow(#Window, #False) and if not visible then HideWindow(#Window, #True), did i got this right?

so why dont you write:

Code: Select all

Visible.b = #True 
HideWindow(#Window, Visible ! 1)
or have i missed something?

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Code: Select all

;Logical not for all integer types
Procedure.l NotI(b.l)
  !CMP  DWord [ESP+4], 0
  !JZ   l_cl_0
  !XOr  eax, eax
  ProcedureReturn
  cl_0:
  !MOV  eax, 1
  ProcedureReturn
EndProcedure

Debug NotI(5)
Debug NotI(0)
Debug NotI(1)
Debug NotI(-1)
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

I just didnt know a way around that :) Thanks to you guys .. :D I now have a way :) Thanks guys.
Post Reply