

       Frontier-specific Functions & Procedures
       ----------------------------------------


          Note: These functions & procedures are not handled by PCBoard.

                Using any of these functions & procedures will result in the
                creation of a Frontier-specific PPE file that PCBoard will
                not execute.

                However, most of these funcs & procs are designed to be used
                only with Frontier. For example LEAVE is used at the end of
                the goodbye script. Since the major difference in layout,
                PCBoard would not need it althought Frontier does. As a
                second example, ADVMESSAGE is designed to be used with the
                WRITE MAIL script. Since most of PCBoard's layout is static,
                they included an internal message editor witch is able to
                set file attachments and all other flags, but did not provide
                a PPL procedure to write message with those flags. As
                Frontier's layout is completly dynamic, we need a new proc
                that allow us to set any flag on a message (file attach,
                carbon copy lists, etc).

                PPC will autodetect the use of those funcs & procs and will
                create a Frontier PPE with a different header so PCBoard will
                refuse to try to run it.


            Procedures
            ~~~~~~~~~~


      ABORT yesno:boolean

          Set the ABORT SCROLL flag (for use with MORE? prompts PPE)


      LEAVE

          Leaves frontier. Returns to DOS. This procedure does not execute
          the goodbye script and is intended to use at the very end of the
          goodbye script.

      DPRINT var:anytype [, var:anytype, ...]

           Prints on the DEBUG screen

           The alternate video adapter is used. For example you could have
           both a VGA and an MDA (or Hercule) video cards. If your system
           is set to use the color adapter (VGA), then this procedure will
           write to the monochrome (MDA or Hercule) one. Typing "MODE MONO"
           at the dos prompt will revert situation.

           Note that the secondary video adapter will not handle @Xnn data
           nor PCBoard (or Frontier) @MACROS@. (To print out a macro on the
		   debug screen, use PCBVAR())

           It is safe to use this function if no debug screen is present,
           in this case, no output is sent.

       DPRINTLN, DCLS, DANSIPOS, DSAVESCRN, RESTSCRN

           Alternate screen IO functions for use with the debug screen.
           (Refer to DPRINT)

       ADVMESSAGE Conf:integer, MsgFile:string

           Send a message using a full featured message file
           (Not yet documented)

       SETREAD Conf:integer, MsgNum:longint, YesNo:boolean

           Set the READ attribute of a message to True or False

       KILLTIME

           Give up time slice to the operating system

           Use this procedure when you are waiting for a key and do
           nothing that need speed. ie:

                String K
                Boolean Quit

                While (!Quit) Do
                  While (K = "") Do
                    KillTime()       ; Since no key was pressed, give time
                    K = Inkey()      ; to other tasks
                  End While
                  Select Case K
                    Case Chr(27)
                      Quit = True
                    Case Chr(13)
                      DoSomeStuff()
                  End Select
                  K = ""
                End While

           Note: If using the automatic time slice release (see configuration
           software), KillTime is not needed but using it will be safe and
           won't change PPE speed performance.

       SCREENCLEARED Status:Boolean

           Set ScreenCleared status flag.

           Typically, this will be used in your main menu with parameter
           FALSE just before launching a command. When the command ends and
           the menu continues, you can then use ScreenCleared() function to
           decide whether or not you have to redraw the menu since any CLS
           will turn the flag ON. This will prevent redrawing the menu
           if only one line of text was displayed (such an invalid command
           notification for example).

       UNKILLMSG Conf:integer, Message:Integer

           Recover a previously killed message (with KillMsg)
           It is safe to do it on an active message.

       END RtrnVal:string

           Same as END alone, but sets a returns value.

           Unlike PCBoard, Frontier allows a PPE to end returning a value
		   to the calling process. Value can be retreived either with the
		   Call() function (same as Call statement except the value returned
		   by the child PPE is directly returned by the Call() function),
		   or with the LastExitValue() function (which returns the last
		   value used to exit a PPE).

           see also Call() & LastExitValue() functions

	  	SETCARRIER Speed:integer

           Set frontier internal carrier speed as detected in modem answer
		   when getting carrier (used in call waiting screen ppe)

       SETLOCAL

           Close COM if it has been opened and set node in local mode
           After this statement has been used, nothing is sent to modem until
           a new COMINIT() function is issued.

           This this only has effect after a ComInit(). However, it is safe
           to run it when COM is not initialized.

       SETCOMHAND ComHandshake:integer

           CAUTION! Use with Care!!

           Set COM port handshake parameters. Mask is :

				DTR		 01h
				RTS		 02h

           SetComHand RTS + DTR ; will allow data receiving.
           SetComHand RTS       ; will lower DTS and will hangup on
		                        ; most modems
           SetComHand DTR       ; will lower RTS and will prevent remote
		                        ; modem from sending data.
           SetComHand 0         ; Will lower both DTS & RTS. See above.

       PUTPROFILE Section:string, Entry:string, Filename:string, Value:string

           Write a profile entry. This works just as windows ini files :

              PutProfile "Setup", "SysopColor", PPEPath() + "MYCHAT.INI", @X0F

              This will result in a file called MYCHAT.INI containing:

                    [Setup]
                    SysopColor = @X0F

              Using PutProfile on an existing entry will replace its value.

           See also: GetProfile()

        LOADCONF Conf:integer

           Actually loads the conference data and set the current conference.
           This is ONLY used in the JOIN.PPE ... other PPE that wish to join
           a different conf will use the JOIN statement since Loadconf does
           not check any security restriction while the JOIN.PPE does.

        REGISTERCMD Command, Effect, Level

           Registers a command to be accessable with the COMMAND statement

              Command is the keystroke on the command line
              Effect is the PPE or keystroke effect of the command
              Level is the minimum level neede to run the command

           This is to be used ONLY in the JOIN.PPE

        INVALIDCMDS

           Invalid all commands registered with REGISTERCMD.

           This is to be used ONLY in the JOIN.PPE

           Once this has been issued, no command will be available, even
           typing "BYE" on the command line would not do anything. All
           commands have to be reloaded from the JOIN.PPE. See JOIN.PPS
           for details

        CTOKENIZE String str, String char

           Tokenize a string whoses sections are separated by the first
           character of 'char'. ie:

           A = "1,2,3,4"
           CTokenize A, ","

        SUSPENDCOM, RESTORECOM

           Those two statements are intended to be used ONLY in the UPLOAD
           & DOWNLOAD scripts. This unhook & restore the Frontier COM
           routines and allow one to leave them free to the called protocol.

           Use with CARE!!

        MACROS MacrosStatus:Boolean

           Set whether or not frontier has to translate @VARs@ & @Xnn color
           codes.

           Used typically in a message editor where you have to see the color
           codes inside the text beeing edited.

        SANSIPOS x, y

           Moves local cursor only

        PAGETEXT Text:string

           Sets the text beeing displayed in the status bar at the "Paging
           Text". This allows the user to know why the user did paged 10
           minutes ago.

         BIGSHELL ViaCmdCom:Boolean, RetValue:Var, Prog:String, Args:String

	       Same as Shell except Frontier swaps out to XMS/EMS/Disk (and thus
           suspend the COM routines just like SuspendCom would)

         RdPcbSys

          Reads the PCBOARD.SYS in the current directory and loads the data
          in it (user, etc...)

          User to return from a door

         SetCom Com:String, Base:Int, Irq:Int

          Sets the COM parameters. Used before a call to ComInit()

         SearchFileFind File:String, Flag:Boolean

          Works the same way as SearchFind, but works on a file rather than
          on a string buffer

         ResetLog

          Empty LOG for this node

          Should be used only for sysop function "1 D"

	     GetCom Com:String, Base:Int, Irq:Int

          Returns the current COM parameters in the 3 arguments passed.

         SCls

          Clears the local screen only

         WrFrtSys

          Write a FRONTIER.SYS in the current Directory

         RdFrtSys

          Read data from FRONTIER.SYS in the current directory

         AdjTUFiles Val:Int

          Adjust total number of uploaded files for the user

         SetTTime

          Sets the total time allowed for this user. This does not include
          calculations to get the remaining time.

          For example:

             SetTTime 60

             Sets time to 60 Minutes for this user, but automatically
			 calculates that if the user already spend 10 minutes today,
             only 50 left.

         SetLang LangExt:String, LangNum:Int

          Sets the language data.

          LangExt is the file extention associated with the language
          LangNum is the ID number of this language




            Functions
            ~~~~~~~~~


       DSCRTEXT, DGETX, DGETY

           Alternate screen IO functions for use with the debug screen.
           (Refer to DPRINT)

       DUALSCR() : Boolean

           Returns TRUE if an alternate screen (Debug) is present. FALSE
           if only one video adapter was detected

       CONFNAME(Conf:integer) : string

           Returns name of the conference number passed as argument

       SCREENCLEARED() : boolean

           Returns TRUE if screen was cleared by CLS since last
           "ScreenCleared FALSE" (see statement screencleared)

           Used to decide whether the menu has to be redrawn or
           not after launching a command.

       CALL()

           Same as CALL statement except it returns the value returned by
		   the child PPE using the END statement with a parameter.
           see also LastExitValue()

       LASTEXITVALUE()

           Get the last value returned by a PPE. Value is "" (empty string)
		   if END was used alone with no paramater.

       FREE() : integer

           Returns amount of free system memory (largest memory block
		   available from DOS to frontier.exe. Note that this may be a lot
		   smaller than the real memory available if the core is fragmented)

	  	COMINIT() : boolean

	       Initialize COM port with node specific parameters.

           Returns TRUE if success, FALSE if error.

       GETCOMSTAT() : integer

           Returns COM port status. Mask is:

                0x0100 : CTS line changed states
                0x0200 : DSR line changed states
                0x0400 : RI line changed states
                0x0800 : DCD line changed states
                0x1000 : state of CTS line
                0x2000 : state of DSR line
                0x4000 : state of RI line
                0x8000 : state of DCD line
                0x0001 : state of DTR line
                0x0002 : state of RTS line

       GETUARTTYPE() : integer

           Returns detected UART :

                 0 : No Uart
                 1 : INS8250-B
                 2 : INS8250A, NS16C450
                 3 : NS16550 (FIFO Bug)
                 4 : NS16550A (FIFO Ok)

       GETPROFILE(Section:string, Entry:string, Filename:string) String

           Retrieved a previously saved profile (ini file). See PutProfile

       FILEMATCH(String File, String Mask) Boolean

           Check filename against mask. ie:

               FileMatch("ABCDEFGH.123", "*.*") = 1
               FileMatch("ABCDEFGH.123", "ABC*.*") = 1
               FileMatch("ABCDEFGH.123", "*BC*.*3") = 1
               FileMatch("ABCDEFGH.123", "?BC???G?.1?3") = 1
               FileMatch("ABCDEFGH.123", "ABCDEFGH.") = 0

      GETNEXTMSG(Integer Conf, Integer Start, Integer Increment,
                  String From, String To, String ToAlias, String Subject,
                  String Text, String DateFrom, Boolean SeeAll) Integer


            Returns the next message in the specified conference (starting
            from 'Start') that match the specified criterias...

            If a criteria is empty (""), it will not be used.
            Purpose of Increment is to search backward (-1) or forward (1)


            ie:

            GetNextMsg(CurConf(), HiMsgNum(), -1, U_NAME(), U_Alias, "", "", "VIRUS", 0, False)

            Will return next message in current conf starting from last msg,
            searching backward, that is from current user and contains the
            word "VIRUS". Msg protection will apply.

            This allows designing a PPE to handle "R Y - TS VIRUS" command
            for example.

      FRTINI() String

            Returns the path to FRONTIER.INI

      BETA() Boolean

            Returns true if This is a beta of Frontier

	  HiMsgNumC(Conf:Int) : Long

            Returns the Highest message number for the specified conference

      LoMsgNumC(Conf:Int) : Long

            Returns the Lowest message number for the specified conference

      RootPath() : String

     		Returns the Frontier ROOT directory (the one that holds
			FRONTIER.INI)

	  ToSDate(Var:Any) : SDate

            Convert any value to SDate type

	  LangFile() : String

            Returns the Language string & setup files




            DATA Types
            ~~~~~~~~~~

      SDATE

            SDate is the same as DATE type except convertions to string
            always apply with MM.DD.YY while DATE depends on language
            selected.

