/* Show using REXX from command-line or within DFSee   (RUN cmd or menuitem) */
/* ~Show #partitions for a disk~~ param-1 = disknr~    (for RUN param-popup) */

   Parse Source with . myself .
   Parse arg disknr .

   if Address() <> 'DFS' then
   do
      Address cmd '@dfsos2.exe -R -7 -a -b -e- -w- -B- -Q run' myself disknr
      exitvalue = rc
   end; else
   do
      '@query -Q disks'
      disks = rc
      if Datatype(disknr) = 'NUM' then
      do
         if (disknr > disks) | (disknr = 0) then
         do
            disknr = disks
         end
      end; else
      do
         disk = 1
      end
      '@query -Q dt' disknr
      parts = rc
      say 'There are' disks 'disks and disk number' disknr 'has' parts 'partitions'
      exitvalue = parts
   end
exit exitvalue
