 Rem File: Copyscrn for Dndbbs Version v5.0a Release r2.0

 Rem v1.1a removed max.row and run.number check
 Rem  removed and replaced dndbbs.inc variables
 Rem  removed interrupt calls.
 Rem v1.2a add amount2 for run.number

 Rem compile vbdos
 Rem  bc copyscrn/ah/s/e/g3/o;
 Rem  link copyscrn/e;

 On Error Goto End.Copy

 Const MaxConfigArray1=40
 Const MaxConfigArray2=150
 Const MaxConfigArray3=100

 Const Version$="5.0a"
 Const Release$="2.0a"
 Const RunMode$="gamma"

 Const YearRelease$="2021"

 Function Timeit!
  t1$ = Format$(Now, "hh:mm:ss") ' seconds past midnight
  t1! = CSNG(INT(VAL(MID$(t1$, 1, 2)))) * 3600! + CSNG(INT(VAL(MID$(t1$, 4, 2)))) * 60! + CSNG(INT(VAL(MID$(t1$, 7, 2))))
  Timeit!=t1!
 End Function

 Function Time.Elapsed(Start.Time!,Wait.Time!)
  Elapsed.Time!=Timeit!-Start.Time!
  If Elapsed.Time!<False Then
     Elapsed.Time!=Elapsed.Time!+86400!
  Endif
  If Elapsed.Time!>=Wait.Time! Then
     Time.Elapsed=-1
  Else
     Time.Elapsed=False
  Endif
 End Function

 Function Form$(Var#)
  Form$=Format$(Var#,"#,##0;;"+Chr$(34)+"zero"+Chr$(34))
 End Function

 Function DateS$
  DateS$=Format$(Now,"mm-dd-yyyy")
 End Function

 Function TimeS$
  TimeS$=Format$(Now,"hh:mm:ss")
 End Function

 VarX$=Ucase$(Environ$("BLIND"))
 If VarX$="ON" Or VarX$="-1" Or VarX$="TRUE" Then
    Border.Off=-1
 Endif
 VarX$=Ucase$(Environ$("BLINDCHAR"))
 If VarX$="ON" Or VarX$="-1" Or VarX$="TRUE" Then
    Border.Char=-1
 Endif
100
 Close #1
 DND.Path$=Environ$("DNDBBS")
 If DND.Path$<>"" Then
    If Right$(DND.Path$,1)<>"\" Then
       DND.Path$=DND.Path$+"\"
    Endif
 Endif
 FileName$=DND.Path$+"DND.CFG"
 If Dir$(FileName$)="" Then
    Color 7,0
    Print "File "+FileName$+" not found."
    End
 Endif
200
 Close #1
 Open FileName$ For Input Shared As #1
 Line Input #1,Var$
 For Temp1=1 To MaxConfigArray1
    Input #1,Var!
 Next
 For Temp1=1 To MaxConfigArray2
    Input #1,Var%
 Next
 For Temp1=1 To MaxConfigArray3
    Line Input #1,Var$
    Select Case Temp1
    Case 11
       Var1$=Rtrim$(Var$) ' \dnddat
    Case 51
       Var2$=Rtrim$(Var$) ' usage
    Case 15
       Var3$=Rtrim$(Var$) ' .dat
    End Select
 Next
300
 Close #1
 FileName$=Var1$+Var2$+Var3$
 Open FileName$ For Random Shared As #1 Len=26
 If Lof(1)=0 Then
    Field #1,26 As S$
    Lset S$="DND Usage File v"+Version$+Chr$(13)+Chr$(10)+Chr$(26)
    Put #1,1
 Endif
 Field #1,10 As D$,8 As T$,8 As X$
 If Lof(1)/26<2 Then
    Lset D$=DateS$
    Lset T$=TimeS$
    Lset X$=Mkd$(0#)
    Put #1,2
 Endif
 If Lof(1)/26<3 Then
    Lset D$="01-01-1980"
    Lset T$="00:00:00"
    Lset X$=Mkd$(0#)
    Put #1,3
 Endif
 Get #1,2
 Var#=Cvd(X$)
400
 Color 7, 0
 Cls
 Color 14, 1
 For Temp = 1 To 22
    Print Space$(80);
 Next
 If Border.Off=False Then
    Locate 1, 2, 1
    If Border.Char=0 Then
       Print Chr$(201); String$(76, 205); Chr$(187);
    Else
       Print "+"; String$(76, "-"); "+";
    Endif
    For Temp = 2 To 22
       Locate Temp, 2, 1
       If Border.Char=0 Then
          Print Chr$(186);
       Else
          Print "|";
       Endif
       Locate Temp, 79, 1
       If Border.Char=0 Then
          Print Chr$(186);
       Else
          Print "|";
       Endif
    Next
    Locate 22, 2, 1
    If Border.Char=0 Then
       Print Chr$(200); String$(76, 205); Chr$(188);
    Else
       Print "+"; String$(76, "-"); "+";
    Endif
 Endif
 Color 15, 1
 Locate 2, 72, 1
 Print "TM";
 Locate 3, 8, 1
 If Border.Off=False Then
    If Border.Char=0 Then
       Print String$(19, 205); "  F  R  E  E  W  A  R  E  "; String$(19, 205);
    Else
       Print String$(19, "-"); "  F  R  E  E  W  A  R  E  "; String$(19, "-");
    Endif
 Else
    Print String$(19, 32); "  F  R  E  E  W  A  R  E  "; String$(19, 32);
 Endif
 Color 11, 1
 Locate 4, 8, 1
 Print "Dungeons  And  Dragons  Bulletin  Board  Text  Adventure  System";
500
 Color 14, 1
 Locate 5, 8, 1
 Strng$="v"+Version$+" r"+Release$+" "+YearRelease$
 Print Strng$;
 Call Amount2(Var#,Var$)
 Strng$="Run: "+RunMode$+Var$
 Temp=72-Len(Strng$)
 Locate 5, Temp, 1
 Print Strng$;
600
 Color 14, 1
 Locate 7, 8, 1
 Print "Contributions for registration can be made in cash or check to:";
 Locate 9, 25, 1
 Print "Erik Jon Oredson";
 Locate 10, 25, 1
 Print "1615 S. 4th St. #M1605";
 Locate 11, 25, 1
 Print "Mpls., MN., 55454-1174";
 Locate 13, 25, 1
 Print "Support: dndbbs@gmail.com";
 Locate 14, 25, 1
 Print "Url: www.filegate.net/pdn/pdnbasic/";
 Locate 16, 8, 1
 Color 15, 1
 Print "Dndbbs may be distributed freely  with the following restrictions:";
 Color 14, 1
 Locate 18, 8, 1
 Print "The program is not changed or modified before distribution. No fee";
 Locate 19, 8, 1
 Print "is charged for using the program.  The program is not sold or used";
 Locate 20, 8, 1
 Print "for profit. The above copyright notices are not altered or removed.";
 Color 11, 1
 Locate 21, 8, 1
 Print "Copyright (c)ejo 1980-"+YearRelease$+", Dndbbs public domain freeware programs.";
700
 Var!=Timeit!
 Do
    If Time.Elapsed(Var!,5!) Then
       Exit Do
    Endif
    VarX$=Inkey$
    If VarX$=Chr$(27) Then
       Exit Do
    Endif
 Loop
 Do
    VarX$=Inkey$
    If Len(VarX$)=False Then
       Exit Do
    Endif
 Loop
 Color 7, 0
 Locate 22,1,1
 End
End.Copy:
 Color 7, 0
 Print "Error";ERR;" line";ERL
 Locate 22,1,1
 End

Sub Amount2(Var#,Var$)
 VarX$=Ltrim$(Str$(Var#)) ' 1.111D308
 V=Instr(VarX$,"D")
 If V Then
    If Mid$(VarX$,2,1)="." Then
       VarX$=Left$(VarX$,1)+Mid$(VarX$,V)
    Endif
    Var$=" "+VarX$
 Else
    Var$=" "+Form$(Var#)
 Endif
End Sub
