home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 30 fixes_v / 30-fixes_v.zip / vxrxc21a.zip / BUILDCSO.CMD next >
OS/2 REXX Batch file  |  1994-10-14  |  9KB  |  307 lines

  1. /****************************************************************/
  2. /* BUILDCSO.CMD : Build VX-REXX Client/Server Objects           */
  3. /****************************************************************/
  4.  
  5. address CMD
  6. "@echo off"
  7.  
  8. call RXFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs"
  9. call SysLoadFuncs
  10.  
  11. call setlocal
  12.  
  13. say "Creating VX-REXX Client/Server Objects..."
  14.  
  15. parse arg VXRexxDir szVideoMode
  16. if (VXRexxDir = "/?") then do
  17.    call Usage
  18. end
  19.  
  20. if (szVideoMode \= "1024x768" & szVideoMode \= "800x600" & szVideoMode \= "640x480") then do
  21.    szVideoMode = "640x480"
  22. end
  23.  
  24. if (VXRexxDir = "") then do
  25.    VXRexxDir = directory();
  26. end
  27. else do
  28.    if (lastpos("\",VXRexxDir) = length(VXRexxDir)) then do
  29.       VXRexxDir = left(VXRexxDir, length(VXRexxDir) -1)
  30.    end
  31. end
  32.  
  33. VXRexxDir = directory(VXRexxDir)
  34.  
  35. bldDemo = 0
  36. if( FileExists( VXRexxDir || '\tutbook.inf' ) )then do
  37.     bldDemo = 1
  38. end
  39.  
  40. x = 5;
  41. if (szVideoMode = "1024x768") then do
  42.    y = 45;
  43.    nDeltaY = -10;
  44.    nDeltaX = 13;
  45. end
  46. if (szVideoMode = "640x480") then do
  47.    y = 60;
  48.    nDeltaY = -15;
  49.    nDeltaX = 15;
  50. end
  51. if (szVideoMode = "800x600") then do
  52.    y = 60
  53.    nDeltaY = -15;
  54.    nDeltaX = 15;
  55. end
  56.  
  57. /* Create README program object */
  58.  
  59. x = 5;
  60. y = y + 3 * nDeltaY;
  61. className = "WPProgram"
  62. title     = "Client/Server" || "0A"x || "Read Me First"
  63. location  = "<VXREXX_FOLDER>"
  64. setup     = "EXENAME=view.exe;" ||,
  65.             "PROGTYPE=PM;" ||,
  66.             "PARAMETERS=" || VXRexxDir || "\README2.INF;" ||,
  67.             "ICONPOS=" x || "," || y || ";" ||,
  68.             "STARTUPDIR=" || VXRexxDir || ";"
  69.  
  70. call SysCreateObject classname, title, location, setup, 'r'
  71.  
  72. /* Create "Database Object User's Guide" object in VX-REXX Folder */
  73.  
  74. x = x + nDeltaX;
  75. className = "WPProgram"
  76. title     = "Database Objects" || "0A"x || "Reference"
  77. location  = "<VXREXX_FOLDER>"
  78. params    = "EXENAME=view.exe;" ||,
  79.             "PROGTYPE=PM;" ||,
  80.             "PARAMETERS=" || VXRexxDir || "\VRDB.INF;" ||,
  81.             "ICONPOS=" x || "," || y || ";" ||,
  82.             "STARTUPDIR=" || VXRexxDir || ";"
  83.  
  84. call SysCreateObject className, title, location, params, "r"
  85.  
  86. /* Create "Chart Object User's Guide" object in VX-REXX Folder */
  87.  
  88. x = x + nDeltaX;
  89. className = "WPProgram"
  90. title     = "Chart Object" || "0A"x || "Reference"
  91. location  = "<VXREXX_FOLDER>"
  92. params    = "EXENAME=view.exe;" ||,
  93.             "PROGTYPE=PM;" ||,
  94.             "PARAMETERS=" || VXRexxDir || '\VRCHT.INF;' ||,
  95.             "ICONPOS=" x || "," || y || ";" ||,
  96.             "STARTUPDIR=" || VXRexxDir || ";"
  97.  
  98. call SysCreateObject className, title, location, params, "r"
  99.  
  100.  
  101. /* Create "Database Administrator" object in VX-REXX Folder */
  102.  
  103. x = 5;
  104. y = y + nDeltaY;
  105. className = "WPProgram"
  106. title     = "Database" || "0A"x || "Administrator"
  107. location  = "<VXREXX_FOLDER>"
  108. params    = "EXENAME=" || VXRexxDir || "\DBADMIN.EXE;" ||,
  109.             "PROGTYPE=PM;" ||,
  110.             "ICONPOS=" x || "," || y || ";" ||,
  111.             "STARTUPDIR=" || VXRexxDir ";"
  112.  
  113. call SysCreateObject className, title, location, params, "r"
  114.  
  115. /* Create "Database Samples" folder in VX-REXX Folder */
  116.  
  117. x = x + nDeltaX;
  118. className = "WPFolder"
  119. title     = "Database Samples"
  120. location  = "<VXREXX_FOLDER>"
  121. params    = "ICONPOS=" x || "," || y || ";" ||,
  122.             "OBJECTID=<DATABASE_SAMPLES>;"
  123.  
  124. call SysCreateObject className, title, location, params, "r"
  125.  
  126. /* Create Database Samples Source Folder */
  127.  
  128. className = "WPFolder"
  129. title     = "Source"
  130. location  = "<DATABASE_SAMPLES>"
  131. params    = "OBJECTID=<DATABASE_SOURCE>;"
  132.  
  133. call SysCreateObject className, title, location, params, "r"
  134.  
  135. /* Create "Chart Samples" folder in VX-REXX Folder */
  136.  
  137. x = x + nDeltaX;
  138. className = "WPFolder"
  139. title     = "Chart Samples"
  140. location  = "<VXREXX_FOLDER>"
  141. params    = "ICONPOS=" x || "," || y || ";" ||,
  142.             "OBJECTID=<CHART_SAMPLES>;"
  143.  
  144. call SysCreateObject className, title, location, params, "r"
  145.  
  146. /* Create Chart Samples Source Folder */
  147.  
  148. className = "WPFolder"
  149. title     = "Source"
  150. location  = "<CHART_SAMPLES>"
  151. params    = "OBJECTID=<CHART_SOURCE>"
  152.  
  153. call SysCreateObject className, title, location, params, "r"
  154.  
  155. /* Create source folder under database samples*/
  156.  
  157. className = "WPFolder"
  158. title     = "Source"
  159. location  = "<DATABASE_SAMPLES>"
  160. params    = "OBJECTID=<DATABASE_SOURCE>;"
  161.  
  162. call SysCreateObject className, title, location, params, "r"
  163.  
  164. /* Create source folder under chart samples*/
  165.  
  166. className = "WPFolder"
  167. title     = "Source"
  168. location  = "<CHART_SAMPLES>"
  169. params    = "OBJECTID=<CHART_SOURCE>;"
  170.  
  171. call SysCreateObject className, title, location, params, "r"
  172.  
  173.  
  174. if( bldDemo = 0 )then do
  175.  
  176.     /* Create IPFC book objects */
  177.     
  178.     x = 5;
  179.     y = y + nDeltaY;
  180.     
  181.     className = "WPProgram"
  182.     title     = "Information Presentation" || "0A"x || "Facility Help"
  183.     location  = "<VXREXX_FOLDER>"
  184.     params    = "EXENAME=view.exe;" ||,
  185.                 "PROGTYPE=PM;" ||,
  186.                 "PARAMETERS=" || VXRexxDir || "\IPFC20.INF;" ||,
  187.                 "ICONPOS=" || x || "," || y || ";" ||,
  188.                 "STARTUPDIR=" || VXRexxDir || ";"
  189.                 
  190.     call SysCreateObject className, title, location, params, "r"
  191.     
  192.     x = x + nDeltaX;
  193.     
  194.     className = "WPProgram"
  195.     title     = "IPFC Compiled" || "0A"x || "Examples Help"
  196.     location  = "<VXREXX_FOLDER>"
  197.     params    = "EXENAME=view.exe;" ||,
  198.                 "PROGTYPE=PM;" ||,
  199.                 "PARAMETERS=" || VXRexxDir || "\IPFCEXMP.INF;" ||,
  200.                 "ICONPOS=" || x || "," || y || ";" ||,
  201.                 "STARTUPDIR=" || VXRexxDir || ";"
  202.                 
  203.     call SysCreateObject className, title, location, params, "r"            
  204. end
  205.  
  206. /* if (szVideoMode = "1024x768") then do
  207.    y = 40 + 3 * nDeltaY;
  208. end
  209. if (szVideoMode = "640x480") then do
  210.    y = 50 + 3 * nDeltaY;
  211. end
  212. if (szVideoMode = "800x600") then do
  213.    y = 50 + 3 * nDeltaY;
  214. end */
  215.  
  216.  
  217. call AddSample "Titles", "Chart Titles"      , "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  218. call AddSample "Rowcol", "Row and Column"    , "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  219. call AddSample "Rmouse", "Mouse Example"     , "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  220. call AddSample "Printcht","Print Chart"      , "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  221. call AddSample "Miniclik","Simple Click"     , "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  222. call AddSample "Groups","Group Options"      , "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  223. call AddSample "Drill","Drill Down"          , "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  224. call AddSample "Data","Data"                 , "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  225. call AddSample "Click","Click"               , "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  226. call AddSample "Bound1","Database Charting 1", "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  227. call AddSample "Bound2","Database Charting 2", "<CHART_SAMPLES>", "CHTSAMP", "<CHART_SOURCE>"
  228.  
  229. call AddSample "master","Master/Detail","<DATABASE_SAMPLES>", "DBSAMPLE", "<DATABASE_SOURCE>"
  230. call AddSample "starter","Getting Started","<DATABASE_SAMPLES>","DBSAMPLE", "<DATABASE_SOURCE>"
  231. call AddSample "wsample","Sample Database"||"0A"x||"Generator","<DATABASE_SAMPLES>","DBSAMPLE", "<DATABASE_SOURCE>"
  232. call AddSample "orderapp","Order Entry Application","<DATABASE_SAMPLES>","DBSAMPLE", "<DATABASE_SOURCE>"
  233.  
  234. exit;
  235.  
  236.  
  237. /* AddSample: Arguments - 1) Directory Name
  238.                           2) Long Name
  239.                           3) Location
  240.                           4) Sample Directory
  241.                           5) Source Folder Location */
  242.  
  243. AddSample: procedure expose VXRexxDir
  244. /*********
  245.     Parms:  1   directory name
  246.             2   long name
  247.             3   location
  248.             4   sample directory
  249.  
  250. */
  251.  
  252.    target_dir = VXRexxDir
  253.  
  254.  
  255.    szDirName = arg(1)
  256.    szLongName = arg(2)
  257.    szLocation = arg(3)
  258.    szSampleDir = arg(4)
  259.    szSourceLocation = arg(5)
  260.  
  261.    szStartUp = target_dir || "\" || szSampleDir || "\" || szDirName;
  262.  
  263.    szExeName = szDirName || ".EXE";
  264.    szIcoName = szDirName || ".ICO";
  265.    szVRPName = szDirName || ".VRP";
  266.  
  267. /* Create shadow of the sample directory under the source folder */
  268.  
  269.    classname = "WPShadow"
  270.    title     = szLongName
  271.    location  = szSourceLocation
  272.    setup     = "SHADOWID=" || szStartUp || ";"
  273.    call SysCreateObject classname, title, location, setup, 'r'
  274.  
  275. /* Do not create a program reference to chart edit sample */
  276.  
  277.    if (szDirName = "Chtedit") then do
  278.       return
  279.    end
  280.  
  281. /* Create the executable icon */
  282.  
  283.    classname = "WPProgram"
  284.    title = szLongName
  285.    location = szLocation
  286.    setup = "EXENAME=" || szStartUp || "\" || szExeName || ";PROGTYPE=PM;ICONFILE=" || szStartUp || "\" || szIcoName || ";STARTUPDIR=" || szStartUp || ";"
  287.    call SysCreateObject classname, title, location, setup, 'r'
  288.  
  289. return
  290.  
  291. /*
  292.  * FileExists
  293.  */
  294.     
  295. FileExists:
  296.     return( stream( arg(1), 'c', 'query exists' ) <> '' )
  297.     
  298.     
  299. Usage:
  300. say 'BUILDCSK.CMD : Builds VX-REXX Client/Server objects'
  301. say ''
  302. say 'USAGE:  BUILDVRX [path] [resolution]'
  303. say 'Where [path]       = VX-REXX Directory'
  304. say '      [resolution] = 640x480, 800x600, 1024x768 (default=640x480)'
  305. say''
  306. exit
  307.