INSTALLATION: To install this PPE in your application, unzip it into a subdirectory called \PCB\PPE that was created by the installation process. Then go into PCBSetup, File Locations, Configuration Files, to the entry that says Name/Loc of Default CMD.LST File. Once you're there, press the F2 key to edit the file. You'll see a screen that looks something like this: Command Security PPE/MNU File -or- Keystroke Replacement ΝΝΝΝΝΝΝΝΝΝΝΝΝΝ ΝΝΝΝΝΝΝΝ ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ 1) 0 Put "UPGRADE" as the command, security level of 0, and the complete drive path and filename of this PPE in the third column. Assuming you set this program up on the C: drive, your entry would look like this: Command Security PPE/MNU File -or- Keystroke Replacement ΝΝΝΝΝΝΝΝΝΝΝΝΝΝ ΝΝΝΝΝΝΝΝ ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ 1) UPGRADE 0 C:\PCB\PPE\UPGRADE.PPE At this point, go into PCBSetup, Main Board Configuration, Name/Loc of User's Menu, and press the F2 key to edit that. You will be put into an editor, where you can add the new command to the main menu. If you dont' wish to edit the menu file at this time, you can log in locally and try out your new command. It's not listed on the menu, but it is active and available. ************************************************************************** EXPLAINING THE CODE: This is the exaplanation of the UPGRADE.PPS file you will find in this archive. The lines will be explained one at a time, and I will attempt to explain each one fully. In a full-blown program of this type, there would obviously be much more checking than this. In order to fit within the demo version's limit of 10 lines, we've kept this short and simple. Also, since we have no way of knowing what conferences you may have configured on your system, we haven't actually done any registration process. ===================================================================== Int Month,Day,Year,Born,Age Declare the variables. In this case we'll only be working with numbers, so the variables are all declared to be Integers. (Int is one type of Integer) ===================================================================== InputStr "What month were you born (MM)",Month,0Ah,2,"0123456789",FieldLen + LfAfter InputStr "What day were you born (DD)",Day,0Ah,2,"0123456789",FieldLen + LfAfter InputStr "What year were you born (YYYY)",Year,0Ah,4,"0123456789",FieldLen + LfAfter Ask the caller what month, year, and day (s)he was born. The standard date function will interpret any date before 01-01-80 as being in the 21st century, so we ask in three seperate questions, then use another function of the PPL Compiler to make it into a valid date that can be used to compute age, etc. The function here is called InputStr meaning, literally, "Ask the caller a question and wait for their input." You declare the function, InputStr, then define the question you want asked. After the question, you put in the variable you'd like the caller's answer assigned to. Since in an application, the program can't deal with input directly, you have to have a variable, a temporary storage place, to hold the information. It's a little like having spare coffee cups sitting around to hold all the screws you just took out of the toaster, while you're trying to see what makes it work. Next you tell it what color you'd like it to display the question in. This example uses bright green on a black background. After that, the maximum length of the input you'll accept. The top two questions will only allow 2 characters each, the last one will allow 4 characters. Then you tell it what characters are valid for each of these questions. Since we only want numbers entered for any of these questions, numbers are all that are listed as valid. After that you tell it the "Flags", or how you want the question to be treated. These flags tell the application to put a carriage return (Enter key) after each question, and to put parentheses to show the caller how much room they have to enter their answer. ===================================================================== If (((Date() - MkDate (Year,Month,Day)) / 365.25) > 18) Then This is a mathmatical formula, with a little bit of a twist. All dates are kept in "Julian" format, which simply counts the number of days since January 1, 1900. That makes it easier to add and subtract dates. What it's saying is this: Subtract the birthdate the caller entered from today's date, then divide the remainder by 365.25 (have to keep track of those leap years). If the number you get from this is more than 18, do the things listed after this statement. ===================================================================== PrintLn "@X0EYou are ",(ToInt((Date() - MkDate(Year,Month,Day)) / 365.25))," years old. You will be given access to the adult areas of" PrintLn "@X0Ethis system." Print what follows after the PrintLn statement. In this case it prints something like "You are 30 years old. You will be given access to the adult areas of this system." It automatically performs the same mathematic formula explained in the last statement and prints the (rounded off) remainder. We round it off, because most people would rather see 30 years old than 30.9578 years old. ===================================================================== Else In case the original statement (that the caller is more than 18 years old) isn't true, we give an "Else" condition. The computer is very literal, so we're giving an "argument" - that the caller is over 18, and if it's declared to be false, the "else" is used. If we didn't use an "else" and just put in the "Endif" statement, the application would end without taking any action. ===================================================================== PrintLn "@X0E",(ToInt((Date() - MkDate(Year,Month,Day)) / 365.25))," is too young to have access to the adult areas of this system." This is the action taken if the first argument is proven to be false. It converts the formula to an age the caller can understand and tells them they're too young to be given access to the adult areas. ===================================================================== Endif This is the end of the "if" statement. You've given a condition - "if this is true, then do this", and this marks the place where your conditions stop.