 Rem File: Passwrd3.bas - for Dndedit
 Rem $Include: 'dndedit.inc'

Sub Passwrd5(Var,Var$)
 On Local Error Goto Error.Trap46
 DIM FileByte AS STRING * 1
 Var=True
 Close #TempFile1
 FileName2$=DND.Path+"DNDEDIT"+Ucase$(Var$)+".EXE"
 OPEN FileName2$ FOR BINARY AS #TempFile1
 File.Length! = LOF(TempFile1)
 GET #TempFile1, File.Length!, FileByte
 Var2 = ASC(FileByte)
 Password$ = Nul
 IF Var2 = 255 THEN
    FOR File.Position! = File.Length! - 20 TO File.Length! - 1
       GET #TempFile1, File.Position!, FileByte
       Password$ = Password$ + FileByte
    NEXT
    Call Crypto(Password$)
    Password$ = Rtrim$(Password$)
    If Password$=Nul Then
       Exit Sub
    Endif
    Locate ,,1
    Call ANSI(4,33,44)
    Call ANSI(3,0,0)
    Call ANSI(4,36,44)
    Call ANSI(2,12,30)
    Strng="Enter password:"
    Call Scrn(Strng)
    Xcoor=12
    Ycoor=47
    Column=47
    Line.Length=20
    Max.Lines=1
    Row=12
    Line.Number=1
    Hidden=-2
    Call ScreenEdit
    Hidden=False
    TempC$=Rtrim$(Edit.Data(1))
    If TempC$ <> Password$ Then
       Var=False
    Endif
 Endif
Error.Resume46:
 Exit Sub
Error.Trap46:
 Resume Error.Resume46
End Sub
