home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carsten's PPE Collection
/
Carstens_PPE_Collection_2007.zip
/
S
/
SL_VOTE1.ZIP
/
SL-VOTE.PPE
(
.txt
)
< prev
next >
Wrap
PCBoard Programming Language Executable
|
1993-10-20
|
9KB
|
558 lines
;------------------------------------------------------------------------------
; .ss.
; `²²'
; .,sS$Ss,,s$ .,sS$$$Ss. .,sS$Ss,,s$ .ss. .sSs.
; .d$$²^°²$$$$'.d$P²°^^²$P'.d$$²^°²$$$$'.$$$' .$$$²Sb,.
; $$$' .$$$' $$$²Sçsµ²' .$$$' .$$$'.$$$' .$$$' `$$b.
; $$$b,,d$$$' ,$$$b,....,s$$$$b,,d$$$'.$$$;.,$$$' ;$$$
; `²S$$S²²S$$S²°²S$$$$S²°°²S$$$$$$',$$S²°²S$S'.sS$$$P²'
; .sS²°$$$²²°"' d²°'
; .$$² .$$'
; $$$.,d$$'
; `²S$$S²'
;------------------------------------------------------------------------------
; P.P.L.X. 2.OO (C)1996 - Lone Runner / AEGiS CoRP'96
;------------------------------------------------------------------------------
; PPE 1.OO (plain) - Analysis ON - Postprocessing ON
;------------------------------------------------------------------------------
Boolean BOOLEAN001
Boolean BOOLEAN002
Boolean BOOLEAN003
Integer INTEGER001
Integer INTEGER002
Integer INTEGER003
Integer TINTEGER004(16)
Integer INTEGER005
Integer INTEGER006
Integer INTEGER007
Integer INTEGER008
Integer INTEGER009
Integer INTEGER010
Integer INTEGER011
Integer INTEGER012
Integer INTEGER013
Integer TINTEGER014(99)
Integer TINTEGER015(99)
Integer TINTEGER016(99)
Integer INTEGER017
String STRING001
String STRING002
String STRING003
String STRING004
String STRING005
String STRING006
String STRING007
String STRING008
String STRING009
String STRING010
String TSTRING011(16)
String STRING012
String STRING013
String STRING014
;------------------------------------------------------------------------------
Cls
GetUser
If (Exist(PPEPath() + "SL-VOTE.CNF")) Goto LABEL001
PrintLn "@X8CConfiguration file Error @X0F Please Notify your Sysop"
End
:LABEL001
FOpen 1, PPEPath() + "sl-vote.cnf", 0, 0
FGet 1, STRING001
FGet 1, STRING006
FGet 1, STRING005
FGet 1, INTEGER008
FGet 1, INTEGER001
FGet 1, INTEGER012
FGet 1, STRING009
FGet 1, STRING008
FGet 1, STRING010
FClose 1
If (STRING010 == "") Then
STRING010 = "@X07(@X0B@TIMELEFT@ @X07min.) @X0FSurreal@X07 Voting Booth Command"
Endif
INTEGER009 = 1
STRING003 = Strip(STRING006, " ")
STRING004 = Strip(STRING005, " ")
STRING002 = Strip(STRING001, " ")
INTEGER006 = S2I(STRING002, 14)
INTEGER007 = S2I(STRING003, 11)
INTEGER005 = S2I(STRING004, 23)
If (INTEGER008 == 0) Then
BOOLEAN001 = 0
STRING001 = "@X8FUnregistered Evaluation Copy@X07"
Goto LABEL003
ElseIf (INTEGER008 == ((INTEGER006 + 69) * (94 + INTEGER007)) / INTEGER005) Then
BOOLEAN001 = 1
Goto LABEL002
Endif
BOOLEAN001 = 0
STRING001 = "@X8FUnregistered Evaluation Copy@X07"
:LABEL002
DispFile STRING009, 4 + 1 + 2
Delay 36
PrintLn "@X07Registered to: @X0B", STRING001
PrintLn
Wait
:LABEL003
STRING007 = ""
Cls
If (Exist(PPEPath() + "sl-vote.mnu")) Then
DispFile "sl-vote.mnu", 0
Else
PrintLn
PrintLn "@X0FSurreal Voting Booth"
PrintLn
PrintLn "@X08(@X0BV@X08)ote on a Current Topic"
PrintLn "@X08(@X0BR@X08)esults on Current Topics"
PrintLn "@X08==================================="
PrintLn "@X08(@X0BH@X08)elp"
PrintLn "@X08(@X0BQ@X08)uit (@X0BG@X08)oodbye!"
PrintLn
Endif
InputStr STRING010, STRING007, 8, 1, "VRADHGQvradhgq", 0
STRING007 = Upper(STRING007)
If (STRING007 == "G") Goodbye
If (STRING007 == "Q") Goto LABEL026
If (STRING007 == "V") Goto LABEL004
If (STRING007 == "R") Goto LABEL008
If (STRING007 == "H") Goto LABEL023
Goto LABEL003
:LABEL004
INTEGER002 = ""
Cls
If (Exist(PPEPath() + STRING008)) Then
DispFile PPEPath() + STRING008, 0
Else
PrintLn "@X8C There is an Error with the Polls Listing Notify Sysop!"
End
Endif
STRING007 = ""
PrintLn
InputStr "Which topic do you wish to Vote on", STRING007, 8, 2, Mask_Num(), 0
If (STRING007 == "") Goto LABEL003
If (STRING007 > INTEGER001) Then
PrintLn
PrintLn "@X0CInvalid Topic Number! @X0F Try again..."
Goto LABEL004
Endif
INTEGER009 = 1
If (Exist(PPEPath() + "sl-vote.q" + STRING007)) Goto LABEL005
PrintLn
PrintLn "@X0CTopic Not Found...Try Again"
PrintLn
Wait
Goto LABEL004
:LABEL005
INTEGER009 = 1
FOpen 1, PPEPath() + "sl-vote.n" + STRING007, 2, 2
INTEGER009 = 1
BOOLEAN002 = 0
BOOLEAN003 = 0
:LABEL006
If (BOOLEAN003) Goto LABEL007
FGet 1, STRING013
If (InStr(STRING013, U_Name())) Then
BOOLEAN002 = 1
BOOLEAN003 = 1
Endif
If (Len((STRING013 == 0))) BOOLEAN003 = 1
Goto LABEL006
:LABEL007
If (BOOLEAN002 == 1) Goto LABEL024
FClose 1
INTEGER009 = 1
FOpen 1, PPEPath() + "sl-vote.q" + STRING007, 2, 2
FGet 1, STRING012
FGet 1, STRING014
FGet 1, INTEGER003
FGet 1, INTEGER010
If (INTEGER010 > 16) INTEGER010 = 16
While (INTEGER009 <= INTEGER010) Do
FGet 1, TSTRING011(INTEGER009)
FGet 1, TINTEGER004(INTEGER009)
Inc INTEGER009
EndWhile
FClose 1
Cls
PrintLn
PrintLn STRING012
PrintLn
INTEGER009 = 1
PrintLn "@X0B 0 @X07·@X03 Go Back to Main Menu"
While (INTEGER009 <= INTEGER010) Do
PrintLn "@X0B ", INTEGER009, " @X07·@X03 ", TSTRING011(INTEGER009)
Inc INTEGER009
EndWhile
PrintLn
InputText "@X0B(@X03@TIMELEFT@ @X08min.@X0B) Your Vote", INTEGER002, 8, 2
If (INTEGER002 == 0) Goto LABEL003
Inc TINTEGER004(INTEGER002)
INTEGER009 = 1
FCreate 1, PPEPath() + "sl-vote.q" + STRING007, 1, 2
FPutLn 1, STRING012
FPutLn 1, INTEGER003 + 1
FPutLn 1, INTEGER010
While (INTEGER009 <= INTEGER010) Do
FPutLn 1, TSTRING011(INTEGER009)
FPutLn 1, TINTEGER004(INTEGER009)
Inc INTEGER009
EndWhile
FClose 1
Goto LABEL025
:LABEL008
INTEGER002 = ""
Cls
If (Exist(PPEPath() + STRING008)) Then
DispFile PPEPath() + STRING008, 0
Else
PrintLn "@X8C There is an Error with the Polls Listing Notify Sysop!"
End
Endif
STRING007 = ""
PrintLn
InputStr "Which topic do you wish to View Results of", STRING007, 8, 2, Mask_Num(), 0
If (STRING007 == "") Goto LABEL003
If (STRING007 > INTEGER001) Then
PrintLn
PrintLn "@X0CInvalid Topic Number! @X0F Try again..."
Goto LABEL008
Endif
INTEGER009 = 1
If (Exist(PPEPath() + "sl-vote.q" + STRING007)) Goto LABEL009
PrintLn
PrintLn "@X0CTopic Not Found...Try Again"
PrintLn
Wait
Goto LABEL008
:LABEL009
FOpen 1, PPEPath() + "sl-vote.q" + STRING007, 2, 2
FGet 1, STRING012
FGet 1, STRING014
FGet 1, INTEGER003
FGet 1, INTEGER010
If (INTEGER010 > 16) INTEGER010 = 16
While (INTEGER009 <= INTEGER010) Do
FGet 1, TSTRING011(INTEGER009)
FGet 1, TINTEGER004(INTEGER009)
Inc INTEGER009
EndWhile
FClose 1
Cls
INTEGER009 = 1
PrintLn
PrintLn
PrintLn " ", STRING012
PrintLn "══════════════════════════════════════════════════════════════"
PrintLn "Number of Votes Percentage Answer"
PrintLn
While (INTEGER009 <= INTEGER010) Do
PrintLn " ", TINTEGER004(INTEGER009), " ", (TINTEGER004(INTEGER009) * 100) / INTEGER003, "% ", Left(TSTRING011(INTEGER009), 14)
Inc INTEGER009
EndWhile
PrintLn "══════════════════════════════════════════════════════════════"
PrintLn "Total Number of Votes: ", INTEGER003
FOpen 1, PPEPath() + "sl-vote.n" + STRING007, 2, 2
INTEGER009 = 1
BOOLEAN003 = 0
BOOLEAN002 = 0
:LABEL010
If (BOOLEAN003) Goto LABEL011
FGet 1, STRING013
If (InStr(STRING013, U_Name())) Then
BOOLEAN002 = 1
BOOLEAN003 = 1
Endif
If (Len((STRING013 == 0))) BOOLEAN003 = 1
Goto LABEL010
:LABEL011
If (BOOLEAN002 == 1) Goto LABEL012
Goto LABEL013
:LABEL012
PrintLn "Your Vote was: ", TSTRING011(Right(STRING013, 1))
PrintLn
Wait
FClose 1
Goto LABEL003
:LABEL013
PrintLn "Your Vote was: You Haven't Voted on This Topic!"
PrintLn
Wait
FClose 1
Goto LABEL003
If (CurSec() < INTEGER012) Then
PrintLn
PrintLn "@X8CYour Security is too low to Add a Booth!@X07"
PrintLn
PrintLn
Wait
Goto LABEL003
Endif
If (Exist(PPEPath() + "sl-vote.q" + INTEGER001)) Then
PrintLn
PrintLn "@X0CSorry, there are already ", INTEGER001, " Topics up to be voted on."
PrintLn "Either Delete one of your Polls, or ask your Sysop to."
PrintLn
Wait
Goto LABEL003
Endif
Cls
PrintLn
STRING007 = ""
InputYN "Do you wish to Add a Booth", STRING007, 3
If ((Upper(STRING007) == "N") || (Upper(STRING007) == NoChar())) Then
STRING007 = ""
Goto LABEL003
Endif
Cls
STRING012 = ""
:LABEL014
PrintLn "What Question do you wish to ask?"
InputStr ">_", STRING007, 11, 78, Mask_Ascii(), 0
If (Len(STRING007) == 0) Goto LABEL003
STRING007 = Upper(STRING007)
If ((InStr(STRING007, "FUCK") || InStr(STRING007, "DAMN")) || InStr(STRING007, "SHIT")) Goto LABEL014
STRING007 = STRING012
STRING007 = ""
PrintLn
PrintLn
PrintLn "You can Have 16 different Responses. Enter a Blank to End."
INTEGER009 = 1
BOOLEAN003 = 0
While ((INTEGER009 <= 16) && !BOOLEAN003) Do
Print "Answer ("
Print INTEGER009
Print ")"
InputStr "", TSTRING011(INTEGER009), 3, 36, Mask_Ascii(), 0
PrintLn
If (Len(TSTRING011(INTEGER009)) == 0) BOOLEAN003 = 1
Inc INTEGER009
EndWhile
INTEGER013 = 1
If (Exist(PPEPath() + "sl-vote.q1")) Then
:LABEL015
If (BOOLEAN002) Goto LABEL016
If (!Exist(PPEPath() + "sl-vote.q" + INTEGER013)) BOOLEAN002 = 1
Inc INTEGER013
Goto LABEL015
:LABEL016
INTEGER013 = INTEGER013 - 1
Endif
STRING014 = Left(Upper(U_Name()), 1) + Lower(Right(Upper(U_Name()), Len(Upper(U_Name())) - 1))
FCreate 1, PPEPath() + "sl-vote.q" + INTEGER013, 1, 3
FPutLn 1, STRING012
FPutLn 1, STRING014
FPutLn 1, "0"
FPutLn 1, INTEGER009
INTEGER009 = 1
BOOLEAN003 = 0
While ((INTEGER009 <= 16) && !BOOLEAN003) Do
FPutLn 1, TSTRING011(INTEGER009)
FPutLn 1, "0"
PrintLn TSTRING011(INTEGER009)
If (Len(TSTRING011(INTEGER009)) <= 0) BOOLEAN003 = 1
Inc INTEGER009
EndWhile
FClose 1
PrintLn STRING008
INTEGER009 = 1
FOpen 1, PPEPath() + "sl-vote.dat", 2, 2
BOOLEAN003 = 0
:LABEL017
If (BOOLEAN003) Goto LABEL018
FGet 1, TINTEGER014(INTEGER009)
Tokenize TINTEGER014(INTEGER009)
GetToken TINTEGER015(INTEGER009)
GetToken TINTEGER016(INTEGER009)
If (TINTEGER015(INTEGER009) > INTEGER013) BOOLEAN003 = 1
Inc INTEGER009
Goto LABEL017
:LABEL018
INTEGER017 = TINTEGER015(INTEGER009) - 1
While (Len(TINTEGER014(INTEGER009)) <> 0) Do
FGet 1, TINTEGER014(INTEGER009)
Tokenize TINTEGER014(INTEGER009)
GetToken TINTEGER015(INTEGER009)
GetToken TINTEGER016(INTEGER009)
Inc INTEGER009
EndWhile
FClose 1
FOpen 1, PPEPath() + "sl-vote.dat", 2, 2
INTEGER009 = 1
For INTEGER011 = 1 To INTEGER017
FPutLn 1, INTEGER009, ";", TINTEGER016(INTEGER009)
Next
FPutLn 1, INTEGER009, ";", STRING012
BOOLEAN003 = 0
:LABEL019
If (BOOLEAN003) Goto LABEL020
FPutLn 1, INTEGER009 - 1, ";", TINTEGER016(INTEGER009 - 1)
If (Len(TINTEGER016(INTEGER009 - 1)) == 0) BOOLEAN003 = 1
Goto LABEL019
:LABEL020
Goto LABEL003
PrintLn
PrintLn
If (CurSec() < INTEGER012) Then
PrintLn
PrintLn "@X8CYour Security is too low to Delete a Booth!@X07"
PrintLn
PrintLn
Wait
Goto LABEL003
Endif
STRING007 = ""
InputYN "Do you wish to Delete a Booth", STRING007, 3
If ((Upper(STRING007) == "N") || (Upper(STRING007) == NoChar())) Then
STRING007 = ""
Goto LABEL003
Endif
Cls
INTEGER011 = ""
PrintLn "You can only delete a Booth you created."
InputInt "Which booth do you wish to delete", INTEGER011, 11
FOpen 1, PPEPath() + "sl-vote.q" + INTEGER011, 1, 3
FGet 1, STRING012
FGet 1, STRING014
FClose 1
If (Upper(STRING014) <> U_Name()) Then
PrintLn
PrintLn "@X0CYou did not create this booth. Therefore you can not Delete it!"
PrintLn
PrintLn
Wait
Goto LABEL003
Endif
STRING007 = ""
PrintLn
PrintLn STRING012
PrintLn
InputYN "Do you wish to Delete This Booth", STRING007, 12
If ((Upper(STRING007) == "N") || (Upper(STRING007) == NoChar())) Then
STRING007 = ""
Goto LABEL003
Endif
Delete PPEPath() + "sl-vote.q" + INTEGER011
BOOLEAN003 = 0
:LABEL021
If (BOOLEAN003) Goto LABEL022
Rename PPEPath() + "sl-vote.q" + INTEGER011 + 1, PPEPath() + "sl-vote.q" + INTEGER011
If (!Exist(PPEPath() + "sl-vote.q" + INTEGER011)) BOOLEAN003 = 1
Inc INTEGER011
Goto LABEL021
:LABEL022
Goto LABEL003
:LABEL023
DispFile "sl-vote.hlp", 0
PrintLn
Wait
Goto LABEL003
:LABEL024
FClose 1
PrintLn
PrintLn "@X0C You have already voted on this topic...Please choose another"
PrintLn
PrintLn
Wait
Goto LABEL003
:LABEL025
FAppend 1, PPEPath() + "sl-vote.n" + STRING007, 2, 0
FPut 1, U_Name()
FPut 1, ";"
FPut 1, INTEGER002
FClose 1
Goto LABEL003
:LABEL026
PrintLn
PrintLn "Registered To: ", STRING001
If (BOOLEAN001 == 0) Then
Delay (10 * 182) / 10
Endif
End
;------------------------------------------------------------------------------
;
; Usage report (before postprocessing)
;
; ■ Statements used :
;
; 4 End
; 9 Cls
; 11 Wait
; 90 Goto
; 72 Let
; 3 Print
; 82 PrintLn
; 59 If
; 5 DispFile
; 2 FCreate
; 8 FOpen
; 1 FAppend
; 12 FClose
; 27 FGet
; 3 FPut
; 14 FPutLn
; 1 GetUser
; 1 Delete
; 5 InputStr
; 3 InputYN
; 1 InputInt
; 2 Delay
; 12 Inc
; 2 Tokenize
; 4 GetToken
; 1 InputText
; 1 Goodbye
; 1 Rename
;
;
; ■ Functions used :
;
; 3 *
; 3 /
; 50 +
; 6 -
; 25 ==
; 2 <>
; 3 <
; 9 <=
; 5 >
; 2 >=
; 41 !
; 4 &&
; 6 ||
; 8 Len(
; 1 Lower()
; 12 Upper()
; 2 Left()
; 2 Right()
; 5 InStr()
; 7 U_Name()
; 3 NoChar()
; 3 Strip()
; 2 Mask_Num()
; 2 Mask_Ascii()
; 26 PPEPath()
; 2 CurSec()
; 10 Exist()
; 3 S2I()
;
;------------------------------------------------------------------------------
;
; Analysis flags : No flag
;
;------------------------------------------------------------------------------
;
; Postprocessing report
;
; 1 For/Next
; 8 While/EndWhile
; 19 If/Then or If/Then/Else
; 0 Select Case
;
;------------------------------------------------------------------------------
; AEGiS Corp - Break the routines, code against the machines!
;------------------------------------------------------------------------------