!*************************** AMUS Program Label ******************************
! Filename: HEADER.BAS                                      Date: 04/17/89
! Category: UTIL         Hash Code:                      Version:
! Initials: CARY/AM      Name: CARY FITCH
! Company: NATIONAL DATA SYSTEMS                   Telephone #: 5123432067
! Related Files: NONE
! Min. Op. Sys.: DBASIC ONLY                   Expertise Level: BEG
! Special: Easy to modify to use as a subroutine in a basic program.
! Description: Produces "nice" screen header for BASIC programs.  May be
! modified for AM basic by removing all "." variables and supplying info
! some other way.
!*****************************************************************************
!*! Updated on 14-Apr-89 at 4:08 PM by Cary Fitch; edit time: 1:59:30
!*! Created on 13-Apr-89 at 8:39 PM by System Operator; edit time: 0:05:55

map1 a$,s,11
map1 b$,s,8
map1 d$,s,30
map1 e$,s,30

map1 h1,s,30, "Now look at this display"
map1 h2,s,30, "What a Program"
map1 h3,s,30, "Master Menu Page"

! subroutine to do nice header on basic programs.

! set h1, h2, h3 to some nice titles
!       h1 = "Nice Title" etc
!       call header
!

header:
       a$ = .date using "#####Z"
       a$ = merge("##/##/##", a$)+ "  "
       d$ = .username
       e$ = .pgmname+" "+ .pgmversion
       b$ = .time using "#####Z"

       when val(b$) <130000
       b$ = (b$[-6,-5]  using "##") +":"+b$[-4,-3]+" AM    "
       wend

       when val(b$) > 125959
       b$ = (b$[-6,-5] mod 12 using "##") +":"+b$[-4,-3]+" PM    "
       wend


!line 1
       print tab(-1,0);
       print tab(01,80); tab(-1,33);                   ! norm at end of line 1
       print tab(01,01); tab(-1,32); tab(-1,11);       ! rv at begin of line 1
       print tab(1,69);"  "; b$;" ";
       print tab(1,2);" "; a$

!line2
       print tab(02,13); tab(-1,33);!tab(-1,12);       ! rvid and brite 2,13
       print tab(02,01); tab(-1,32); tab(-1,11);       ! rvid and dim on at 2,1
       print tab(2,2); "           ";
       print tab(02,80); tab(-1,33);                   ! norm at end of line 2
       print tab(02,68); tab(-1,32);;"           ";    ! norm at end of line 2
       call pl2

!line3
       print tab(03,80); tab(-1,33);                   ! norm at end of line 3
       print tab(03,01); tab(-1,32);                   ! norm at end of line 2

       print tab(3,2); "                                                                              ";
       print tab(3,3); d$;
       call pl3
       print tab(3,79-len(e$)); e$;
       call pl1:
!       return  !if this routine is called as a subroutine return here
       print tab(22,22)
       end

! you may set h1-h3 at any time and call pl1-pl3 to redisplay a line.

pl1:    print tab(1,39-len(h1)/2); tab(-1,12); h1
       return

pl2:    print tab(2,39-len(h2)/2); tab(-1,12); h2;tab(-1,11);
       return

pl3:    print tab(3,39-len(h3)/2); h3
       return