
    TROUBLESHOOTING

    This file contains information about troubleshooting programs
    that incorporate MAXLIB For PB.



    TROUBLE #1:

      When you compile your program, PB highlights a line containing
      a call to a routine in MAXLIB For PB and gives the message:

         Error 426: Variable expected.


    TO SOLVE IT:

      You have probably tried to use an equation in a parameter that
      was declared AS ANY in the DECLARE statement for the routine,
      like this:


         DECLARE SUB PutStX (Handle%, FromStrng AS ANY)
         .
         .
         PutStX Handle%, RTRIM$(Variable$)  '<-- illegal parameter


      RTRIM$(Variable$) is an equation, not a variable.  When a
      parameter is declared AS ANY, it must be a variable.  It
      cannot be an equation (X%+Y%), a constant (%TRUE) or a literal
      value (2.333!).

      To avoid an error, simply assign the value of the equation to
      a variable prior to making the call and then send that
      variable as the parameter, instead of the equation:


         Variable$ = RTRIM$(Variable$)
         PutStX Handle%, Variable$


      The same holds true for constants and literal values.  You
      must assign them to a variable and then pass the variable.




    TROUBLE #2:

      You have opened a very large number of files and when you try
      to close a file, you get an error number 4: no more handles
      available.


    TO SOLVE IT:

      It may seem strange at first, but MAXFiles must open a disk
      file in order to close an EMS file.  If there are no unused
      DOS file handles when you try to close an EMS file (or clip
      it, or flush it) you will trigger an error.  
      
      You must always leave at least one file handle unused by your
      program.  There are no exceptions to this rule.




    TROUBLE #3:

      You have EMS/XMS memory but MAXLIB For PB won't use it.

    TO SOLVE IT:

      Make sure you have called InitMAXFiles, InitEMSArray (was
      InitMAXArray in v1.0), or InitXMSArray, as needed.

      Make sure you have used PBINST.EXE to change the default
      EMS/XMS usage in PB.EXE to something other than "ALL".

      If you have been single-stepping through your code to debug it
      and have been aborting your program before it runs to
      completion, MAXLIB won't have a chance to automatically
      deallocate the EMS/XMS memory it has allocated.  Eventually,
      you will run out of EMS/XMS memory.  To regain this memory you
      must reboot.

      If you have an EMS driver numbered prior to version 4.0,
      MAXFiles won't be able to use your EMS memory.  Check your
      version number.

      Lastly, if you have tampered with the copyright notice in
      MAXLIB.PBL or in your program's EXE file, MAXLIB will fail to
      recognize any EMS/XMS resources on your computer.

