home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / macro28.lha / Macro / Misc / config.ged < prev    next >
Encoding:
Text File  |  1995-02-06  |  1.3 KB  |  55 lines

  1. /* $VER: 1.0, ©'95 Dietmar Eilert. Load config depending on file suffix */
  2.  
  3. OPTIONS RESULTS                             /* enable return codes     */
  4.  
  5. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.     address 'GOLDED.1'
  7.  
  8. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  9. OPTIONS FAILAT 6                            /* ignore warnings         */
  10. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  11.  
  12. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  13.  
  14. 'QUERY CAT'
  15.  
  16. if (result = "deutsch") then
  17.     'REQUEST FILE TITLE="Laden..." VAR=FILE'
  18. else
  19.     'REQUEST FILE TITLE="Load..." VAR=FILE'
  20.  
  21. if (RC = 0) then do
  22.  
  23.     'OPEN SMART NAME="' || FILE || '"'
  24.  
  25.     dot = INDEX(FILE, ".")
  26.  
  27.     if (dot > 0) then do
  28.  
  29.         suffix = UPPER(RIGHT(FILE, LENGTH(FILE) - dot))
  30.         config = ""
  31.  
  32.         /* ----- insert your config files here ----- */
  33.  
  34.         if (suffix = "C") then
  35.             config = "golded:config/c.prefs"
  36.  
  37.         */ ----------------------------------------- */
  38.  
  39.         if (config ~= "") then
  40.             'PREFS LOAD SMART CONFIG="' || config || '"'
  41.     end
  42. end
  43.  
  44. /* ---------------------------- END OF YOUR CODE --------------------- */
  45.  
  46. 'UNLOCK' /* VERY important: unlock GUI */
  47. EXIT
  48.  
  49. SYNTAX:
  50.  
  51. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  52. 'UNLOCK'
  53. EXIT
  54.  
  55.