 Rem File: Cmd033.bas
 Rem Sub: Get.Preferences
 Rem $Include: 'dndbbs.inc'
 On Error Goto Main.Error
 If Chained<>-2 Then
    Color 15,0
    Print "DNDBBS Command 033 -- Get.Preferences."
    Color 7,0
    End
 Endif
 Call Get.Preferences
Main.Resume:
 Chain DND.Path+"DNDBBS.EXE"
 End
Main.Error:
 Resume Main.Resume

Sub Get.Preferences
 On Local Error Goto Error.Trap27
 Gosub Get.Config
 Do While Lost.Carrier=False
    Graphics.Off=False
    Strng="Preference menu:"
    Call IO.O
    Graphics.Off=True
    Strng="Terminal settings:"
    Call IO.O
    Strng=" [0]Counter:"
    Var=Config2(149)
    If Var<0 Then
       Strng=Strng+" <disabled>"
    Else
       If Var=0 Then
          Strng=Strng+" (default)"
       Else
          Strng=Strng+Str$(Var)
       Endif
    Endif
    Call IO.O
    Strng=" [1]Ansi"
    If Local.Mode Then
       If Local.ANSI.Color Then
          Strng=Strng+" (on)"
       Else
          Strng=Strng+" (off)"
       Endif
    Else
       If Remote.ANSI.Color Then
          Strng=Strng+" (on)"
       Else
          Strng=Strng+" (off)"
       Endif
    Endif
    Call IO.O
    Strng=" [2]Avatar"
    If Local.Mode Then
       If Local.Avatar.Color Then
          Strng=Strng+" (on)"
       Else
          Strng=Strng+" (off)"
      Endif
    Else
       If Remote.Avatar.Color Then
          Strng=Strng+" (on)"
       Else
          Strng=Strng+" (off)"
       Endif
    Endif
    Call IO.O
    Strng=" [3]Echo duplex"
    If User.Echo=False Then
       Strng=Strng+" (on)"
    Else
       Strng=Strng+" (off)"
    Endif
    Call IO.O
    Strng=" [4]Linefeeds"
    If User.Linefeeds=False Then
       Strng=Strng+" (on)"
    Else
       Strng=Strng+" (off)"
    Endif
    Call IO.O
    Strng=" [5]Linelength
    Strng=Strng+" ("+Mid$(Str$(User.Linelength),2)+")"
    Call IO.O
    Strng=" [6]Pagelength"
    Strng=Strng+" ("+Mid$(Str$(User.Pagelength),2)+")"
    Call IO.O
    Strng=" [7]Wordwrap"
    If User.WordWrap=False Then
       Strng=Strng+" (on)"
    Else
       Strng=Strng+" (off)"
    Endif
    Call IO.O
    Strng="User preferences:"
    Call IO.O
    Strng=" [8]Sort"
    Select Case Sorting
    Case 1
       Strng=Strng+" (on: by charges)"
    Case 2
       Strng=Strng+" (on: by plus)"
    Case Else
       Sorting=False
       Strng=Strng+" (off)"
    End Select
    Call IO.O
    Strng=" [9]Brief"
    If UserRecord.Brief Then
       Strng=Strng+" (on)"
    Else
       Strng=Strng+" (off)"
    Endif
    Call IO.O
    Strng=" [10]Uppercase"
    If IO.Upper.Case Then
       Strng=Strng+" (on)"
    Else
       Strng=Strng+" (off)"
    Endif
    Call IO.O
    If option0 Then
       Strng=" [**]Action prompt"
       Call IO.O
    Else
       Strng=" [11]Action prompt: "+Action.Prompt
       Call IO.O
       Strng="   Display: "+Action.Prompt
       Call Convert.String
       Call Convert.ANSI(False,VarQ,VarR)
       Graphics.On=True
       Call Modem.ANSI(1,37,7)
       Call IO.O
       Graphics.On=False
    Endif
    Strng="Advanced keyboard controls:"
    Call IO.O
    If option1 Then
       Strng=" [**]Shortcut keys"
    Else
       Strng=" [12]Shortcut keys"
    Endif
    Call IO.O
    If option2 Then
       Strng=" [**]ANSI Prefixes"
    Else
       Strng=" [13]ANSI Prefixes"
    Endif
    Call IO.O
    If option3 Then
       Strng=" [**]Function keys"
    Else
       Strng=" [14]Function keys"
    Endif
    Call IO.O
    If option4 Then
       Strng=" [**]ANSI keys"
    Else
       Strng=" [15]ANSI keys"
    Endif
    Call IO.O
    Graphics.Off=False
    Strng="Enter preference selection(0-15,Q to quit)? "
    No.Input.Out="Q"
    Call IO.I
    Var$=Nul
    Temp=Int(Val(Out2)+.5)
    If Ucase$(Out2)="Q" Then
       Exit Do
    Endif
    If Out2="0" Then
       Strng="Enter counter: "
       Call IO.I
       Z=Int(Val(Out2)+.5)
       UserConfigRecord.UserConfig2=Z
       Call Write.Message.Record(MessWorkFile9,MaxConfigArray1+149)
    Endif
    Select Case Temp
    Case 1
       Do While Lost.Carrier=False
          Strng="Use ANSI color(y/n/h)? "
          No.Input.Out="H"
          Call IO.I
          Select Case Ucase$(Out2)
          Case "H"
             Call Logon.Help(2,4)
          Case "Y"
             If Local.Mode Then
                Local.ANSI.Color=True
             Else
                Remote.ANSI.Color=True
             Endif
             Strng="ANSI codes enabled."
             Exit Do
          Case "N"
             If Local.Mode Then
                If Local.ANSI.Color Then
                   Call ScreenANSI(1,37,0)
                   Local.ANSI.Color=False
                Endif
             Else
                If Remote.ANSI.Color Then
                   Call Modem.ANSI(1,37,0)
                   Remote.ANSI.Color=False
                Endif
             Endif
             Strng="ANSI codes disabled."
             Exit Do
          End Select
       Loop
       Call IO.O
       If Logged.In Then
          Call Status.Line(1)
       Endif
    Case 2
       Do While Lost.Carrier=False
          Strng="Use Avatar codes(y/n/h)? "
          No.Input.Out="H"
          Call IO.I
          Select Case Ucase$(Out2)
          Case "H"
             Call Logon.Help(39,42)
          Case "Y"
             If Local.Mode Then
                Local.Avatar.Color=True
             Else
                Remote.Avatar.Color=True
             Endif
             Strng="Avatar codes enabled."
             Exit Do
          Case "N"
             If Local.Mode Then
                If Local.Avatar.Color Then
                   Call ScreenANSI(1,37,0)
                   Local.Avatar.Color=False
                Endif
             Else
                If Remote.Avatar.Color Then
                   Call Modem.ANSI(1,37,0)
                   Remote.Avatar.Color=False
                Endif
             Endif
             Strng="Avatar codes disabled."
             Exit Do
          End Select
       Loop
       Call IO.O
       If Logged.In Then
          Call Status.Line(1)
       Endif
    Case 3
       Call Flag.Toggles(3)
    Case 4
       Call Flag.Toggles(1)
    Case 5
       Strng="Linelength(40,80)? "
       Call IO.I
       Var=Int(Val(Out2)+.5)
       If Var=40 Or Var=80 Then
          User.Linelength=Var
          Strng="Linelength now"+Str$(Var)+"."
          Call IO.O
       Endif
    Case 6
       Strng="Pagelength(25,43,50)? "
       Call IO.I
       Var=Int(Val(Out2)+.5)
       If Var=25 Or Var=43 Or Var=50 Then
          User.Pagelength=Var
          Strng="Pagelength now"+Str$(Var)+"."
          Call IO.O
       Endif
    Case 7
       Call Flag.Toggles(4)
    Case 8
       Select Case Sorting
       Case 0
          Sorting=1
       Case 1
          Sorting=2
       Case 2
          Sorting=False
       Case Else
          Sorting=False
       End Select
    Case 9
       If Sysop=0 And UserRecord.Level<option6 Then
          Strng="Brief mode not allowed until level"+Str$(option6)+"."
          Call IO.O
       Else
          UserRecord.Brief=Not UserRecord.Brief
          If UserRecord.Brief Then
             Action.Prompt=Config3(8)
             Strng="Brief mode on."
          Else
             Action.Prompt=Config3(7)
             Strng="Brief mode off."
          Endif
          If Rtrim$(Action.Prompt)=Nul Then
             If UserRecord.Brief Then
                Action.Prompt="Next:"
             Else
                Action.Prompt="Command>"
             Endif
             Strng="Default prompt."
          Endif
          Call IO.O
       Endif
    Case 10
       IO.Upper.Case=Not IO.Upper.Case
       If IO.Upper.Case Then
          Strng="Uppercase on."
       Else
          Strng="Uppercase off."
       Endif
       Call IO.O
    Case 11
       If option0 Then
          Strng="Option restricted."
          Call IO.O
       Else
          Do While Lost.Carrier=False
             Graphics.Off=True
             Out2=Action.Prompt
             Out2=Rtrim$(Out2)
             Strng="Current action prompt: "
             If Len(Out2) Then
                Strng=Strng+Out2
             Endif
             Call IO.O
             Strng=" Display: "+Action.Prompt
             Call Convert.String
             Call Convert.ANSI(False,VarQ,VarR)
             Graphics.On=True
             Call Modem.ANSI(1,37,7)
             Call IO.O
             Graphics.On=False
             No.Input.Out=Nul
             Strng="Action prompt(?=help,Q=quit)? "
             Call IO.I
             Select Case Lcase$(Out2)
             Case Nul
                Strng="Reset to default(y/n)?"
                No.Input.Out="N"
                Call IO.I
                If Yes Then
                   Action.Prompt="Command>"
                   UserRecord.ActionLineString="Command>"+Chr$(1)
                Endif
             Case "q"
                Exit Do
             Case "?"
                Call Display.ANSI.Prefixes
                Call Display.Strings
             Case Else
                Var$=Rtrim$(Out2)
                If Len(Var$) Then
                   Action.Prompt=Out2
                   UserRecord.ActionLineString=Out2+Chr$(1)
                Endif
             End Select
          Loop
       Endif
    Case 12
       If option1 Then
          Strng="Option restricted."
          Call IO.O
       Else
          Do While Lost.Carrier=False
             Graphics.Off=False
             Strng="Shortcut keys:"
             Call IO.O
             Graphics.Off=True
             For Var=1 To MaxShortcutKeys
                Strng="["+Mid$(Str$(Var),2)+"]"
                Strng2=Rtrim$(Shortcut.Key1(Var))
                If Len(Strng2)=False Then
                   Strng2="<none>"
                Endif
                Strng=Strng+Strng2+" : "
                Strng2=Rtrim$(Shortcut.Key2(Var))
                If Len(Strng2)=False Then
                   Strng2="<none>"
                Endif
                Strng=Strng+Strng2
                Call IO.O
             Next
             Do While Lost.Carrier=False
                Graphics.Off=False
                No.Input.Out="Q"
                Strng="Shortcut key option(1-"+Mid$(Str$(MaxShortcutKeys),2)+",Q to quit)? "
                Call IO.I
                If Quit Then
                   Exit Do
                Endif
                If Len(Out2) Then
                   Var=Int(Val(Out2)+.5)
                   If Var>=1 And Var<=MaxShortcutKeys Then
                      Graphics.Off=True
                      Strng="Shortcut(8 chars)? "
                      Call IO.I
                      Strng2=Rtrim$(Out2)
                      Strng2=Ucase$(Strng2)
                      Strng="Macro(32 chars)? "
                      Call IO.I
                      Strng3=Rtrim$(Out2)
                      If Len(Strng2)=0 Then
                         If Len(Strng3)=0 Then
                            Shortcut.Key1(Var)=Nul
                            Shortcut.Key2(Var)=Nul
                            UserRecord.ShortcutKey1(Var)=Nul
                            UserRecord.ShortcutKey2(Var)=Nul
                            Exit Do
                         Endif
                      Endif
                      If Len(Strng2) Then
                         If Len(Strng3) Then
                            Var3=True
                            ' node command
                            If Len(Rtrim$(Config3(78))) Then
                               If Left$(Strng3,Len(Config3(78)))=Config3(78) Then
                                  If Normal.User=False Or Sysop Then
                                     Strng="Node command supported."
                                     Call IO.O
                                  Else
                                     If option5=0 Then
                                        Strng="Node command not supported."
                                        Var3=False
                                     Endif
                                  Endif
                               Endif
                            Endif
                            ' DM command
                            If Len(Rtrim$(Config3(9))) Then
                               If Left$(Strng3,Len(Config3(9)))=Config3(9) Then
                                  If Normal.User Then
                                     Strng="DM command not supported. You are not a DM."
                                     Var3=False
                                  Else
                                     Strng="DM command supported."
                                     Call IO.O
                                  Endif
                               Endif
                            Endif
                            ' Sysop command
                            If Len(Rtrim$(Config3(79))) Then
                               If Left$(Strng3,Len(Config3(79)))=Config3(79) Then
                                  If Sysop=False Then
                                     Strng="Sysop command not supported. You are not a Sysop."
                                     Var3=False
                                  Else
                                     Strng="Sysop command supported."
                                     Call IO.O
                                  Endif
                               Endif
                            Endif
                            If Var3=False Then
                               Call IO.O
                            Else
                               Shortcut.Key1(Var)=Strng2
                               Shortcut.Key2(Var)=Strng3
                               UserRecord.ShortcutKey1(Var)=Strng2
                               UserRecord.ShortcutKey2(Var)=Strng3
                            Endif
                         Endif
                      Endif
                   Endif
                   Exit Do
                Endif
             Loop
             If Quit Then
                Exit Do
             Endif
          Loop
       Endif
    Case 13
       If option2 Then
          Strng="Option restricted."
          Call IO.O
       Else
          Graphics.Off=True
          If ANSIPrefixChar=Nul Then
             Strng="ANSI prefix codes not enabled."
             Call IO.O
          Else
             Do While Lost.Carrier=False
                Graphics.Off=True
                Out2=UserRecord.Prefix1
                Out2=Rtrim$(Out2)
                Strng="Current codename ANSI prefix: "
                If Len(Out2) Then
                   Strng=Strng+Out2
                Else
                   Strng=Strng+"<none>"
                Endif
                Call IO.O
                Strng="Codename ANSI prefix code(8 characters,?=help,Q=quit):"
                Call IO.O
                Strng="?"
                No.Input.Out=Nul
                Call IO.I
                Out2=Ucase$(Out2)
                Graphics.Off=False
                Select Case Out2
                Case Nul
                   UserRecord.Prefix1=Nul
                Case "Q"
                   Exit Do
                Case "?"
                   Call Display.ANSI.Prefixes
                Case Else
                   Call Check.ANSI.Prefix(V%)
                   If V% Then
                      Strng="ANSI prefix reset."
                      Call IO.O
                      UserRecord.Prefix1=Out2
                   Else
                      Strng="Invalid ANSI prefix."
                      Call IO.O
                      UserRecord.Prefix1=Nul
                   Endif
                End Select
             Loop
             Do While Lost.Carrier=False
                Graphics.Off=True
                Out2=UserRecord.Prefix2
                Out2=Rtrim$(Out2)
                Strng="Current classname ANSI prefix: "
                If Len(Out2) Then
                   Strng=Strng+Out2
                Else
                   Strng=Strng+"<none>"
                Endif
                Call IO.O
                Strng="Classname ANSI prefix code(8 characters,?=help,Q=quit):"
                Call IO.O
                Strng="?"
                No.Input.Out=Nul
                Call IO.I
                Out2=Ucase$(Out2)
                Graphics.Off=False
                Select Case Out2
                Case Nul
                   UserRecord.Prefix2=Nul
                Case "Q"
                   Exit Do
                Case "?"
                   Call Display.ANSI.Prefixes
                Case Else
                   Call Check.ANSI.Prefix(V%)
                   If V% Then
                      Strng="ANSI prefix reset."
                      Call IO.O
                      UserRecord.Prefix2=Out2
                   Else
                      Strng="Invalid ANSI prefix."
                      Call IO.O
                      UserRecord.Prefix2=Nul
                   Endif
                End Select
             Loop
          Endif
       Endif
    Case 14
       If option3 Then
          Strng="Option restricted."
          Call IO.O
       Else
          Var=False
          If Local.Mode Then
             If Local.ANSI.Color Then
                Var=True
             Endif
          Else
             If Remote.ANSI.Color Then
                Var=True
             Endif
          Endif
          If Var=False Then
             Strng="ANSI not detected."
             Call IO.O
             Call More.Prompt
          Else
             Do While Lost.Carrier=False
                Graphics.Off=True
                Strng="Edit function keys:"
                Call IO.O
                No.Input.Out="Q"
                Strng="Enter key(1-10), C)lear all, L)ist, T)est, Q)uit: "
                Call IO.I
                Select Case Ucase$(Out2)
                Case "Q"
                   Exit Do
                Case "C"
                   For Var=1 To 10
                      UserRecord.FunctionKeys(Var)=Nul
                   Next
                   For Var=1 To 10
                      Var$=Chr$(27)+"[0;"+Mid$(Str$(Var+58),2)
                      Var$=Var$+";0;"+Mid$(Str$(Var+58),2)+"p"
                      If Local.Mode=False Then
                         Call Put.Modem(Var$)
                      Else
                         Call Put.Screen(Var$)
                      Endif
                   Next
                   Strng="Function keys reset."
                   Call IO.O
                Case "L"
                   Graphics.Off=True
                   For Var=1 To 10
                      Strng="Key F"+Mid$(Str$(Var),2)+": "
                      Var$=Rtrim$(UserRecord.FunctionKeys(Var))
                      If Var$=Nul Then
                         Strng=Strng+"<none>"
                      Else
                         Strng=Strng+Var$
                      Endif
                      Call IO.O
                   Next
                   Call More.Prompt
                Case "T"
                   Strng="Press function key:"
                   Call IO.O
                   Strng=":"
                   Call IO.I
                Case Else
                   Var=Int(Val(Out2)+.5)
                   If Var>=1 And Var<=10 Then
                      Graphics.Off=False
                      Strng="Key F"+Mid$(Str$(Var),2)+" is currently: "
                      Var$=Rtrim$(UserRecord.FunctionKeys(Var))
                      If Var$=Nul Then
                         Strng=Strng+"<none>"
                      Else
                         Strng=Strng+Var$
                      Endif
                      Call IO.O
                      Graphics.Off=True
                      Strng="Function key code should be enclosed in quotes,"
                      Call IO.O
                      Strng="and can end in ;13 to add carriage return, for"
                      Call IO.O
                      Strng="example: "+Chr$(34)+"look"+Chr$(34)+";13"
                      Call IO.O
                      Strng="otherwise, press enter to reset key:"
                      Call IO.O
                      Strng="(not all terminal packages support keyboard redefinition)"
                      Call IO.O
                      Strng="?"
                      Call IO.I
                      If Out2=Nul Then
                         UserRecord.FunctionKeys(Var)=Nul
                         Var$=Chr$(27)+"[0;"+Mid$(Str$(Var+58),2)
                         Var$=Var$+";0;"+Mid$(Str$(Var+58),2)+"p"
                         If Local.Mode=False Then
                            Call Put.Modem(Var$)
                         Else
                            Call Put.Screen(Var$)
                         Endif
                      Else
                         UserRecord.FunctionKeys(Var)=Out2
                         Var$=Chr$(27)+"[0;"+Mid$(Str$(Var+58),2)
                         Var$=Var$+";"+Out2+"p"
                         If Local.Mode=False Then
                            Call Put.Modem(Var$)
                         Else
                            Call Put.Screen(Var$)
                         Endif
                      Endif
                   Endif
                End Select
             Loop
          Endif
       Endif
    Case 15
       If option4 Then
          Strng="Option restricted."
          Call IO.O
       Else
          Var=False
          If Local.Mode=False Then
             If Remote.ANSI.Color Or Remote.Avatar.Color Then
                Var=True
             Endif
          Endif
          If Debug.Mode Then
             Strng="Debug mode."
             Call IO.O
             Var=True
          Endif
          If Var=False Then
             Strng="Remote ANSI not detected."
             Call IO.O
             Call More.Prompt
          Else
             Do While Lost.Carrier=False
                Graphics.Off=True
                Strng="Edit ANSI keys:"
                Call IO.O
                No.Input.Out="2"
                Strng="Enter key(A-Z), 0)Clear all, 1)List, 2)Quit: "
                Call IO.I
                Select Case Ucase$(Out2)
                Case "0"
                   For Var=1 To 26
                      ANSI.Keys(Var)=Nul
                   Next
                   Strng="ANSI keys reset."
                   Call IO.O
                Case "1"
                   Graphics.Off=True
                   Strng="^[ is the escape character (ascii 27)"
                   Call IO.O
                   Strng="ANSI, Key,    Command"
                   Call IO.O
                   Strng="---------------------"
                   Call IO.O
                   For Var=1 To 13
                      Strng="^[["+Chr$(Var+64)
                      Select Case Var
                      Case 1 ' up
                         Strng=Strng+"  (up)    <remote status line>"
                         Call IO.O
                      Case 2 ' down
                         Strng=Strng+"  (down)  <remote status line>"
                         Call IO.O
                      Case 3 ' right
                         Strng=Strng+"  (right) <command history>"
                         Call IO.O
                      Case 4 ' left
                         Strng=Strng+"  (left)  <command history>"
                         Call IO.O
                      Case 8 ' home
                         Strng=Strng+"  (home)  <command history>"
                         Call IO.O
                      Case 11 ' end
                         Strng=Strng+"  (end)   <command history>"
                         Call IO.O
                      Case Else
                         Strng=Strng+Space$(10)
                         Var$=Rtrim$(ANSI.Keys(Var))
                         If Var$=Nul Then
                            Strng=Strng+"<none>"
                         Else
                            Strng=Strng+Var$
                         Endif
                         Call IO.O
                      End Select
                   Next
                   Call More.Prompt
                   Strng="ANSI, Key,    Command"
                   Call IO.O
                   Strng="---------------------"
                   Call IO.O
                   For Var=14 To 26
                      Strng="^[["+Chr$(Var+64)+Space$(10)
                      Var$=Rtrim$(ANSI.Keys(Var))
                      If Var$=Nul Then
                         Strng=Strng+"<none>"
                      Else
                         Strng=Strng+Var$
                      Endif
                      Call IO.O
                   Next
                   Call More.Prompt
                Case "2"
                   Exit Do
                Case Else
                   Var$=Ucase$(Out2)
                   If Var$>="A" And Var$<="Z" Then
                      Select Case Var$
                      Case "A"
                         Strng="Up key is reserved for remote status line."
                         Call IO.O
                      Case "B"
                         Strng="Down key is reserved for remote status line."
                         Call IO.O
                      Case "C"
                         Strng="Right key is reserved for command history."
                         Call IO.O
                      Case "D"
                         Strng="Left key is reserved for command history."
                         Call IO.O
                      Case "H"
                         Strng="Home key is reserved for command history."
                         Call IO.O
                      Case "K"
                         Strng="End key is reserved for command history."
                         Call IO.O
                      Case Else
                         Var=Asc(Var$)-64
                         Graphics.Off=False
                         Strng="ANSI Key ^[["+Var$+"' is currently: "
                         Var$=Rtrim$(ANSI.Keys(Var))
                         If Var$=Nul Then
                            Strng=Strng+"<none>"
                         Else
                            Strng=Strng+Var$
                         Endif
                         Call IO.O
                         Graphics.Off=True
                         Strng="ANSI key code  could be  connected  to any  cursor key,"
                         Call IO.O
                         Strng="For example,  Telemate  ANSI.KEY  file can  connect the"
                         Call IO.O
                         Strng="<center> key to ^[[Z and then to Dndbbs as any command."
                         Call IO.O
                         Strng="Otherwise, press <enter> to reset key:"
                         Call IO.O
                         Strng="?"
                         Call IO.I
                         If Out2=Nul Then
                            ANSI.Keys(Var)=Nul
                         Else
                            ANSI.Keys(Var)=Out2
                         Endif
                      End Select
                   Endif
                End Select
             Loop
          Endif
       Endif
    End Select
 Loop
 Call Write.Record(UserFile,User.Index)
 Exit Sub
