/* $Revision Header built automatically *************** (do not edit) ************ ** ** © Copyright by SA Productions ** ** File : User:Prog/MyGoldEd/AutoConfig.ged ** Created on : Tirsdag, 07.02.95 13:20:12 ** Created by : Søren Berg Glasius ** Current revision : V1.0 ** ** ** Purpose ** ------- ** Script that looks at the extension of a file and load the ** matching configuration. This script is an addition to my ** GED clone. ** ** Revision V1.0 ** -------------- ** created on Tirsdag, 07.02.95 13:20:12 by Søren Berg Glasius. LogMessage : ** -*- changed on Tirsdag, 07.02.95 14:31:02 by Søren Berg Glasius. LogMessage : ** - BUG: Does not work with open new..... ** -*- changed on Tirsdag, 07.02.95 13:40:57 by Søren Berg Glasius. LogMessage : ** - This could be places either in the Config menu as an entry ** called "Load Smart" or you could place it in the Project ** menu under open, this way, every time you open a file with ** a different configuration, it will change the configuration. ** -*- created on Tirsdag, 07.02.95 13:20:12 by Søren Berg Glasius. LogMessage : ** --- Initial release --- ** *********************************************************************************/ OPTIONS RESULTS /* enable return codes */ if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */ address 'GOLDED.1' 'LOCK CURRENT' /* lock GUI, gain access */ OPTIONS FAILAT 6 /* ignore warnings */ SIGNAL ON SYNTAX /* ensure clean exit */ /* ------------------------ INSERT YOUR CODE HERE: ------------------- */ call addlib('rexxsupport.library',0,-30,0) QUERY FILE VAR F IF(LASTPOS(".",F)~=0) THEN DO EXT = SUBSTR(F,LASTPOS(".",F)+1) PRF = 'GoldED:config/' || EXT || '.prefs' IF EXISTS(PRF) THEN 'PREFS CONFIG = "'PRF'" LOAD SMART' else DO 'REQUEST BODY = "No »'PRF'« file|Load the standard configuration?" BUTTON = "_Yes|_No" VAR YN' IF(YN=1) THEN 'PREFS CONFIG = "GoldED:config/GoldED.prefs" LOAD SMART' END END /* ---------------------------- END OF YOUR CODE --------------------- */ 'UNLOCK' /* VERY important: unlock GUI */ EXIT SYNTAX: SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-(" 'UNLOCK' EXIT