Is there a shorter/better way of doing this?

Just starting out? Need help? Post your questions and find answers here.
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Re: Is there a shorter/better way of doing this?

Post by Baldrick »

Code: Select all

SetMenuItemState(#menu, #menuitem, a=a Not var!#this)
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Re: Is there a shorter/better way of doing this?

Post by Derek »

Code: Select all

#om_linear=123
#om_random=453
#om_ignore=279
If OpenWindow(0, 200, 200, 200, 100, "Menu State Example")
  If CreateMenu(0, WindowID(0))  
    MenuTitle("Options...")
    MenuItem(1, "1")
    MenuItem(2, "2")
    MenuItem(3, "3")
  EndIf
  
  opt_albumorder=279; Change me
  
  SetMenuItemState(0, 1, 1-Abs(Sign(#om_linear-opt_albumorder)))
  SetMenuItemState(0, 2, 1-Abs(Sign(#om_random-opt_albumorder)))
  SetMenuItemState(0, 3, 1-Abs(Sign(#om_ignore-opt_albumorder)))
  Repeat: Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
How many math functions!! :lol: :lol:
Post Reply