home *** CD-ROM | disk | FTP | other *** search
/ Windoware / WINDOWARE_1_6.iso / powerbbs / pbbs170 / powrmain.exe / POWRLANG.DOC < prev    next >
Text File  |  1991-10-14  |  16KB  |  553 lines

  1.        POWERLANG
  2.        ────────────────────────────────────────────────────────────
  3.  
  4.         PowerLang is a Basic Type of Language, which permits you to write your
  5.         own menu routines.
  6.  
  7.         PowerLang files can be created by any text editor or word
  8.         processor which can edit standard text files.
  9.  
  10.         PowerLang files are read line by line, and run just like a basic
  11.         program.
  12.  
  13.         Here are the commands which are currently available in PowerLang:
  14.  
  15.                            Activity
  16.                            --------
  17.  
  18.   Structure: Activity "Info to be written to Activity Log"
  19.  
  20. Description: Writes info to the Activity Log.  Info in quotes can
  21.              be no larger than 75 characters.
  22.  
  23.    Examples: Activity "Added BBS to BBS Listed"
  24.              Activity "Loaded Viewage program"
  25.  
  26.                             Append
  27.                             ------
  28.  
  29.   Structure: Append "Path/Filename to open file for Append"
  30.  
  31. Description: This command will open a file to write to.  If the file
  32.              is not found, it is created.  The Write_File command will
  33.              write to the end of the file.  The file is NOT DELETED, the
  34.              data is written to the end of the file.
  35.  
  36.    Examples: Append "Blt.Dat"
  37.              Append "BBS.Lst"
  38.              Append "D:\Powrbbs\Blt\Blt4"
  39.  
  40.                           ClearScreen
  41.                           -----------
  42.  
  43.   Structure: ClearScreen
  44.  
  45. Description: Clears the screen
  46.  
  47.    Examples: Clearscreen
  48.  
  49.                              Close
  50.                              -----
  51.  
  52.   Structure: Close
  53.  
  54. Description: Closes the current open file (If a file is currently open)
  55.  
  56.    Examples: Close
  57.  
  58.                              Dec
  59.                              ---
  60.  
  61.   Structure: Dec [Integer Code] [Integer Code]
  62.              Dec TIME [integer Code]
  63.              Dec SAFE [integer Code]
  64.  
  65. Description: Decreases the integer.  For example, if you do (Dec I1 I2), if
  66.              I1 = 12 and I2 = 5, I1 becomes 7 and I2 stands at 5.
  67.  
  68.              You can Decrease the users TIME or SAFE by using this command.
  69.  
  70.    Examples: Dec I5 I7
  71.              Dec TIME I1
  72.              Dec SAFE I1
  73.  
  74.  
  75.                             Display
  76.                             -------
  77.  
  78.   Structure: Display "[Text to be displayed]"[;]
  79.              Display S1[;]
  80.              Display I1[;]
  81.  
  82. Description: Display sends text to the caller, and writes the info
  83.              on the local monitor.
  84.  
  85.       Usage: Text in " can be anything BUT Quotes ('"').
  86.              If a Comma (';') is placed at the end of the line,
  87.              no return (C/R) is send and written on the monitor.
  88.              If no Comma is present, C/R is sent and written on
  89.              the local monitor.
  90.  
  91.              To display a string or integer, just enter the code of
  92.              the string, integer.. You MUST include the S or I.
  93.  
  94.    Examples: Display "Welcome to the FUN world of BBSing.. "
  95.              Display "Enter your name: ";
  96.              Display I1;
  97.              Display I1
  98.              Display S1;
  99.              Display S1
  100.  
  101.                               Dos
  102.                               ---
  103.  
  104.   Structure: Dos "[Dos Command Line]"
  105.  
  106. Description: Shells to Dos, and runs the command in quotes (" ").
  107.              When the shell is complete, if the log file is found,
  108.              it is displayed and then erased.
  109.  
  110.    Examples: Dos "Dir >|LOG|"
  111.                This will do a directory of the current location, and
  112.                send the output to the |LOG| file.  The |LOG| file
  113.                is then displayed and erased.
  114.  
  115.                           Dos_Windows
  116.                           -----------
  117.  
  118.   Structure: Dos_Windows "[Windows PowerDOOR Command Line]"
  119.  
  120. Description: Shells to run a PowerDOOR, and runs the command in quotes (" ").
  121.  
  122.    Examples: Dos "c:\mail\powrmail.exe |PBBSDAT|"
  123.  
  124.                          Give_Value
  125.                          ----------
  126.  
  127.   Structure: Give_Value S1 "This is what S1 will equal"
  128.              Give_Value I1 "300"
  129.  
  130. Description: Assigns the identification code (either string or integer)
  131.              a new value which is assigned in quotes.
  132.  
  133.    Examples: Give_Value S9 "Welcome..."
  134.              Give_Value I1 "1"
  135.  
  136.                              If  (EndIf)
  137.                              --
  138.  
  139.   Structure: If [!] [Flag #]
  140.              If [!] [Char #] = "Character to compare character # with"
  141.              If [!] I1 = I2
  142.              If [!] I1 > I2
  143.              If [!] I1 < 12
  144.              If [!] S1 = S2
  145.              If [!] S1 > S2
  146.              If [!] S1 < S2
  147.  
  148.  
  149. Description: The If statement, will check to see if the flag is true, or
  150.              if the character is equal to the character in quotes.  If
  151.              the definition is true, all the commands after the If statement
  152.              will be run, until an EndIf statement is reached.
  153.  
  154.              If statements for integers can compare different integer
  155.              values..
  156.  
  157.              The ! is optional, and stands for Not.  In this case, if the
  158.              definition is false, then the if statement is run.
  159.  
  160.    Examples: If B1    (Use B and the number for flags)
  161.              Display "B1 = True"
  162.              Display "This statement is still run"
  163.              Endif
  164.  
  165.              If ! B1
  166.              Display "B1 = False"
  167.              Endif
  168.  
  169.              If C1 = "A"
  170.              Display "The Character #1 is equal to A!"
  171.              Endif
  172.  
  173.              If ! C1 = "A"
  174.              Display "The Character #1 is NOT equal to A!"
  175.              Endif
  176.  
  177.              If I1 > I2
  178.              Display "Integer I1, is greater than I2!"
  179.              Endif
  180.              If I1 = I2
  181.              Display "Integer I1, is equal to I2!"
  182.              Endif
  183.              If I1 < I2
  184.              Display "Integer I1 is less than I2!"
  185.  
  186. Note: You can place if statements, within an if statement.. Examples:
  187.  
  188.              If C1 = "A"
  189.               If I1 < I2
  190.                Display "I1 < I2 and C1 = A!"
  191.               Endif
  192.               If I1 > I2
  193.                Display "I1 > I2 and C1 = A!"
  194.               Endif
  195.               Display "GoodBye!"
  196.              Endif
  197.  
  198.                           Get_Return
  199.                           ----------
  200.  
  201.   Structure: Get_Return
  202.  
  203. Description: Forces the caller to type RETURN
  204.  
  205.    Examples: Get_Return
  206.  
  207.                            Get_Choice
  208.                            ----------
  209.  
  210.   Structure: Get_Choice [Ok_Char_String] [Char #]
  211.  
  212. Description: Forces the caller to keep inputing, until one of his
  213.              characters is contained in the OK_Char_String.  The
  214.              Char # is given this value.  The Char # can be from
  215.              1 - 25, and is understood as C and the number, such
  216.              as C1.  C does not have to be present in this command.
  217.  
  218.    Examples: Get_Choice YN 1
  219.                This command will wait until Y or N is pressed, and give
  220.                C1 the value which is pressed.
  221.  
  222.              Get_Choice ABCDEFG 4
  223.                This command will wait until one of the letters A,B,C,D,
  224.                E,F, or G are pressed, and give C4 that value.
  225.  
  226.                            Get_Yesno
  227.                            ---------
  228.  
  229.   Structure: Get_YesNo [Flag#]
  230.  
  231. Description: Forces caller to type Y or N.
  232.              If Y is pressed the Flag# given is assigned True
  233.              If N is pressed the Flag# given is assigned False
  234.  
  235.       Usage: The Flag# is a number from 1 to 25 (NO higher, NO lower).
  236.              B can be placed before the number, but is not necessary in
  237.              this function.  (It IS nessassary in other functions)
  238.  
  239.    Examples: Get_YesNo B1
  240.              Get_Yesno B3
  241.              Get_Yesno 4
  242.  
  243.                               Goto
  244.                               ----
  245.  
  246.   Structure: Goto [Line to move to]
  247.  
  248. Description: Goes to a certain line number.  Lines designated for GOTO,
  249.              begin with :.
  250.  
  251.    Examples: Goto END
  252.              :START
  253.              DISPLAY " This is Start "
  254.              :END
  255.              DISPLAY " This is End "
  256.  
  257.                              Inc
  258.                              ---
  259.  
  260.   Structure: Inc [Integer Code] [Integer Code]
  261.              Inc TIME [integer Code]
  262.              Inc SAFE [integer Code]
  263.  
  264. Description: Increases the integer.  For example, if you do (Inc I1 I2), if
  265.              I1 = 5 and I2 = 12, I1 becomes 17 and I2 stands at 12.
  266.  
  267.              You can increase the users TIME or SAFE by using this command.
  268.  
  269.    Examples: Inc I5 I7
  270.              Inc TIME I1
  271.              Inc SAFE I1
  272.  
  273.                           Input_String
  274.                           ------------
  275.  
  276.   Structure: Input_String [Max String Length] [String #]
  277.  
  278. Description: Gets a string from the caller (Combination of any characters),
  279.              up the the Maximum string length.  The Value of the String
  280.              Input is given to the String #.
  281.  
  282.       Usage: The Input String Number, is a variable defined as S and the
  283.              number of the string which can vary from 1 to 15.  You can
  284.              have up to 15 strings (S1-S20).  In this function, only the
  285.              number of the string has to be given, since only strings
  286.              are outputted. The Maximum length a string can be is 50
  287.              characters.
  288.  
  289.    Examples: Input_String 50 1
  290.              Input_String 25 2
  291.              Input_String 40 S3
  292.  
  293.                          Int_To_Str
  294.                          ----------
  295.  
  296.   Structure: Int_To_Str [Integer Code] [String Code]
  297.  
  298. Description: The integer value from the integer code is assigned to
  299.              a string
  300.  
  301.    Examples: Int_To_Str I1 S1
  302.              Int_To_Str I19 S5
  303.  
  304.                         Number_Input
  305.                         ------------
  306.  
  307.   Structure: Number_Input [Number Format] [String #]
  308.  
  309. Description: Inputs a number-format, and sends input to the string #
  310.              defined.  The Number Format is the same used in the
  311.              script questionnaires.  In for Number Format, wherever a
  312.              # is placed, the caller must enter a number.  Anything
  313.              else in the format, is just displayed to the user, and
  314.              also entered in the string #.
  315.  
  316.    Examples: Number_Input (###) ###-#### S1
  317.              Number_Input ##-##-## S2
  318.              Number_Input ##/##/## S3
  319.  
  320.                         Return_To_BBS
  321.                         -------------
  322.  
  323.   Structure: Return_To_BBS
  324.  
  325. Description: Quits, and returns to PowerBBS
  326.  
  327.    Examples: Return_To_BBS
  328.  
  329.                              Run
  330.                              ---
  331.  
  332.   Structure: Run "[PowrLang Source Code Path/Name to Run]"
  333.  
  334. Description: Quits out of the current code, and runs the code specified
  335.              in the Run QUOTES.  It quits the current code, and WILL
  336.              NOT COME BACK (Unless that source RUNs the current code again).
  337.  
  338.       Usage: Run "EndOf.Pow"
  339.              Run "Menu.Pow"
  340.  
  341.                            Set_Flag
  342.                            --------
  343.  
  344.   Structure: Set_Flag [FLAG #] [YES/NO]
  345.  
  346. Description: Sets the flag # to either true (YES) or false (NO).
  347.              Flag # can be a number from 1 - 25.
  348.  
  349.    Examples: Set_Flag B1 YES
  350.                Sets flag #1 to True
  351.  
  352.              Set_Flag B19 NO
  353.                Sets flag #19 to False
  354.  
  355.                          Str_To_Int
  356.                          ----------
  357.  
  358.   Structure: Str_To_Int [String Code] [Integer Code]
  359.  
  360. Description: The Integer value of the string is assigned to the integer
  361.              code
  362.  
  363.    Examples: Str_To_Int I1 S1
  364.              Str_To_Int I19 S5
  365.  
  366.  
  367.  
  368.                            Type_File
  369.                            ---------
  370.  
  371.   Structure: Type_File "[Path/Filename]"
  372.  
  373. Description: Types a file to the screen and to the caller.
  374.  
  375.       Usage: In " " should be the path/filename of the file you
  376.              want to be typed to the caller and monitor.  No "
  377.              should be present.
  378.  
  379.    Examples: Type_File "C:\Powrbbs\Screen\Menu"
  380.              Type_File "D:\Fun"
  381.  
  382.                               Wait
  383.                               ----
  384.  
  385.   Structure: Wait [MilliSeconds to Pause]
  386.  
  387. Description: Waits for the certain time in milliseconds.
  388.              1000 => 1 Second
  389.  
  390.    Examples: Wait 5000     :: Pauses for 5 Seconds ::
  391.              Wait 200      :: Pauses for .2 Seconds ::
  392.  
  393.                             Write_File
  394.                             ----------
  395.  
  396.   Structure: Write_File [String #][;] [/String Length]
  397.              Write_File "[Text to write]"[;]
  398.  
  399. Description: Writes Info to the current opened file.  File must be
  400.              opened for REWRITEing, or APPENDing.
  401.              String # is the String #.  If no ; is present, C/R is
  402.              entered in the file.  If there is a ;, no C/R is present,
  403.              you can then use the / command.  The /# will write the string
  404.              to the file, set in the number of strings.  For example, if
  405.              you write S1 to the file and S1 = "516", but you want the
  406.              file to be cleared for the next data, you can use
  407.              Write_File S1; /4 which will write "516 ", instead of "516".
  408.  
  409.              Info written in Quotes, will be written to the text file.
  410.              ; places the same role as above.  No / is supported.
  411.  
  412.    Examples: Write_File S2
  413.              Write_File S2;
  414.              Write_File S2; /5
  415.              Write_File "516-873-8032"
  416.              Write_File "516-873-8032";
  417.  
  418.  
  419. Example [1.Pow]:
  420.  
  421. :BEGIN
  422. Display
  423. Display
  424. Display " @2@BBS Database...   @8@Written By Russell Frey in PowrLang... "
  425. Display
  426. Display " @7@[@9@A@7@]dd to Local BBS Listing"
  427. Display
  428. Display " @7@[@9@V@7@]iew Local BBS Listing"
  429. Display
  430. Display " @7@[@9@Q@7@]uit to Main Menu"
  431. Display
  432. Display " @1@(@2@|MINLEFT|@7@ mins Left@1@)@3@ Enter Command: @3@";
  433.  
  434. Get_Choice AVQ 1
  435.  
  436. Display
  437. Display
  438.  
  439. IF C1 = "V"
  440. Type_File "Local.Lst"
  441. Get_Return
  442. Goto BEGIN
  443. EndIf
  444.  
  445. If C1 = "Q"
  446. Return_To_BBS
  447. Endif
  448.  
  449. Display
  450. Display "        Enter the BBS Name (25 Chars): ";
  451. INPUT_STRING 25 1
  452. Display
  453.  
  454. Display "Enter the PHONE Number (XXX-XXX-XXXX): ";
  455. NUMBER_INPUT ###-###-#### 2
  456.  
  457. Display "Enter the highest BAUD rate (5 Chars): ";
  458. Input_String 5 3
  459. Display
  460.  
  461. Display "          BBS Software Used (9 Chars): ";
  462. Input_String 9 4
  463. Display
  464.  
  465. Display "Description of this BBS? [2 Lines/30 Chars]: ";
  466. Input_String 30 5
  467.  
  468. Display "Description of this BBS? [2 Lines/30 Chars]: ";
  469. Input_String 30 6
  470.  
  471. Display
  472. Display "Add Entry To BBS List File? (Y/N) ";
  473. GET_YESNO B1
  474.  
  475. If ! B1
  476. GOTO BEGIN
  477. EndIf
  478.  
  479. APPEND "Local.Lst"
  480.  
  481. WRITE_FILE S2;
  482. Write_File "  ";
  483. Write_File S1; /25
  484. Write_File "  ";
  485. Write_File S5
  486. Write_File "Highest Baud: ";
  487. Write_File S3; /5
  488. Write_File "  ";
  489. Write_File "Software: ";
  490. Write_File S4; /9
  491. Write_File " ";
  492. Write_File S6
  493. Write_File " "
  494. Close
  495.  
  496. GOTO BEGIN
  497.  
  498. Example [3.Pow]:
  499.  
  500. :BEGIN
  501. Display
  502. Display " @5@Minutes in safe: @3@|SAFE| "
  503. Display " @7@[@9@T@7@]ake from safe, [@9@P@7@]ut into Safe, [@9@Q@7@]uit?@3@ ";
  504. Get_Choice TPQ 1
  505. Display
  506. Display
  507.  
  508. If C1 = "Q"
  509. Return_To_BBS
  510. Endif
  511.  
  512. If C1 = "P"
  513. Give_Value I1 "|SAFE|"
  514. Give_Value I2 "60"
  515. Give_Value I5 "|MINLEFT|"
  516. Dec I2 I1
  517. Display "@2@Put how many minutes into the safe (Max:@3@ ";
  518. Display I2;
  519. Display "@2@)?@3@ ";
  520. Input_String 2 S1
  521. Display
  522. Str_To_Int S1 I4
  523.  
  524.  If I4 > I5 Then
  525.   Display "@9@You don't have that much time!"
  526.   Goto BEGIN
  527.  Endif
  528.  
  529.  If I4 > I2 Then
  530.   Display "@9@Safe can't hold over 60 minutes!"
  531.   Goto BEGIN
  532.  Endif
  533.  
  534.  INC SAFE I4
  535.  DEC TIME I4
  536. Endif
  537.  
  538. If C1 = "T"
  539. Display "@2@Take how many minutes from the safe (Max: @9@|SAFE|@2@)?@3@ ";
  540. Give_Value I1 "|SAFE|"
  541. Input_String 2 S2
  542. Display
  543. Str_to_int S2 I2
  544.  If I2 > I1
  545.   Display "@9@Sorry, the safe only has |SAFE| minutes! "
  546.   Goto BEGIN
  547.  endif
  548.  DEC SAFE I2
  549.  INC TIME I2
  550. Endif
  551.  
  552. Goto BEGIN
  553.