Get.Config:
 VarX=0
 Gosub Reset.Options
 Do
    VarX=VarX+1
    If VarX>Options.Lines Then
       Goto Next.Read
       Exit Do
    Endif
    Var$=Ltrim$(Rtrim$(Options.Array(VarX)))
    If Ucase$(Var$)="[CMD033]" Then
       Do
          VarX=VarX+1
          If VarX>Options.Lines Then
             Goto Next.Read
             Return
          Endif
          Var$=Ltrim$(Rtrim$(Options.Array(VarX)))
          If Ucase$(Var$)="[END]" Then
             Goto Next.Read
             Return
          Endif
          Var=Instr(Var$,"=")
          If Var Then
             Var2$=Ltrim$(Rtrim$(Left$(Var$,Var-1)))
             Var3$=Ltrim$(Rtrim$(Mid$(Var$,Var+1)))
             Gosub Parse.Options
          Endif
       Loop
    Endif
 Loop
 Return
Next.Read:
 Close #TempFile1
 Filename$=DND.Path+"CMD033.CFG"
 If Dir$(Filename$)="" Then
    Return
 Endif
 Open Filename$ For Input As #TempFile1
 Do
    If Eof(TempFile1) Then
       Exit Do
    Endif
    Line Input #TempFile1, Var$
    Var$=Ltrim$(Rtrim$(Var$))
    If Left$(Var$,1)<>";" Then
       VarX$=UserRecord.CodeName
       VarX$=Rtrim$(VarX$)
       VarX$=Ucase$(VarX$)
       If Ucase$(Var$)="["+VarX$+"]" Then
          VarZ=0
          Gosub Reset.Options
          Do
             If Eof(TempFile1) Then
                Exit Do
             Endif
             Line Input #TempFile1, Var$
             If Ucase$(Var$)="[END]" Then
                Return
             Endif
             Var=Instr(Var$,"=")
             If Var Then
                Var2$=Ltrim$(Rtrim$(Left$(Var$,Var-1)))
                Var3$=Ltrim$(Rtrim$(Mid$(Var$,Var+1)))
                Gosub Parse.Options
             Endif
          Loop
       Endif
    Endif
 Loop
 Return
