Code:
$if 0

    Unit: QFILES1.PBL
   Zweck: Ermitteln der FILES= Einstellung (CONFIG.SYS) mit undok. DOS-Funkt.
   Stand: 12.09.95
 Version: 1.00
   Autor: M.Hoffmann
 Sprache: PowerBASIC 3.x
Benötigt: DOS 3+ (wird NICHT überprüft)
Historie:

$endif

$com      0
$compile  unit
$cpu      80386
$debug    map-,pbdebug-,path-,unit-
$dim      all
$error    bounds-,numeric-,overflow-,stack-
$event    off
$float    emulate
$lib      com-,lpt-,cga-,ega-,vga-,fullfloat-,iprint-
$optimize size
$option   cntlbreak-,gosub-,signed-
$sound    0
$stack    &h800
$static
$string   1

defint a-z

%flags = 0
%ax    = 1
%bx    = 2

function QFileHandles public as integer

   dim i as local integer

   for i=1 to 255
      reg %ax,&h1216
      reg %bx,i
      call interrupt &h2f
      if (reg(%flags) and 1) = 1 then
         QFileHandles = i ' Zählung fängt bei 0 an, daher kein DECR
         exit function
      end if
   next

end function
------------------