/****************************************************************/ /* Reset the position of the SETUP.EXE windows */ /* */ /* Author: Peter Moylan (peter@pmoylan.org) */ /* Started: 21 September 2000 */ /* Last revised: 16 November 2020 */ /* */ /* Usage: */ /* resetpos */ /* */ /* You can use this when one or more of the windows */ /* belonging to SETUP.EXE has moved off-screen. This */ /* script will move the windows to the bottom left of */ /* screen. You can then run SETUP.EXE and move the */ /* windows to where you really need them. */ /* */ /* Installation: */ /* Put this file in the directory containing SETUP.INI */ /* or SETUP.TNI (this is normally the Weasel main */ /* directory). Alternatively, invoke this script with */ /* */ /* tools\resetpos */ /* */ /****************************************************************/ CALL RxFuncAdd SysLoadFuncs, rexxutil, sysloadfuncs CALL SysLoadFuncs CALL CheckPrerequisites SelectTNI INI_get INI_put IF SelectTNI("Setup") > 0 THEN INIfile = "Setup.TNI" ELSE INIfile = "Setup.INI" SAY "Using "INIfile Nul = D2C(0) Null8 = Nul||Nul||Nul||Nul||Nul||Nul||Nul||Nul list = INI_get(INIFile, 'WindowPos') DO WHILE (list \= '') & (LEFT(list,1) \= '00'X) PARSE VAR list thiswin '00'X list CALL INI_put INIFile, 'WindowPos', thiswin, Null8 END SAY "The window positions have been reset" SAY "You may now run SETUP.EXE" EXIT 0 /****************************************************************/ /* CHECKING PREREQUISITES */ /****************************************************************/ CheckPrerequisites: PROCEDURE /* The argument is a space-separated list of prerequisite */ /* functions, for example */ /* CALL CheckPrerequisites rxu SelectTNI INI_get */ /* where (at least in this version) each list item is */ /* either 'rxu' or a function from my TNItools package. */ /* If any is missing then we exit with an error message. */ PARSE UPPER ARG funclist funclist = STRIP(funclist) needrxu = 0 needtools = 0 DO WHILE funclist \= '' PARSE VAR funclist func funclist funclist = STRIP(funclist) IF func = 'RXU' THEN DO /* Initialise RXU if not already available, fail if */ /* the RxFuncAdd operation fails. We must */ /* RxFuncQuery RxuTerm because RxuTerm does not */ /* deregister RxuInit. The RxFuncDrop is needed */ /* because RxFuncAdd seems to report failure if the */ /* function is already registered. */ IF RxFuncQuery('RxuTerm') THEN DO CALL RxFuncDrop('RxuInit') CALL RxFuncAdd 'RxuInit','RXU','RxuInit' IF result THEN DO SAY 'Cannot load RXU' needrxu = 1 END ELSE CALL RxuInit END END ELSE DO func = func||'.CMD' IF SysSearchPath('PATH', func) = '' THEN DO SAY 'ERROR: 'func' must be in your PATH' needtools = 1 END END END IF needrxu THEN SAY 'You can find RXU1a.zip at Hobbes' IF needtools THEN SAY 'Please install the GenINI package' IF needrxu | needtools THEN EXIT 1 RETURN /****************************************************************/