home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / prgmming / maxlib10 / trbshoot.txt < prev    next >
Text File  |  1994-10-23  |  3KB  |  99 lines

  1.  
  2.     TROUBLESHOOTING
  3.  
  4.     This file contains information about troubleshooting programs
  5.     that incorporate MAXLIB For PB.
  6.  
  7.  
  8.  
  9.     TROUBLE #1:
  10.  
  11.       When you compile your program, PB highlights a line containing
  12.       a call to a routine in MAXLIB For PB and gives the message:
  13.  
  14.          Error 426: Variable expected.
  15.  
  16.  
  17.     TO SOLVE IT:
  18.  
  19.       You have probably tried to use an equation in a parameter that
  20.       was declared AS ANY in the DECLARE statement for the routine.
  21.       like this:
  22.  
  23.  
  24.          DECLARE SUB PutStX (Handle%, FromStrng AS ANY)
  25.          .
  26.          .
  27.          PutStX Handle%, RTRIM$(Variable$)  '<-- illegal parameter
  28.  
  29.  
  30.       RTRIM$(Variable$) is an equation, not a variable.  When a
  31.       parameter is declared AS ANY, it must be a variable.  It
  32.       cannot be an equation (X%+Y%), a constant (%TRUE) or a literal
  33.       value (2.333!).
  34.  
  35.       To avoid an error, simply assign the value of the equation to
  36.       a variable prior to making the call and then send that
  37.       variable as the parameter, instead of the equation:
  38.  
  39.  
  40.          Variable$ = RTRIM$(Variable$)
  41.          PutStX Handle%, Variable$
  42.  
  43.  
  44.       The same holds true for constants and literal values.  You
  45.       must assign them to a variable and then pass the variable.
  46.  
  47.  
  48.  
  49.  
  50.     TROUBLE #2:
  51.  
  52.       You have opened a very large number of files and when you try
  53.       to close a file, you get an error number 4: no more handles
  54.       available.
  55.  
  56.  
  57.     TO SOLVE IT:
  58.  
  59.       It may seem strange at first, but MAXFiles must open a disk
  60.       file in order to close an EMS file.  If there are no unused
  61.       DOS file handles when you try to close an EMS file (or clip
  62.       it, or flush it) you will trigger an error.  
  63.       
  64.       You must always leave at least one file handle unused by your
  65.       program.  There are no exceptions to this rule.
  66.  
  67.  
  68.  
  69.  
  70.     TROUBLE #3:
  71.  
  72.       You have EMS memory but MAXLIB For PB won't use it.
  73.  
  74.     TO SOLVE IT:
  75.  
  76.       Make sure you have called InitMAXFiles or InitMAXArray, as
  77.       needed.
  78.  
  79.       Make sure you have used PBINST to change the default EMS usage
  80.       in PB.EXE to something other than "ALL".  Depending on your
  81.       EMM driver, you may also need to set XMS usage to something
  82.       other than "ALL". For instance, this is true for EMM386.SYS.
  83.  
  84.       If you have been single-stepping through your code to debug it
  85.       and have been aborting your program before it runs to
  86.       completion, MAXLIB won't have a chance to automatically
  87.       deallocate the EMS memory it has allocated.  Eventually, you
  88.       will run out of EMS memory.  To regain this memory you must
  89.       reboot, so that the EMM driver will be reinitialized.
  90.  
  91.       If you have an EMM driver numbered prior to version 4.0,
  92.       MAXFiles won't be able to use your EMS memory.  Check your
  93.       version number.
  94.  
  95.       Lastly, if you have tampered with the copyright notice in
  96.       MAXLIB.PBL or in your program's EXE file, MAXLIB will fail to
  97.       recognize any EMS resources on your computer.
  98.  
  99.