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

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

Expand Messages
  • Eb Guenther
    Hi Jody, ... 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
    Message 1 of 4 , Oct 31, 2000
    • 0 Attachment
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.