Page Length Command Replacement for PCBoard - Improved User Input Handling
610 likes | 734 Vues
This documentation outlines the replacement for PCBoard's Page Length command, designed by Jesse Keene. The script enhances user experience by validating inputs and dynamically adjusting the page length based on user specifications (0-99). If the input is invalid, the program prompts the user again, ensuring all inputs are coherent and giving clear instructions on what values are accepted. For improved aesthetics, ANSI enhancements are included to provide a better visual cue. Feedback is welcomed; reach out to Jesse Keene at spacecb@deeptht.armory.com.
Page Length Command Replacement for PCBoard - Improved User Input Handling
E N D
Presentation Transcript
; If you find this PPE of any use, I'd really appreciate hearing from you!
; You can send me email at spacecb@deeptht.armory.com ... thanks!
' This checks to see if the user entered anything at the command line
' (ie "p 23") if so, it checks to see if they entered a valid # (0-99)
' if so, the PPE will set the users page length to that number.
if (tokcount() > 0) then ' if something was entered at command line
cmdnum = s2i(cmdline,10) ' converts string (cmdline) to int (cmdnum)
if (cmdline=i2s(cmdnum,10)) cmdflag=1 ' if successfully converted
' to int, set cmdflag to true
if (cmdflag=0 | cmdnum > 99) end ' if conversion unsuccessful, or
' if # bigger than 99, end program
print "@POFF@@X07" ' Disables pausing, sets color to standard white
println "@X0EThe number at the top of your screen is your Page Length"
println "@X02Page Length is currently set to @X0A", U_PAGELEN
' if user has ANSI, this prints the arrow at the top of the screen
if (ansion()) print Esc+"[s"+Esc+"[0;4H@X0E<@X06--"+Esc+"[u"
' The _ underscore at the end of an input string keeps PCBoard from
' prompting with a ? Question mark; this can come in handy often ;-)
inputstr "@X0BEnter Page Length@X03: _",plen,@X0B,2,MASK_NUM(),DEFS