Loading ...
Sorry, an error occurred while loading the content.

5036Re: [Clip] setting options from clip; saving the changes

Expand Messages
  • Eb Guenther
    Oct 31, 2000
      Hi Jody,


      >H="Toggle Header Status"
      >^!ProgIniSave
      >^!Set %ShowHead%=^$GetValue(Clipbook:ShowHeaders)$
      >^!IfFalse ^%ShowHead% SKIP_2
      >^!SaveValue Clipbook:ShowHeaders=0
      >^!ProgIniLoad
      >^!IfTrue ^%ShowHead% SKIP_2
      >^!SaveValue Clipbook:ShowHeaders=1
      >^!ProgIniLoad
      >
      >--
      >Wayne M. VanWeerthuizen
      >ICQ: 15117288
      >Homepage: http://landru.myhome.net/wayne


      Here is a bit of a refinement of the
      "Toggle Header Status" clip, replacing the boolean tests with
      a bit of math, because we only have two values (1 and 0) and
      ((0+1) MOD 2) returns 1 and ((1+1) MOD 2 returns 0) :


      H="Toggle Header Status"
      ^!ProgIniSave
      ^!Set %temp%=^$GetValue(Clipbook:ShowHeaders)$
      ^!SaveValue Clipbook:ShowHeaders=^$Calc((^%temp%+1) MOD 2)$
      ^!ProgIniLoad


      This clip probably runs NO faster than Wayne's original,
      but it's a bit shorter, and shows that there's always
      another way to do things.


      Cheers,

      Eb
    • Show all 4 messages in this topic