home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / MAKEOB.ZIP / MAKEOBJ.CMD next >
OS/2 REXX Batch file  |  1993-02-25  |  2KB  |  70 lines

  1. /* MakeObj.CMD                                                              */
  2. /* By: F. Paul Ballard  (716) 425-3471   Compuserve: 70514,24               */
  3. /* Date: 02/25/93                                                           */
  4.  
  5. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs';
  6. Call SysLoadFuncs;           
  7.  
  8. Arg Action ObjectFile
  9.  
  10. Select
  11.    when Action = "ADD"  then Call AddObject
  12.    when Action = "EDIT" then Call EditObject
  13.    when Action = "HIDE" then Call HideObject
  14.    when Action = "SHOW" then Call ShowObject
  15. end 
  16. exit
  17.  
  18.  
  19. AddObject:
  20.    Call GetData
  21.    ReturnCode=SysCreateObject(ClassName,Title,Location,SetupString,'FailIfExists');
  22.    if ReturnCode <> 1 then                 
  23.       Say  "Unable to Create Object."
  24.    else
  25.       Say "Object Created."
  26.    Return
  27.  
  28. EditObject:
  29.    Call GetData
  30.    ReturnCode=SysCreateObject(ClassName,Title,Location,SetupString,'ReplaceIfExists');
  31.    if ReturnCode <> 1 then                 
  32.       Say  "Unable to Edit Object."
  33.    else
  34.       Say "Object Changed."
  35.    Return
  36.  
  37. HideObject:
  38.    Call GetData
  39.    SetupString = "NOTVISIBLE=YES;"||SetupString
  40.    ReturnCode=SysCreateObject(ClassName,Title,Location,SetupString,'ReplaceIfExists');
  41.    if ReturnCode <> 1 then                 
  42.       Say  "Unable to Hide Object."
  43.    else
  44.       Say "Object Hidden."
  45.    Return
  46.  
  47. ShowObject:
  48.    Call GetData
  49.    SetupString = "NOTVISIBLE=NO;"||SetupString
  50.    ReturnCode=SysCreateObject(ClassName,Title,Location,SetupString,'ReplaceIfExists');
  51.    if ReturnCode <> 1 then                 
  52.       Say  "Unable to Show Object."
  53.    else
  54.       Say "Object Shown."
  55.    Return
  56.  
  57. GetData:   
  58.    do until Lines(ObjectFile) = 0
  59.       DataLine = LineIn(ObjectFile)
  60.       Parse var DataLine KeyName ":" Indicator
  61.       Select
  62.          when KeyName = "CLASSNAME" then ClassName = Indicator
  63.          when KeyName = "TITLE"     then Title = Indicator
  64.          when KeyName = "LOCATION"  then Location = Indicator
  65.          when KeyName = "SETUP"     then SetupString = Indicator
  66.          otherwise Say "Invalid Option In File!"
  67.       end
  68.    end
  69.    Return
  70.