home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vxftpsrc.zip / LOCALDIR.VRX < prev    next >
Text File  |  1995-10-05  |  963b  |  41 lines

  1. /*:VRX         Main
  2. */
  3. Main:
  4.  
  5. /* Test whether the first item is a directory or a file.
  6.     If a directory, dirList.1 gets it; otherwise, fileList.1
  7.     does. Index i is the index for dirList and index j
  8.     is the index for fileList.
  9.  */
  10.     i = 0
  11.     j = 0
  12.     File = VRDir( "*.*", "N", "D", "HS")
  13.  
  14.     do until File = ""
  15.         if (File == ".") then
  16.             do
  17.             File = VRDir( , "N" )
  18.             iterate
  19.         end
  20.         if VRIsDir(File) then
  21.             do
  22.             i = i + 1
  23.             dirList.i = File
  24.             end 
  25.         else
  26.             do
  27.             j = j + 1
  28.             fileList.j = File
  29.         end
  30.         File = VRDir( , "N" )
  31.     end /* end do forever */
  32.  
  33.     dirList.0 = i
  34.     fileList.0 = j
  35.  
  36.     call VRMethod "Application", "PutVar", "dirList."
  37.     call VRMethod "Application", "PutVar", "fileList."
  38.     call VRMethod "Application", "PostQueue", 0, 1, "call SetLocalDir"
  39. exit
  40.  
  41.