Parse.Options:
 Select Case Lcase$(Var2$)
 Case "action.prompt"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option0=-1
    End Select
 Case "shortcut.keys"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option1=-1
    End Select
 Case "ansi.prefixes"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option2=-1
    End Select
 Case "function.keys"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option3=-1
    End Select
 Case "ansi.keys"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option4=-1
    End Select
 Case "allow.node.shortcut"
    Select Case Lcase$(Var3$)
    Case "-1", "true", "on"
       option5=-1
    End Select
 Case "brief.mode.level"
    option6=Int(Val(Var3$)+.5)
 End Select
 Return
Reset.Options:
 option0=0
 option1=0
 option2=0
 option3=0
 option4=0
 option5=0
 option6=Config2(12)
 Return
Error.Resume27:
 Exit Sub
Error.Trap27:
 strng="error"+str$(err)
 call io.o
 Resume Error.Resume27
End Sub

Sub Logon.Help(Var1,Var2)
 On Local Error Goto ErrorTrp10
 Close #HelpFile3
 Open Logon.Help.FileName For Random Shared As #HelpFile3 Len=HelpRecLen3
 If Lof(HelpFile3)/HelpRecLen3=False Then
    Exit Sub
 Endif
 Graphics.Off=True
 Strng=Nul
 Call IO.O
 If Var1>=False And Var2<=Lof(HelpFile3)/HelpRecLen3 Then
    For Var3=Var1 To Var2
       Call Read.HelpFile(HelpFile3,Var3)
       Strng=Space$(3)+Rtrim$(HelpRecord3.Text)
       Call IO.O
    Next
    Call IO.O
    Call More.Prompt
 Endif
 Graphics.Off=False
