$! For PrintServers, the ANSI translator prologue is loaded into the printer $! boot time. Update-ansi-prologue.com installs a newer ANSI prologue into $! the resource area for the Supporting Host. $! $! This .com file should be run only once $! $! Resource files for all PrintServers are updated $! $! After this .com file runs, the PrintServer(s) must be updated for the $! ANSI prologue to updated. $! $! protect against symbol redefinitions $ set symbol /scope=(nolocal, noglobal) $ $! Define some local symbols $ say := write sys$output $ fac_code = "ANSIupdater-" $ progress = "I-Progess: " $ sh = "lps$support:" $ $ say fac_code + progress + "Installing new ANSI prologue" $ old_default = f$environment("default") $ set default 'sh' $! Get prologue number in existing ansi prologue $ open temp lps_ansi_prologue.ps $ read temp vern $ close temp $ old_pro = "version " + - f$extract(f$locate("prologue ", vern) + f$length("prologue "), 99, vern) $! Get prologue number in new ansi prologue $ open temp sys$common:[syshlp.examples.dcps]lps_ansi_prologue.ps $ read temp vern $ close temp $ new_pro = "version " + - f$extract(f$locate("prologue ", vern) + f$length("prologue "), 99, vern) $! Install new prologue $ rename /nolog lps_ansi_prologue.ps old-lps_ansi_prologue.ps $ copy /nolog sys$common:[syshlp.examples.dcps]lps_ansi_prologue.ps * $ $ say fac_code + progress + "Updating resource file(s)" $ loop: $ r_file = f$search("lpsresources.*") $ if r_file .eqs. "" then goto end_loop ! No more resource files $! For each resource file do the following: $! f$search returns more info than wanted; just keep file & type $ node = f$parse("''r_file'",,,"type","syntax_only") $ r_file = f$parse("''r_file'",,,"name","syntax_only") + node $ say fac_code + progress + "Working on " + r_file $ rename /nolog 'r_file' old-'r_file' $ open old_file old-'r_file' /read $ open new_file 'r_file' /write $ file_loop: $ read old_file line /end_of_file=close_files $! 2nd test is to fix bug in DCPS V1.1 $ if (line .eqs. old_pro) .or (line .eqs. "version V3.2-58") $ then $ write new_file new_pro $ else $ write new_file line $ endif $ goto file_loop $ close_files: $ close old_file $ close new_file $ goto loop $ end_loop: $ set default 'old_default' $ say fac_code + "I-Reminder: " - + "Reboot the PrintServers to load the new prologue" $! $! Revision History: $! 13-Mar-94, DG, This file created $! 31-Aug-94, DG, Generalized code for finding old ANSI prologue