Metropoli BBS
VIEWER: msg_pps.pps MODE: TEXT (ASCII)
String Prompt(20),Name(20),Input
Integer Line,Key,Last

Declare Procedure Down ()
Declare Procedure Up ()

FOpen 1,PPEPath()+"MSG.CFG",O_RD,S_DN
Line = 1
While ((!Ferr(1))&&(Line < 21)) do
  FGet 1,Prompt(Line)
  FGet 1,Name(Line)
  Inc Line
EndWhile
FClose 1

Line = 1
Cls
While (Prompt(Line) <> "") do
  PrintLn "     @X0E",Line,". - @X0F",Left(Prompt(Line),50),"@X07"
  Inc Line
EndWhile
Last = (GetY()-1)
PrintLn Chr(13)
PrintLn "@X0A   Use the arrow keys to highlight the subject, then press `Enter' @X0A(@X0EQ@X0A) = Quit@X07"
AnsiPos 1,1
Print "     @X3F1. - @X3E",Left(Prompt(1),50),"@X07"

:Loop
Input = ""
While (Input = "") do
  Delay 2
  Input = Inkey()
EndWhile
Select Case Input
  Case Chr(13)
    Key = GetY()
    Cls
    KbdStuff "E"+Chr(13)+Name(Key)+Chr(13)
    End
  Case "Q","q"
    Cls
    End
  Case "UP"
    Up()
    Goto Loop
  Case "DOWN"
    Down()
    Goto Loop
End Select
Goto Loop

End
;===========================================================================

Procedure Up()
IF ((GETY()-1) < 1) THEN
  ANSIPOS 1,GETY()
  PRINT "     @X0E",GETY(),". - @X0F",Left(Prompt(GetY()),50),"@X07"
  ANSIPOS 1,LAST
  PRINT "     @X3F",GETY(),". - @X3E",Left(Prompt(GetY()),50),"@X07"
  Input = ""
  Return
ENDIF
ANSIPOS 1,GETY()
PRINT "     @X0E",GETY(),". - @X0F",Left(Prompt(GetY()),50),"@X07"
ANSIPOS 1,(GETY()-1)
PRINT "     @X3F",GETY(),". - @X3E",Left(Prompt(GetY()),50),"@X07"
Input = ""
EndProc

Procedure Down()
IF ((GETY()+1) > LAST) THEN
  ANSIPOS 1,GETY()
  PRINT "     @X0E",GETY(),". - @X0F",Left(Prompt(GetY()),50),"@X07"
  ANSIPOS 1,1
  PRINT "     @X3F",GETY(),". - @X3E",Left(Prompt(GetY()),50),"@X07"
  Input = ""
  Return
ENDIF
ANSIPOS 1,GETY()
PRINT "     @X0E",GETY(),". - @X0F",Left(Prompt(GetY()),50),"@X07"
ANSIPOS 1,(GETY()+1)
PRINT "     @X3F",GETY(),". - @X3E",Left(Prompt(GetY()),50),"@X07"
EndProc
[ RETURN TO DIRECTORY ]