  OPTION SCALE, 96
  OPTION DECIMALSEP, "."
  PARSE "%h;%m;%s;%a", @datetime(hh am/pm|nn|ss|AM/PM)
  rem -- Remove leading zero in hour --
  if @greater(10, %h)
    %h = @substr(%h,2)
  end 

  TITLE By Mac
  DIALOG CREATE,Scrolling Digital Clock,-1,0,240,98
  rem -- Make numbers bold, right justified --
  DIALOG ADD,STYLE,Style1,MS Sans Serif,24,BR,BLACK,LTGREEN
  DIALOG ADD,STYLE,Style2,,,,WHITE
  DIALOG ADD,TEXT,Background,0,1,238,97,,Style1
  rem -- Numbers and ":" --
  DIALOG ADD,TEXT,Hr1,30,20,40,30,%h,Style1
  DIALOG ADD,TEXT,Hr2,60,20,40,30,%h,Style1
  DIALOG ADD,TEXT,Co1,27,60,10,30,":",Style1
  DIALOG ADD,TEXT,Min1,30,70,40,30,%m,Style1
  DIALOG ADD,TEXT,Min2,60,70,40,30,%m,Style1
  DIALOG ADD,TEXT,Co2,27,110,10,30,":",Style1
  DIALOG ADD,TEXT,Sec1,30,120,40,30,%s,Style1
  DIALOG ADD,TEXT,Sec2,60,120,40,30,%s,Style1
  DIALOG ADD,TEXT,AP1,30,170,50,30,%a,Style1
  DIALOG ADD,TEXT,AP2,60,170,50,30,%a,Style1
  rem -- Hiding places for scrolling --
  DIALOG ADD,TEXT,HideUpper,0,1,238,30,,Style1
  DIALOG ADD,TEXT,HideLower,65,1,238,30,,Style1
  rem -- Frame --
  DIALOG ADD,TEXT,Line1,30,16,208,1,"",Style2
  DIALOG ADD,TEXT,Line2,64,16,208,1,"",Style2
  DIALOG ADD,TEXT,VertLine1,30,16,1,34,"",Style2
  DIALOG ADD,TEXT,VertLine2,30,223,1,34,"",Style2
  DIALOG SHOW

  REPEAT 
    %t = @datetime(ss)
    if @not(@equal(%t, %s))
      PARSE "%h;%m;%s;%a", @datetime(hh am/pm|nn|ss|AM/PM)
      DIALOG SET, Sec2, %s
      %y = 60
      REPEAT 
        DIALOG SETPOS, Sec1, @diff(%y, 30)
        DIALOG SETPOS, Sec2, %y
        rem -- Scroll on zero seconds, or if we missed zero --
        if @equal(%s, 0)@greater(%t, %s)
          DIALOG SET, Min2, %m
          DIALOG SETPOS, Min1, @diff(%y, 30)
          DIALOG SETPOS, Min2, %y
          if @equal(%m, 0)
            rem -- Remove leading zero in hour --
            if @greater(10, %h)
              %h = @substr(%h,2)
            end 
            DIALOG SET, Hr2, %h
            DIALOG SETPOS, Hr1, @diff(%y, 30)
            DIALOG SETPOS, Hr2, %y
            if @equal(%h, 12)
              DIALOG SET, AP2, %a
              DIALOG SETPOS, AP1, @diff(%y, 30)
              DIALOG SETPOS, AP2, %y
            end 
          end 
        end 
        Wait .1
        %y = @diff(%y, 5)
      UNTIL @equal(%y, 30)
      rem -- Move Hr2, Min2, Sec2, AP2 back to lower pos -- 
      DIALOG SET, Sec1, %s
      DIALOG SETPOS, Sec1, 30
      DIALOG SETPOS, Sec2, 60
      if @equal(%s, 0)@greater(%t, %s)
        DIALOG SET, Min1, %m
        DIALOG SETPOS, Min1, 30
        DIALOG SETPOS, Min2, 60
        if @equal(%m, 0)
          DIALOG SET, Hr1, %h
          DIALOG SETPOS, Hr1, 30
          DIALOG SETPOS, Hr2, 60
          if @equal(%h, 12)
            DIALOG SET, AP1, %a
            DIALOG SETPOS, AP1, 30
            DIALOG SETPOS, AP2, 60
          end 
        end 
      end 
    end 
    %e = @event()
  UNTIL %e
  goto %e

:CLOSE
  EXIT 