ErrorRsm10:
 Exit Sub
ErrorTrp10:
 Resume ErrorRsm10
End Sub

Sub Display.Strings
 On Local Error Goto Error.Trap25z
 Graphics.Off=False
 Strng="Custom statusline variables are:"
 Call IO.O
 Graphics.Off=True
 Strng=" [1]  user codename"
 Call IO.O
 Strng=" [2]  user classname"
 Call IO.O
 Strng=" [3]  date/time in form: mm/dd/yyyy hh:mm:ss"
 Call IO.O
 Strng=" [4]  date in form: mm/dd/yyy"
 Call IO.O
 Strng=" [5]  time in form: hh:mm:ss"
 Call IO.O
 Strng=" [6]  formatted date/time in form: ddd dd mmm yy, hh:mma/p"
 Call IO.O
 Strng=" [7]  user node (-,0-9,A-Z,10-99)"
 Call IO.O
 Strng=" [8]  user comm port (-,1-64)"
 Call IO.O
 Strng=" [9]  user port (-,0-63)"
 Call IO.O
 Strng=" [a]  date/time user logged on"
 Call IO.O
 Strng=" [b]  program version"
 Call IO.O
 Strng=" [c]  program release"
 Call IO.O
 Strng=" [d]  program name (dndbbs)"
 Call IO.O
 Strng=" [e]  program runmode"
 Call IO.O
 Strng=" [f]  program run number"
 Call IO.O
 Call More.Prompt
 If No Or Quit Then
    Exit Sub
 Endif
 Graphics.Off=False
 Strng="The standard phone lines are:"
 Call IO.O
 Graphics.Off=True
 Strng=" [g]  phone line#1"
 Call IO.O
 Strng=" [h]  phone line#2"
 Call IO.O
 Strng=" [i]  phone line#3"
 Call IO.O
 Strng=" [j]  phone line#4"
 Call IO.O
 Call More.Prompt
 If No Or Quit Then
    Exit Sub
 Endif
 Graphics.Off=False
 Strng="System variables are:"
 Call IO.O
 Graphics.Off=True
 Strng=" [k]  Sysop Name"
 Call IO.O
 Strng=" [l]  Sysop Email"
 Call IO.O
 Strng=" [m]  BBS name"
 Call IO.O
 Strng=" [n]  BBS description"
 Call IO.O
 Call More.Prompt
 If No Or Quit Then
    Exit Sub
 Endif
 Graphics.Off=True
 Strng="The additional phone lines 5-16 are [o] to [z]"
 Call IO.O
 Strng="The extended phone lines 17-127 are {17} to {127}"
 Call IO.O
 Call More.Prompt
 If No Or Quit Then
    Exit Sub
 Endif
 Graphics.Off=False
 Strng="The additional switches for status line are in <>:"
 Call IO.O
 Graphics.Off=True
 Strng=" <LV>  Level         <TA>  Logon date\time"
 Call IO.O
 Strng=" <ST>  Strength      <TB>  Logon date"
 Call IO.O
 Strng=" <IN>  Intelligence  <TC>  Logon time"
 Call IO.O
 Strng=" <WI>  Wisdom        <TH>  Hexidecimal date\time"
 Call IO.O
 Strng=" <DE>  Dexterity     <TI>  Hexidecimal date"
 Call IO.O
 Strng=" <CO>  Consitution   <TJ>  Hexidecimal time"
 Call IO.O
 Strng=" <PI>  Piety         <TO>  Time online"
 Call IO.O
 Strng=" <CH>  Charisma      <TR>  Time remaining"
 Call IO.O
 Strng=" <FA>  Fatigue       <GD>  User gold"
 Call IO.O
 Strng=" <VI>  Vitality      <EX>  User experience"
 Call IO.O
 Strng=" <MA>  Magic         <WS>  Wishes left"
 Call IO.O
 Strng=" <PS>  Psionic       <GS>  Sysop page slots"
 Call IO.O
 Graphics.Off=False
 Strng="Switches for prefixes:"
 Call IO.O
 Graphics.Off=True
 Strng=" <P0>  node prefix  <P1>  dm prefix  <P2>  sysop prefix"
 Call IO.O
 Call More.Prompt
 If No Or Quit Then
    Exit Sub
 Endif
 Graphics.Off=False
 Strng="The drive replacements are:"
 Call IO.O
 Graphics.Off=True
 Strng=" (1) drive letter"
 Call IO.O
 Strng=" (2) current directory"
 Call IO.O
 Strng=" (3) volume label"
 Call IO.O
 Strng=" (4) server machine name"
 Call IO.O
 Call More.Prompt
Error.Resume25z:
 Exit Sub
Error.Trap25z:
 Resume Error.Resume25z
End Sub
