home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / BKSHLF.ZIP / bldinfo.cmd
OS/2 REXX Batch file  |  1992-09-30  |  2KB  |  57 lines

  1. /* Load REXXUTIL */
  2. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  3. call sysloadfuncs
  4.  
  5. /* The basic call is listed next.                                          */
  6. /* result = SysCreateObject(classname, title, location, setup)             */
  7.  
  8. Say 'Constructing a folder with all books'
  9.  
  10. classname='WPFolder'
  11. title='BookShelf!'
  12. location='<WP_DESKTOP>'
  13. setup='OBJECTID=<WP_BOOKSHELF>;'
  14. Call BldObj
  15.  
  16. classname = 'WPProgram'
  17. location = '<WP_BOOKSHELF>'
  18. base_setup='PROGTYPE=PM;EXENAME=\OS2\VIEW.EXE;'
  19. /* Put bookshelf stuff */
  20. BS = VALUE('BOOKSHELF',,'OS2ENVIRONMENT');
  21. Say BS
  22. Do While (BS <> "")
  23.     Parse Var BS Path ";" BS
  24.     If (Path <> "") Then Do
  25.         Path = STRIP(Path)
  26.         If (RIGHT(Path,1) <> "\") Then
  27.             Path = Path || "\"
  28.         PrevQ = Queued()
  29.         "DIR "Path"*.INF /F | RXQUEUE"
  30.         NowQ = Queued()
  31.         Do i = NowQ to PrevQ+1 by -1
  32.             Parse Pull file .
  33.             start = LASTPOS("\", file) + 1
  34.             last = LASTPOS(".", file) - 1
  35.             len = last - start + 1
  36.             title = TRANSLATE(SUBSTR(file, start, len))
  37.             setup = base_setup || "PARAMETERS="title";"
  38.             Call BldObj
  39.         End /* do */
  40.  
  41.     End  /* Do */
  42. End /* do */
  43.  
  44. Exit
  45.  
  46. /* Build Object */
  47. BldObj:
  48. call charout ,'Building: 'title
  49.  
  50. result = SysCreateObject(classname, title, location, setup)
  51.  
  52. If result=1 Then call charout ,'...   Object created!'
  53. Else             call charout ,'...   Not created! Return code='result
  54.  
  55. Say '';
  56. Return
  57.