Rem Start program for Dndbbs v5.0a Release r2.0 Tweak t6.0a

Rem This program runs edit.exe using shroom.

Rem Shroom copies edit.exe to a swap area when
Rem  edit.exe shells to another program.

Rem $Dynamic
Defint A-Z

Rem $Include: 'const.inc'

On Error Goto Error0

' get command line
Command.Line$=Command$
If Command.Line$<>"" Then
   Color 14,0
   Print "Unknown command line."
   Color 7,0
   End
Endif

' locate shroom
If Dir$("shroom.com")=Nul Then
   Color 14,0
   Print "Error loading shroom. Reinstall Dndbbs."
   Color 7,0
   End
Endif

' do the program call
Call Read.Rows(Max.Row)
Locate Max.Row,1,1
x$=Curdir$
Command.Line$="shroom.com -q edit.exe"
Shell Command.Line$
Locate ,,0
Chdrive x$
Chdir x$
Locate Max.Row,1,1
End

' standard error trap
Error0:
 Color 14,0
 Print "Error loading Edit";Err;". Run dndcnfg."
 Color 7,0
 End

Sub Read.Rows(Var)
 On Local Error Goto Error.Trap62x
 Temp1=50
 Locate 50,1,0
 Var=50
 Exit Sub
Next.Trap1:
 Temp1=43
 Locate 43,1,0
 Var=43
 Exit Sub
Next.Trap2:
 Var=25
Error.Resume62x:
 Exit Sub
Error.Trap62x:
 If Temp1=50 Then
    Resume Next.Trap1
 Endif
 If Temp1=43 Then
    Resume Next.Trap2
 Endif
 Resume Error.Resume62x
End Sub
