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

Sub Display.ExperienceX
 On Local Error Goto Err.Trp6
 Graphics.Off=True
 If UserRecord.Level=False Then
    Strng="You are dead."
    Call IO.O
    Strng="You can use the 'Train' command once free."
    Call IO.O
    Exit Sub
 Endif
 Strng="You are level "+Form$(Cdbl(UserRecord.Level))+"."
 Call IO.O
 Call Amount5(UserRecord.Gold,Var$)
 Strng="You have"+Var$+" gold."
 Call IO.O
 If UserRecord.Level=32767 Then
    Call Amount5(UserRecord.Experience,Var$)
    Strng="You have"+Var$+" experience points."
    Call IO.O
    Exit Sub
 Endif
 Call Gold(Temp#)
 Call Amount5(Temp#,VarQ$)
 Strng="You need"+VarQ$+" gold to train for level "+Form$(Cdbl(UserRecord.Level+1))+"."
 Call IO.O
 If Config2(93)=False Then
    Call Experience(Temp#)
    Call Amount5(Temp#,VarQ$)
    Strng="You need"+VarQ$+" experience points to train for level "+Form$(Cdbl(UserRecord.Level+1))+"."
    Call IO.O
    Exit Sub
 Endif
 Call Amount5(UserRecord.Experience,VarQ$)
 Strng="You have"+VarQ$+" experience points."
 Call IO.O
 Call Experience(Temp#)
 Call Amount5(Temp#,VarQ$)
 Strng="You need"+VarQ$+" experience points to train for level "+Form$(Cdbl(UserRecord.Level+1))+"."
 Call IO.O
Err.Rsm6:
 Exit Sub
Err.Trp6:
 Resume Err.Rsm6
End Sub

Sub Amount5(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
