// STARTUP.VDM - Startup macro for VEDIT 6.10 // // NOTES: We recommend that you NOT modify this file. If you do, you // are "on your own"; please do not ask us for assistance. // // The preferred way to customize the startup is by editing the // USTARTUP.VDM file, e.g. with custom Config() and Key_Add() // commands. You can also load different {USER} and {TOOLS} // menus this way. // // A copy of this file is supplied as STARTUP.ORG so that you // can easily refer to the original file. // // This startup macro performs these functions: // // * Performs an edit-session-restore when appropriate. // * Loads the VEDIT.CFG and VEDIT.KEY files which contain the last // saved configuration settings and keyboard layout. // * If {CONFIG, Misc, Enable USTARTUP.VDM} is enabled, loads the // USTARTUP.VDM file, which can add custom keystroke macros to the // keyboard layout, and force any desired configuration settings. // * Sets up the {USER} menu with your own custom editing functions. // * Sets up the {TOOLS} menu with the Compiler support functions. // If trial version, sets up with {Tutorial} menu instead. // * Sets up file-open auto-configuration; e.g. syntax highlighting. // * Any desired startup commands can be added to this file. // // Windows: See the on-line help topics "STARTUP.VDM File", "Color // Syntax Highlighting", "Template Editing", "{USER} Menu" // and "Configuration" for more information about this file. // // DOS: See the on-line help topics "STARTUP", "SYNHI", "USER" and // "CONFIGURATION" for more information about STARTUP.VDM. // //------- Possibly perform Edit Session Restore ------------------------------ // // The following code performs an edit-session-restore when appropriate. // If the edit-session-restore is performed, there is no need to process // the VEDIT.CFG, VEDIT.KEY files, load the {USER} and {TOOLS} menus, or // load the file-open event macro. // #118 = 0 //Reset flag that edit-session-restore performed if (!IsQuiet) { if (!Is_Option(e) && !Is_Option(x) && Reg_Size(121)==0) { #118 = Reg_Load(118,"veditsav.env",USERCFGDIR+NOERR) Call(118) } if ( FDEL("veditsav.env",OK+NOERR) ) { FDEL("veditsav.dat",OK+NOERR) } else { FDEL("|(USERCFG)/veditsav.env",OK+NOERR) FDEL("|(USERCFG)/veditsav.dat",OK+NOERR) } if (#118>1000) { Goto ADDITIONAL } //Skip down if restore was performed } // //------- Load the VEDIT.CFG and VEDIT.KEY files unless "-g" invocation. // if ( !Is_Option(g) ) { //Unless "-g" invocation... Config_Load("vedit.cfg",SUPPRESS+NOERR) //Load VEDIT.CFG file Key_Load("vedit.key",NOERR) //Load VEDIT.KEY file } // //------- Initialize {USER} and {TOOLS} menu names and files ----------------- // // Set the default files and names for the {USER} and {TOOLS} menus. // The USTARTUP.VDM file, if enabled, can override them. // Reg_Set(103,"user.mnu") // Default file for {USER} menu Reg_Set(104,"&User") // Default name for {USER} menu Reg_Set(105,"tools.mnu") // Default file for {TOOLS} menu, when // Config(U_TOOLS_MENU) = "4" Reg_Set(106,"&Tools") // Default name for {TOOLS} menu // //------- If {CONFIG, Misc, Enable USTARTUP.VDM}, process USTARTUP.VDM ------- // // The USTARTUP.VDM file is typically used to setup additional // keystroke macros and force some configuration settings. // Any settings in USTARTUP.VDM will override those setting from // the VEDIT.KEY and VEDIT.CFG file. Follow these steps: // // 1. If you do not already have a USTARTUP.VDM file, copy the supplied // USTARTUP.ORG to USTARTUP.VDM in the User Config Directory. // 2. Modify USTARTUP.VDM as desired; see instructions within the file. // 3. Enable {CONFIG, Misc, Enable USTARTUP.VDM startup file}. // // Note: Installing a VEDIT update will install a new USTARTUP.ORG into the // VEDIT Home Directory. However, it will not change any existing // USTARTUP.VDM file; this preserves your custom keystroke macros // and configuration. // if ( Config(U_E_USTARTUP) ) { Call_File(107,"|(USERCFG)/ustartup.vdm",NOERR) Reg_Empty(107) } // //------- Load the {USER} menu ----------------------------------------------- // // Add the {USER} menu to the main menu by loading the file USER.MNU. // By default, USER.MNU contains some of the macros listed in Appendix E // (Application Notes). You can place your own custom editing functions // in the {USER} menu by modifying the USER.MNU file or by loading a // different file. See the on-line help topic "{USER} and {TOOLS} menus". // if ( File_Exist("|(USER_MACRO)\|@(103)",NOERR) ) { Reg_Load(124,"|(USER_MACRO)\|@(103)",NOERR) } else { Reg_Load(124,@(103),EXTRA+NOERR) } Config_String(USER_MENU,@(104)) // //------- Load the {TOOLS} menu ---------------------------------------------- // // Add a {TOOLS} menu depending upon the setting of {CONFIG, Misc, // {TOOLS} menu}: // // 0 Do not load any {TOOLS} menu. // 1 (Default) Load the Compiler support menu from COMPILE.MNU. // However, if VEDIT is running as a trial version, instead load // the {TUTOR} menu from TUTOR.MNU. // 2 Load the Compiler support menu from COMPILE.MNU. // 3 Load the Java support menu from JAVA.MNU. // 4 Load a user defined {TOOLS} menu from TOOLS.MNU. // #120 = Config(U_TOOLS_MENU) if (#120==1) { if (Is_TV) { if (OS_Type==1) { Reg_Load(123,"|(HOME)\tutor\tutorw.mnu",EXTRA+NOERR) if (AppWidth>640) { Config_String(TOOL_MENU,"&Tutorial") } else { Config_String(TOOL_MENU,"&Tutor") } } else { Reg_Load(123,"tutor.mnu",EXTRA+NOERR) } } else { #120 = 2 } } if (#120==2 || #120==3) { Call_File(Reg_Free,"compile.vdm",NOERR) Config_String(TOOL_MENU,"&Tools") } if (#120==4) { Reg_Load(123,@(105),EXTRA+NOERR) //Load a custom tools.mnu Config_String(TOOL_MENU,@(106)) //Give it the desired name } //See USTARTUP.VDM for details Reg_Empty(103) //Empty the temporary used registers Reg_Empty(104) Reg_Empty(105) Reg_Empty(106) // //------- File-open auto-configuration ---------------------------------------- // // The "File-Open configuration" macro in T-Reg 115 is used to set // configuration parameters according to the filename extension // (file-type) or specific filename of each file opened. // It must be enabled with {CONFIG, File-open config, Enable file-open // configuration}. // // Note: The file-open configuration is not performed if you open one of // the configuration files in the \FILE-CFG directory. // // The following two commands ensure that template editing and syntax // highlighting are OFF by default. They should only be enabled by the // file-open configuration files. // Config(PG_E_TEMPLAT,0) // Default is template editing disabled Config(PG_E_SYNTAX,0) // Default is syntax highlighting disabled Reg_Set(115,`//File-Open configuration macro //Config(PG_E_TEMPLAT,0) //Config(PG_E_SYNTAX,0) Reg_Set(120,FILE_CFG) if ( Reg_Compare(120,PATHONLY) ) { if (Is_Longfilename) { if ( #120 = File_Exist("|(FILE_CFG)\|(File_Name).cfn",NOERR) ) { Config_Load("|(FILE_CFG)\|(File_Name).cfn") } } else { if ( #120 = File_Exist("|(FILE_CFG)\|(File_Name)",NOERR) ) { Config_Load("|(FILE_CFG)\|(File_Name)") } } if ( #120==0 ) { Reg_Set(120,Ext_Only) if ( Reg_Compare(120,"con")==0 ) { if ( File_Exist("|(FILE_CFG)\concon.cft",NOERR) ) { Config_Load("|(FILE_CFG)\concon.cft") } } else { if ( Reg_Compare(120,"prn")==0 ) { if ( File_Exist("|(FILE_CFG)\prnprn.cft",NOERR) ) { Config_Load("|(FILE_CFG)\prnprn.cft") } } else { if ( Reg_Compare(120,"aux")==0 ) { if ( File_Exist("|(FILE_CFG)\auxaux.cft",NOERR) ) { Config_Load("|(FILE_CFG)\auxaux.cft") } } else { if ( File_Exist("|(FILE_CFG)\|(Ext_Only).cft",NOERR) ) { Config_Load("|(FILE_CFG)\|(Ext_Only).cft") } if ( File_Exist("|(FILE_CFG)\|(Ext_Only).cfx",NOERR) ) { //### Call_File(Reg_Free, "|(FILE_CFG)\|(Ext_Only).cfx") //### } //### }}} } } `) //End of the Reg_Set(115,... command above // //------- Any additional startup commands can be placed here ------------------ // :ADDITIONAL: // // DON'T PUT ANY COMMANDS AFTER Reg_Empty() BECAUSE THEY WON'T BE EXECUTED !! // Reg_Empty(Macro_Num,EXTRA) // Empty this macro (Must be last command!)