home *** CD-ROM | disk | FTP | other *** search
/ The American Heritage Talking Dictionary / AHD361VOICE.bin / windows / instalah.smm < prev    next >
INI File  |  1994-08-30  |  20KB  |  1,498 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     Olivetti JP 350
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     Install The American Heritage Dictionary to Tools menu
  19.     
  20.     
  21.     
  22.     
  23.     741632143
  24.     21
  25.     735410161
  26.     316
  27.     6
  28.     0
  29.     0
  30.     0
  31.     0
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     1
  39. [fopts]
  40.     0
  41.     1
  42.     0
  43.     0
  44. [lnopts]
  45.     2
  46.     Body Text
  47.     1
  48. [docopts]
  49.     5
  50.     2
  51. [GramStyle]
  52.     
  53. [tag]
  54.     Body Text
  55.     2
  56.     [fnt]
  57.         Times New Roman
  58.         240
  59.         0
  60.         49152
  61.     [algn]
  62.         1
  63.         1
  64.         0
  65.         0
  66.         0
  67.     [spc]
  68.         33
  69.         273
  70.         1
  71.         0
  72.         0
  73.         1
  74.         100
  75.     [brk]
  76.         4
  77.     [line]
  78.         8
  79.         0
  80.         1
  81.         0
  82.         1
  83.         1
  84.         1
  85.         10
  86.         10
  87.         1
  88.     [spec]
  89.         0
  90.         0
  91.         
  92.         0
  93.         1
  94.         1
  95.         0
  96.         0
  97.         0
  98.         0
  99.     [nfmt]
  100.         280
  101.         1
  102.         2
  103.         .
  104.         ,
  105.         $
  106.     Body Text
  107.     0
  108.     0
  109. [tag]
  110.     Body Single
  111.     3
  112.     [fnt]
  113.         Times New Roman
  114.         240
  115.         0
  116.         49152
  117.     [algn]
  118.         1
  119.         1
  120.         0
  121.         0
  122.         0
  123.     [spc]
  124.         33
  125.         273
  126.         1
  127.         0
  128.         0
  129.         1
  130.         100
  131.     [brk]
  132.         4
  133.     [line]
  134.         8
  135.         0
  136.         1
  137.         0
  138.         1
  139.         1
  140.         1
  141.         10
  142.         10
  143.         1
  144.     [spec]
  145.         0
  146.         0
  147.         
  148.         0
  149.         1
  150.         1
  151.         0
  152.         0
  153.         0
  154.         0
  155.     [nfmt]
  156.         280
  157.         1
  158.         2
  159.         .
  160.         ,
  161.         $
  162.     Body Single
  163.     0
  164.     0
  165. [tag]
  166.     Bullet
  167.     4
  168.     [fnt]
  169.         Times New Roman
  170.         240
  171.         0
  172.         49152
  173.     [algn]
  174.         1
  175.         1
  176.         0
  177.         288
  178.         288
  179.     [spc]
  180.         33
  181.         273
  182.         1
  183.         0
  184.         0
  185.         1
  186.         100
  187.     [brk]
  188.         4
  189.     [line]
  190.         8
  191.         0
  192.         1
  193.         0
  194.         1
  195.         1
  196.         1
  197.         10
  198.         10
  199.         1
  200.     [spec]
  201.         0
  202.         0
  203.         <*0>
  204.         360
  205.         1
  206.         1
  207.         0
  208.         0
  209.         0
  210.         0
  211.     [nfmt]
  212.         272
  213.         1
  214.         2
  215.         .
  216.         ,
  217.         $
  218.     Bullet
  219.     0
  220.     0
  221. [tag]
  222.     Bullet 1
  223.     5
  224.     [fnt]
  225.         Times New Roman
  226.         240
  227.         0
  228.         49152
  229.     [algn]
  230.         1
  231.         1
  232.         288
  233.         288
  234.         288
  235.     [spc]
  236.         33
  237.         273
  238.         1
  239.         0
  240.         0
  241.         1
  242.         100
  243.     [brk]
  244.         4
  245.     [line]
  246.         8
  247.         0
  248.         1
  249.         0
  250.         1
  251.         1
  252.         1
  253.         10
  254.         10
  255.         1
  256.     [spec]
  257.         0
  258.         0
  259.         <*5>
  260.         0
  261.         1
  262.         1
  263.         0
  264.         0
  265.         0
  266.         0
  267.     [nfmt]
  268.         280
  269.         1
  270.         2
  271.         .
  272.         ,
  273.         $
  274.     Bullet 1
  275.     0
  276.     0
  277. [tag]
  278.     Number List
  279.     6
  280.     [fnt]
  281.         Times New Roman
  282.         240
  283.         0
  284.         49152
  285.     [algn]
  286.         1
  287.         1
  288.         360
  289.         360
  290.         360
  291.     [spc]
  292.         33
  293.         273
  294.         1
  295.         0
  296.         0
  297.         1
  298.         100
  299.     [brk]
  300.         4
  301.     [line]
  302.         8
  303.         0
  304.         1
  305.         0
  306.         1
  307.         1
  308.         1
  309.         10
  310.         10
  311.         1
  312.     [spec]
  313.         0
  314.         0
  315.         <*:>.
  316.         360
  317.         1
  318.         1
  319.         0
  320.         0
  321.         0
  322.         0
  323.     [nfmt]
  324.         272
  325.         1
  326.         2
  327.         .
  328.         ,
  329.         $
  330.     Number List
  331.     0
  332.     0
  333. [tag]
  334.     Subhead
  335.     7
  336.     [fnt]
  337.         Times New Roman
  338.         240
  339.         0
  340.         49155
  341.     [algn]
  342.         1
  343.         1
  344.         0
  345.         0
  346.         0
  347.     [spc]
  348.         33
  349.         273
  350.         1
  351.         72
  352.         72
  353.         1
  354.         100
  355.     [brk]
  356.         4
  357.     [line]
  358.         8
  359.         0
  360.         1
  361.         0
  362.         1
  363.         1
  364.         1
  365.         10
  366.         10
  367.         1
  368.     [spec]
  369.         0
  370.         2
  371.         
  372.         0
  373.         1
  374.         1
  375.         0
  376.         0
  377.         0
  378.         0
  379.     [nfmt]
  380.         272
  381.         1
  382.         2
  383.         .
  384.         ,
  385.         $
  386.     Subhead
  387.     0
  388.     0
  389. [tag]
  390.     Title
  391.     8
  392.     [fnt]
  393.         Arial
  394.         360
  395.         0
  396.         16385
  397.     [algn]
  398.         4
  399.         1
  400.         0
  401.         0
  402.         0
  403.     [spc]
  404.         33
  405.         446
  406.         1
  407.         144
  408.         72
  409.         1
  410.         100
  411.     [brk]
  412.         16
  413.     [line]
  414.         8
  415.         0
  416.         1
  417.         0
  418.         1
  419.         1
  420.         1
  421.         10
  422.         10
  423.         1
  424.     [spec]
  425.         0
  426.         1
  427.         
  428.         0
  429.         1
  430.         1
  431.         0
  432.         0
  433.         0
  434.         0
  435.     [nfmt]
  436.         272
  437.         1
  438.         2
  439.         .
  440.         ,
  441.         $
  442.     Title
  443.     0
  444.     0
  445. [tag]
  446.     Header
  447.     9
  448.     [fnt]
  449.         Times New Roman
  450.         240
  451.         0
  452.         49152
  453.     [algn]
  454.         1
  455.         1
  456.         0
  457.         0
  458.         0
  459.     [spc]
  460.         33
  461.         273
  462.         1
  463.         0
  464.         0
  465.         1
  466.         100
  467.     [brk]
  468.         4
  469.     [line]
  470.         8
  471.         0
  472.         1
  473.         0
  474.         1
  475.         1
  476.         1
  477.         10
  478.         10
  479.         1
  480.     [spec]
  481.         0
  482.         0
  483.         
  484.         0
  485.         1
  486.         1
  487.         0
  488.         0
  489.         0
  490.         0
  491.     [nfmt]
  492.         280
  493.         1
  494.         2
  495.         .
  496.         ,
  497.         $
  498.     Header
  499.     0
  500.     0
  501. [tag]
  502.     Footer
  503.     11
  504.     [fnt]
  505.         Times New Roman
  506.         240
  507.         0
  508.         49152
  509.     [algn]
  510.         1
  511.         1
  512.         0
  513.         0
  514.         0
  515.     [spc]
  516.         33
  517.         273
  518.         1
  519.         0
  520.         0
  521.         1
  522.         100
  523.     [brk]
  524.         4
  525.     [line]
  526.         8
  527.         0
  528.         1
  529.         0
  530.         1
  531.         1
  532.         1
  533.         10
  534.         10
  535.         1
  536.     [spec]
  537.         0
  538.         0
  539.         
  540.         0
  541.         1
  542.         1
  543.         0
  544.         0
  545.         0
  546.         0
  547.     [nfmt]
  548.         280
  549.         1
  550.         2
  551.         .
  552.         ,
  553.         $
  554.     Footer
  555.     0
  556.     0
  557. [lay]
  558.     Standard
  559.     513
  560.     [rght]
  561.         15840
  562.         12240
  563.         1
  564.         1440
  565.         1440
  566.         1
  567.         1440
  568.         1440
  569.         0
  570.         1
  571.         0
  572.         1
  573.         0
  574.         2
  575.         1
  576.         1440
  577.         10800
  578.         12
  579.         1
  580.         720
  581.         1
  582.         1440
  583.         1
  584.         2160
  585.         1
  586.         2880
  587.         1
  588.         3600
  589.         1
  590.         4320
  591.         1
  592.         5040
  593.         1
  594.         5760
  595.         1
  596.         6480
  597.         1
  598.         7200
  599.         1
  600.         7920
  601.         1
  602.         8640
  603.     [hrght]
  604.     [lyfrm]
  605.         1
  606.         11200
  607.         0
  608.         0
  609.         12240
  610.         1440
  611.         0
  612.         1
  613.         3
  614.         1 0 0 0 0 0 0
  615.         0
  616.         0
  617.         1
  618.     [frmlay]
  619.         1440
  620.         12240
  621.         1
  622.         1440
  623.         72
  624.         1
  625.         792
  626.         1440
  627.         0
  628.         1
  629.         0
  630.         1
  631.         1
  632.         0
  633.         1
  634.         1440
  635.         10800
  636.         2
  637.         2
  638.         4680
  639.         3
  640.         9360
  641.     [txt]
  642. >
  643.     [frght]
  644.     [lyfrm]
  645.         1
  646.         13248
  647.         0
  648.         14400
  649.         12240
  650.         15840
  651.         0
  652.         1
  653.         3
  654.         1 0 0 0 0 0 0
  655.         0
  656.         0
  657.         2
  658.     [frmlay]
  659.         15840
  660.         12240
  661.         1
  662.         1440
  663.         792
  664.         1
  665.         14472
  666.         1440
  667.         0
  668.         1
  669.         0
  670.         1
  671.         1
  672.         0
  673.         1
  674.         1440
  675.         10800
  676.         2
  677.         2
  678.         4680
  679.         3
  680.         9360
  681.     [txt]
  682. >
  683. [elay]
  684. [l1]
  685.     0
  686. [pg]
  687.     6
  688.     33 0 5 512 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  689.     77 0 7 0 0 1 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  690.     115 0 5 512 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  691.     160 0 0 0 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  692.     204 0 16 0 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  693.     232 0 0 1025 0 0 0 65535 65535 Standard    65535 0 0    0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0 0
  694. [edoc]
  695. <:#284,9360>Install American Heritage Dictionary to Tools menu at startup.
  696.  
  697. <:#284,9360>
  698.  
  699. <:#284,9360><+!>How to Install The American Heritage Dictionary for Ami Pro<-!>
  700.  
  701. <:#284,9360>
  702.  
  703. <:#568,9360>You must run this macro file in order to install The American Heritage Dictionary to your Ami Pro Tools menu.  
  704.  
  705. <:#284,9360>
  706.  
  707. <:#284,9360>Choose Tools/Macros/Playback, then select this file, INSTALAH.SMM, as the macro file to play.  
  708.  
  709. <:#284,9360>
  710.  
  711. <:#568,9360>This macro file, along with the companion macro file AHD.SMM, are located in The American Heritage Dictionary directory, which is normally C:\AHDW.
  712.  
  713. <:#284,9360>
  714.  
  715. <:#284,9360><+!>What This Macro Does<-!>
  716.  
  717. <:#284,9360>
  718.  
  719. <:#568,9360>This macro installs AHD.SMM as the macro to automatically run at program load (Tools/User Setup/Program load, or automacroload= in AMIPRO.INI).  
  720.  
  721. <:#284,9360>
  722.  
  723. <:#568,9360>If you already have a macro set to run at program load, then AHD.SMM will be called from the current auto-load macro.
  724.  
  725. <:#284,9360>
  726.  
  727. <:#568,9360><+">Note:<-">  If you are using the Ami autorun (2.0) or _autorun (3.0) macro as your auto-load macro, you may instead wish to edit AUTORUN.CFG (2.0) or AMIAUTO.CFG to add AHD.SMM.  
  728.  
  729. <:#284,9360>If you do so, be sure to copy AHD.SMM to your Ami macros directory.
  730.  
  731. <:#284,9360>
  732.  
  733. <:#284,9360><+!>If the Macro Fails<-!>
  734.  
  735. <:#284,9360>
  736.  
  737. <:#568,9360>Be sure that this file, INSTALAH.SMM, and AHD.SMM are in The American Heritage Dictionary directory.
  738.  
  739. <:#284,9360>
  740.  
  741. <:#568,9360>Check Tools/User Setup/Program load to see if you already have a macro entered and checked.  If not, enter the path and name of AHD.SMM.  
  742.  
  743. <:#284,9360>
  744.  
  745. <:#284,9360>If there is already an autoload macro assigned, you can edit it and add a call to AHD.SMM.  
  746.  
  747. <:#284,9360>
  748.  
  749. <:#852,9360>Below the first line that begins with "FUNCTION," add a line with, "CALL d:\path\AHD.SMM!AHD1()" replacing "d:\path" with the drive and directory where macro is installed.
  750.  
  751. <:#284,9360><+!>
  752.  
  753. <:#284,9360><+!>Versions Supported<-!>
  754.  
  755. <:#284,9360>
  756.  
  757. <:#852,9360>The macros for The American Heritage Dictionary support versions 2.0 and 3.0 of Ami Pro.  If future versions of Ami Pro use compatible macro syntax, then these macros should work in those versions as well.
  758.  
  759. <:p<* >>
  760.  
  761. <:#284,9360><+!>FUNCTION AHDLoad(Cmd)<-!>
  762.  
  763. <:#284,9360>DEFSTR Char;
  764.  
  765. <:#284,9360>
  766.  
  767. <:#568,9360>IF (Decide("Choose Yes to install The American Heritage Dictionary to the Ami Pro Tools menu or choose No to quit.") = 0)
  768.  
  769. <:#284,9360>    EXIT FUNCTION
  770.  
  771. <:#284,9360>ENDIF
  772.  
  773. <:#284,9360>
  774.  
  775. <:#284,9360>Ahd = "AHD.SMM"
  776.  
  777. <:#284,9360>
  778.  
  779. <:#284,9360>'Use path of INSTALAH macro to find AHD macro
  780.  
  781. <:#284,9360>AHMac = GetRunningMacroFile$()
  782.  
  783. <:#284,9360>I = LEN(AHMac)
  784.  
  785. <:#284,9360>WHILE "\" != Assign(&Char, MID$(AHMac, I, 1))
  786.  
  787. <:#284,9360>    I = I - 1
  788.  
  789. <:#284,9360>WEND
  790.  
  791. <:#284,9360>AHMac = Left$(AHMac, I)
  792.  
  793. <:#284,9360>AHMac = strcat$(AHMac, Ahd)
  794.  
  795. <:#284,9360>AHMac = LCASE$(AHMac)
  796.  
  797. <:#284,9360>'Make sure that the AHD macro exists in the specified path
  798.  
  799. <:#284,9360>IF "" = FindFirst$(AHMac, 33)    'include read-only and archive flags
  800.  
  801. <:#284,9360>    CALL AHDErr("Can't find {AHMac}.")
  802.  
  803. <:#284,9360>    EXIT FUNCTION
  804.  
  805. <:#284,9360>ENDIF 
  806.  
  807. <:#284,9360>AutoLoad = GetProfileString$("AmiPro", "automacroload", "amipro.ini")
  808.  
  809. <:#284,9360>'If there isn't currently an auto load macro or it is disabled, assign ours as the auto load macro.
  810.  
  811. <:#284,9360>'If there is already an auto load macro, call it from AHD.SMM.
  812.  
  813. <:#284,9360>IF (AutoLoad = "")
  814.  
  815. <:#284,9360>    CALL NewLoad(AHMac)
  816.  
  817. <:#284,9360>ELSEIF "0" = LEFT$(AutoLoad, 1)
  818.  
  819. <:#284,9360>    CALL NewLoad(AHMac)
  820.  
  821. <:#284,9360>ELSEIF (UCASE$(Ahd) = UCASE$(RIGHT$(AutoLoad, LEN(Ahd))))
  822.  
  823. <:#284,9360>    'CALL AHDErr("{Ahd} is already the autoload macro")
  824.  
  825. <:#284,9360>    CALL NewLoad(AHMac)    ' reinstall anyway, in case path is invalid or macro is old
  826.  
  827. <:#284,9360>    EXIT FUNCTION
  828.  
  829. <:#284,9360>ELSE
  830.  
  831. <:#284,9360>    AutoLoad = MID$(AutoLoad, 3, LEN(AutoLoad) - 2)
  832.  
  833. <:#284,9360>    FuncName = ""    'Filename may be followed by name of function to run
  834.  
  835. <:#284,9360>    I = strchr(1, AutoLoad, "!")
  836.  
  837. <:#284,9360>    IF (I <;>1)
  838.  
  839. <:#284,9360>        FuncName = MID$(AutoLoad, I + 1, LEN(AutoLoad) - I + 1)
  840.  
  841. <:#284,9360>        J = strchr(1, FuncName, "(")
  842.  
  843. <:#284,9360>        IF (J <;> 0)    ' trim parentheses from name
  844.  
  845. <:#284,9360>            FuncName = LEFT$(FuncName, J - 1)
  846.  
  847. <:#284,9360>        ENDIF
  848.  
  849. <:#284,9360>        AutoLoad = LEFT$(AutoLoad, I - 1)
  850.  
  851. <:#284,9360>    ENDIF
  852.  
  853. <:#284,9360>    CALL ModifyLoad(AHMac, AutoLoad, FuncName)
  854.  
  855. <:#284,9360>ENDIF
  856.  
  857. 'This is what AHD will look up if invoked right now
  858.  
  859. <:#284,9360>ClipboardWrite("Dictionary", 0)
  860.  
  861. <:#284,9360>
  862.  
  863. <:#284,9360><+!>END FUNCTION<-!>
  864.  
  865. <:#284,9360>
  866.  
  867. <:#284,9360>
  868.  
  869. <:#284,9360><+!>FUNCTION AHDErr(string)<-!>
  870.  
  871. <:#284,9360>    Message(string)
  872.  
  873. <:#284,9360><+!>END FUNCTION<-!>
  874.  
  875. <:#284,9360>
  876.  
  877. <:#284,9360>
  878.  
  879. <:#284,9360><+!>FUNCTION AHDMsg(string)<-!>
  880.  
  881. <:#284,9360>    Message(string)
  882.  
  883. <:#284,9360><+!>END FUNCTION<-!>
  884.  
  885. <:#284,9360>
  886.  
  887. <:#284,9360>
  888.  
  889. <:#284,9360><+!>FUNCTION NewLoad(AHMac)<-!>
  890.  
  891. <:#284,9360>'Install AHD.SMM as the new Autoload macro
  892.  
  893. <:#284,9360>
  894.  
  895. <:#284,9360>AHMac = strcat$("1," AHMac)
  896.  
  897. <:#284,9360>WriteProfileString("AmiPro", "automacroload", AHMac, "amipro.ini")
  898.  
  899. <:#284,9360>AutoLoad = GetProfileString$("AmiPro", "automacroload", "amipro.ini")
  900.  
  901. <:#284,9360>IF (AutoLoad <<<;> AHMac)
  902.  
  903. <:#284,9360>    AHDErr("Can't install auto-load macro {AHMac}.")
  904.  
  905. <:#284,9360>ELSE
  906.  
  907. <:#284,9360>    Cmd = MID$(AHMac, 3, LEN(AHMac))
  908.  
  909. <:#284,9360>    Cmd = strcat$(Cmd, "!AHD1")
  910.  
  911. <:#284,9360>    CALLI {Cmd}()
  912.  
  913. <:#568,9360>    AHDMsg("Auto-load macro is now {AHMac}.  The American Heritage Dictionary has been added to the Tools menu.")
  914.  
  915. <:#284,9360>ENDIF
  916.  
  917. <:#284,9360>
  918.  
  919. <:#284,9360><+!>END FUNCTION<-!>
  920.  
  921. <:#284,9360>
  922.  
  923. <:p<* >>
  924.  
  925. <:#284,9360><+!>FUNCTION ModifyLoad(AHMac, AutoLoad, FuncName)<-!>
  926.  
  927. <:#284,9360>'Edit existing auto-load macro to invoke AHD macro from it
  928.  
  929. <:#284,9360>
  930.  
  931. <:#284,9360>'Find current AutoLoad macro
  932.  
  933. <:#284,9360>'If no path specified for autoload macro, prepend the Ami macro path to filename
  934.  
  935. <:#284,9360>IF strchr(1, AutoLoad, "\") << 0
  936.  
  937. <:#284,9360>    MacDir = GetMacPath$()
  938.  
  939. <:#284,9360>    IF ("\" <<<;> RIGHT$(MacDir, 1))
  940.  
  941. <:#284,9360>        MacDir = strcat$(MacDir, "\")
  942.  
  943. <:#284,9360>    ENDIF
  944.  
  945. <:#284,9360>    AutoLoad = strcat$(MacDir, AutoLoad)
  946.  
  947. <:#284,9360>ENDIF
  948.  
  949. <:#284,9360>IF FindFirst$(AutoLoad, 33) = ""
  950.  
  951. <:#284,9360>    AHDErr("Can't find {AutoLoad} auto-load macro to modify.")
  952.  
  953. <:#284,9360>    CALL AskLoad(AHMac)
  954.  
  955. <:#284,9360>    EXIT FUNCTION
  956.  
  957. <:#284,9360>ENDIF
  958.  
  959. <:#284,9360>
  960.  
  961. <:#284,9360>'Check whether AutoLoad macro is already open and close it if so (abandoning changes)
  962.  
  963. <:#284,9360>IF (SelectWindow(AutoLoad))
  964.  
  965. <:#284,9360>    FileChanged(1, 0)
  966.  
  967. <:#284,9360>    FileClose()
  968.  
  969. <:#284,9360>ENDIF
  970.  
  971. <:#284,9360>
  972.  
  973. <:#284,9360>'Make sure it is read-write
  974.  
  975. <:#284,9360>ReadOnly = DOSGetFileAttr(AutoLoad) & 1
  976.  
  977. <:#284,9360>IF ReadOnly
  978.  
  979. <:#284,9360>    IF DOSSetFileAttr(AutoLoad, 0)
  980.  
  981. <:#284,9360>        AHDErr("Can't change read-only attribute of {AutoLoad}.")
  982.  
  983. <:#284,9360>        CALL AskLoad(AHMac)
  984.  
  985. <:#284,9360>        EXIT FUNCTION
  986.  
  987. <:#284,9360>    ENDIF
  988.  
  989. <:#284,9360>ENDIF
  990.  
  991. <:#284,9360>
  992.  
  993. <:#284,9360>'Open the file
  994.  
  995. <:#284,9360>IF (FileOpen(AutoLoad, 1, "") <<<;> 1)
  996.  
  997. <:#284,9360>    AHDErr("Can't open {AutoLoad}.")
  998.  
  999. <:#284,9360>    CALL AskLoad(AHMac)
  1000.  
  1001. <:#284,9360>    DOSSetFileAttr(AutoLoad, ReadOnly)
  1002.  
  1003. <:#284,9360>    EXIT FUNCTION
  1004.  
  1005. <:#284,9360>ENDIF
  1006.  
  1007. <:#284,9360>
  1008.  
  1009. <:#284,9360>'. . . continued . . .
  1010.  
  1011. <:#284,9360>
  1012.  
  1013. <:#284,9360>
  1014.  
  1015. <:#284,9360><**>'Macro command string = filename + '!' + macro name
  1016.  
  1017. <:#284,9360>Cmd = strcat$(AHMac, "!AHD1")
  1018.  
  1019. <:#284,9360>
  1020.  
  1021. <:#284,9360>'Check whether AHD is already installed
  1022.  
  1023. <:#284,9360>IF (Replace(0, 0, FindFromPage1, Cmd, "") = 1)
  1024.  
  1025. <:#568,9360>    AHDErr("The American Heritage Dictionary has already been installed in auto-load macro {AutoLoad}.")
  1026.  
  1027. <:#284,9360>    FileClose()
  1028.  
  1029. <:#284,9360>    DOSSetFileAttr(AutoLoad, ReadOnly)
  1030.  
  1031. <:#284,9360>    EXIT FUNCTION
  1032.  
  1033. <:#284,9360>ENDIF
  1034.  
  1035. <:#284,9360>
  1036.  
  1037. <:#284,9360>'Find end of main or specified function and insert call to AHD
  1038.  
  1039. <:#284,9360>TYPE("<[>CTRLHome]") ' go to the beginning of the document
  1040.  
  1041. <:#284,9360>WHILE(TRUE) ' create a loop
  1042.  
  1043. <:#284,9360>    IF (Replace(0, 0, 0, "FUNCTION", "") = 1)
  1044.  
  1045. <:#284,9360>        TYPE("<[>ESC]<[>CTRLLeft]") ' deselect the word
  1046.  
  1047. <:#284,9360>        'Function must be at start of line, else assume this isn't a real function definition
  1048.  
  1049. <:#284,9360>        IF (GetTextBeforeCursor$() = "")
  1050.  
  1051. <:#284,9360>            IF (FuncName = "")    'If function name unspecified, use first one in file
  1052.  
  1053. <:#284,9360>                BREAK
  1054.  
  1055. <:#284,9360>            ELSE            'Else check for specified function name
  1056.  
  1057. <:#284,9360>                TYPE("<[>CTRLRight]")    ' next word is function name
  1058.  
  1059.                 ThisFunc = LEFT$(CurWord$(), strchr(1, CurWord$(), "(") - 1)
  1060.  
  1061.                 IF (LCASE$(ThisFunc) = LCASE$(FuncName))
  1062.  
  1063. <:#284,9360>                    BREAK        ' this is the auto-load function
  1064.  
  1065. <:#284,9360>                ENDIF
  1066.  
  1067. <:#284,9360>            ENDIF
  1068.  
  1069. <:#284,9360>        ENDIF
  1070.  
  1071. <:#284,9360>        TYPE("<[>End]") ' go to end of line then continue search to prevent endless loop
  1072.  
  1073. <:#284,9360>    ELSE
  1074.  
  1075. <:#284,9360>        AHDErr("Can't find {FuncName} macro function in {AutoLoad}.")
  1076.  
  1077. <:#284,9360>        FileClose()
  1078.  
  1079. <:#284,9360>        CALL AskLoad(AHMac)
  1080.  
  1081. <:#284,9360>        DOSSetFileAttr(AutoLoad, ReadOnly)
  1082.  
  1083. <:#284,9360>        EXIT FUNCTION
  1084.  
  1085. <:#284,9360>    ENDIF
  1086.  
  1087. <:#284,9360>WEND
  1088.  
  1089. <:#284,9360>
  1090.  
  1091. <:#284,9360>TYPE("<[>End]<[>Enter]'Add The American Heritage Dictionary to the Tools menu.<[>Enter]")
  1092.  
  1093. <:#284,9360>TYPE("CALL {Cmd}()<[>Enter]")
  1094.  
  1095. <:#284,9360>
  1096.  
  1097. <:#284,9360>'Try to save the file
  1098.  
  1099. <:#284,9360>Messages(Off)
  1100.  
  1101. <:#284,9360>IF (Save() != 1)
  1102.  
  1103. <:#284,9360>    FileChanged(1, 0)
  1104.  
  1105. <:#284,9360>    FileClose()
  1106.  
  1107. <:#284,9360>    DOSSetFileAttr(AutoLoad, ReadOnly)
  1108.  
  1109. <:#284,9360>    AHDErr("Can't save {AutoLoad}.")
  1110.  
  1111. <:#284,9360>    CALL AskLoad(AHMac)
  1112.  
  1113. <:#284,9360>    EXIT FUNCTION
  1114.  
  1115. <:#284,9360>ENDIF
  1116.  
  1117. <:#284,9360>Messages(On)
  1118.  
  1119. <:#284,9360>'If saved successfully, put AHD on Tools menu now and inform user of successful completion
  1120.  
  1121. <:#284,9360>CALLI {Cmd}()
  1122.  
  1123. <:#284,9360>AHDMsg("The American Heritage Dictionary has been added to the Tools menu.")
  1124.  
  1125. <:#284,9360>FileClose()
  1126.  
  1127. <:#284,9360>DOSSetFileAttr(AutoLoad, ReadOnly)
  1128.  
  1129. <:#284,9360>
  1130.  
  1131. <:#284,9360><+!>END FUNCTION<-!>
  1132.  
  1133. <:#284,9360>
  1134.  
  1135. <:#284,9360>
  1136.  
  1137. <:#284,9360><+!>FUNCTION AskLoad(AHMac)<-!>
  1138.  
  1139. <:#284,9360>'If we couldn't modify the old auto-load macro, ask the user whether to switch to our macro
  1140.  
  1141. <:#284,9360>
  1142.  
  1143. <:#284,9360>IF Decide("Choose Yes to install {AHMac} as the new auto-load macro or No to quit.")
  1144.  
  1145. <:#284,9360>    CALL NewLoad(AHMac)
  1146.  
  1147. <:#284,9360>ELSE
  1148.  
  1149. <:#284,9360>    AHDErr("American Heritage Dictionary NOT installed to Tools menu.")
  1150.  
  1151. <:#284,9360>ENDIF
  1152.  
  1153. <:#284,9360>
  1154.  
  1155. <:#284,9360><+!>END FUNCTION<-!>
  1156.  
  1157. <:#284,9360>
  1158.  
  1159. >
  1160.  
  1161. [Embedded]
  1162. 00015937
  1163. >
  1164. [macsum] 6
  1165. AHDLoad 0 1 8 33
  1166. AHDErr 1206 1 1 87
  1167. AHDMsg 1240 1 1 92
  1168. NewLoad 1274 1 3 97
  1169. ModifyLoad 1710 3 5 115
  1170. AskLoad 3455 1 1 221
  1171. [macse]
  1172. 14 AHDLoad
  1173. 0 2 "Choose Yes to install The American Heritage Dictionary to the Ami Pro Tools menu or choose No to quit."
  1174. 13
  1175. 5 0
  1176. 18 0
  1177. 11 00000162
  1178. 6 1
  1179. 15
  1180. 9
  1181. 7 "AHD.SMM"
  1182. 8 3
  1183. 0 802
  1184. 13
  1185. 8 4
  1186. 0 14 "{4}"
  1187. 13
  1188. 8 5
  1189. 7 "\"
  1190. 0 15 "{4}" "{5}" 1
  1191. 13
  1192. 0 805 &2 [X]
  1193. 13
  1194. 18 1
  1195. 11 00000318
  1196. 6 5
  1197. 5 1
  1198. 3 1
  1199. 8 5
  1200. 10 00000217
  1201. 0 806 "{4}" "{5}"
  1202. 13
  1203. 8 4
  1204. 0 16 "{4}" "{3}"
  1205. 13
  1206. 8 4
  1207. 0 17 "{4}"
  1208. 13
  1209. 8 4
  1210. 7 ""
  1211. 0 280 "{4}" 33
  1212. 13
  1213. 18 0
  1214. 11 00000480
  1215. 16 AHDErr "Can't find {4}."
  1216. 6 1
  1217. 15
  1218. 9
  1219. 0 286 "AmiPro" "automacroload" "amipro.ini"
  1220. 13
  1221. 8 6
  1222. 6 6
  1223. 7 ""
  1224. 18 0
  1225. 11 00000595
  1226. 16 NewLoad "{4}"
  1227. 10 00001171
  1228. 7 "0"
  1229. 0 806 "{6}" 1
  1230. 13
  1231. 18 0
  1232. 11 00000671
  1233. 16 NewLoad "{4}"
  1234. 10 00001171
  1235. 0 18 "{3}"
  1236. 13
  1237. 0 14 "{3}"
  1238. 13
  1239. 0 807 "{6}" [X]
  1240. 13
  1241. 0 18 [X]
  1242. 13
  1243. 18 0
  1244. 11 00000800
  1245. 16 NewLoad "{4}"
  1246. 6 1
  1247. 15
  1248. 9
  1249. 10 00001171
  1250. 0 14 "{6}"
  1251. 13
  1252. 5 2
  1253. 3 1
  1254. 0 15 "{6}" 3 [X]
  1255. 13
  1256. 8 6
  1257. 7 ""
  1258. 8 7
  1259. 0 13 1 "{6}" "!"
  1260. 13
  1261. 8 5
  1262. 6 5
  1263. 5 1
  1264. 18 3
  1265. 11 00001138
  1266. 6 5
  1267. 5 1
  1268. 3 0
  1269. 0 14 "{6}"
  1270. 13
  1271. 6 5
  1272. 3 1
  1273. 5 1
  1274. 3 0
  1275. 0 15 "{6}" [X] [X]
  1276. 13
  1277. 8 7
  1278. 0 13 1 "{7}" "("
  1279. 13
  1280. 8 8
  1281. 6 8
  1282. 5 0
  1283. 18 3
  1284. 11 00001097
  1285. 6 8
  1286. 5 1
  1287. 3 1
  1288. 0 806 "{7}" [X]
  1289. 13
  1290. 8 7
  1291. 6 5
  1292. 5 1
  1293. 3 1
  1294. 0 806 "{6}" [X]
  1295. 13
  1296. 8 6
  1297. 16 ModifyLoad "{4}" "{6}" "{7}"
  1298. 0 1038 "Dictionary" 0
  1299. 6 1
  1300. 15
  1301. 9
  1302. 14 AHDErr
  1303. 0 3 "{0}"
  1304. 6 1
  1305. 15
  1306. 9
  1307. 14 AHDMsg
  1308. 0 3 "{0}"
  1309. 6 1
  1310. 15
  1311. 9
  1312. 14 NewLoad
  1313. 0 16 "1," "{0}"
  1314. 13
  1315. 8 0
  1316. 0 287 "AmiPro" "automacroload" "{0}" "amipro.ini"
  1317. 0 286 "AmiPro" "automacroload" "amipro.ini"
  1318. 13
  1319. 8 2
  1320. 6 2
  1321. 6 0
  1322. 18 1
  1323. 11 00000233
  1324. 16 AHDErr "Can't install auto-load macro {0}."
  1325. 10 00000424
  1326. 0 14 "{0}"
  1327. 13
  1328. 0 15 "{0}" 3 [X]
  1329. 13
  1330. 8 3
  1331. 0 16 "{3}" "!AHD1"
  1332. 13
  1333. 8 3
  1334. 16 "{3}"
  1335. 16 AHDMsg "Auto-load macro is now {0}.  The American Heritage Dictionary has been added to the Tools menu."
  1336. 6 1
  1337. 15
  1338. 9
  1339. 14 ModifyLoad
  1340. 0 13 1 "{1}" "\"
  1341. 13
  1342. 5 0
  1343. 18 5
  1344. 11 00000174
  1345. 0 295
  1346. 13
  1347. 8 4
  1348. 7 "\"
  1349. 0 807 "{4}" 1
  1350. 13
  1351. 18 1
  1352. 11 00000147
  1353. 0 16 "{4}" "\"
  1354. 13
  1355. 8 4
  1356. 0 16 "{4}" "{1}"
  1357. 13
  1358. 8 1
  1359. 0 280 "{1}" 33
  1360. 13
  1361. 7 ""
  1362. 18 0
  1363. 11 00000304
  1364. 16 AHDErr "Can't find {1} auto-load macro to modify."
  1365. 16 AskLoad "{0}"
  1366. 6 3
  1367. 15
  1368. 9
  1369. 0 796 "{1}"
  1370. 13
  1371. 11 00000353
  1372. 0 34 1 0
  1373. 2 147 1
  1374. 0 775 "{1}"
  1375. 13
  1376. 5 1
  1377. 25 1
  1378. 8 5
  1379. 6 5
  1380. 11 00000520
  1381. 0 776 "{1}" 0
  1382. 13
  1383. 11 00000520
  1384. 16 AHDErr "Can't change read-only attribute of {1}."
  1385. 16 AskLoad "{0}"
  1386. 6 3
  1387. 15
  1388. 9
  1389. 2 102 1 "{1}" 1 ""
  1390. 13
  1391. 5 1
  1392. 18 1
  1393. 11 00000646
  1394. 16 AHDErr "Can't open {1}."
  1395. 16 AskLoad "{0}"
  1396. 0 776 "{1}" "{5}"
  1397. 6 3
  1398. 15
  1399. 9
  1400. 0 16 "{0}" "!AHD1"
  1401. 13
  1402. 8 6
  1403. 2 488 1 0 0 8192 "{6}" ""
  1404. 13
  1405. 5 1
  1406. 18 0
  1407. 11 00000867
  1408. 16 AHDErr "The American Heritage Dictionary has already been installed in auto-load macro {1}."
  1409. 2 147 1
  1410. 0 776 "{1}" "{5}"
  1411. 6 3
  1412. 15
  1413. 9
  1414. 0 6 "[16420]"
  1415. 5 1
  1416. 11 00001367
  1417. 2 488 1 0 0 0 "FUNCTION" ""
  1418. 13
  1419. 5 1
  1420. 18 0
  1421. 11 00001245
  1422. 0 6 "[27][16421]"
  1423. 0 37
  1424. 13
  1425. 7 ""
  1426. 18 0
  1427. 11 00001220
  1428. 6 2
  1429. 7 ""
  1430. 18 0
  1431. 11 00001067
  1432. 10 00001367
  1433. 10 00001220
  1434. 0 6 "[16423]"
  1435. 0 23
  1436. 13
  1437. 0 23
  1438. 13
  1439. 0 13 1 [X] "("
  1440. 13
  1441. 5 1
  1442. 3 1
  1443. 0 806 [X] [X]
  1444. 13
  1445. 8 7
  1446. 0 17 "{7}"
  1447. 13
  1448. 0 17 "{2}"
  1449. 13
  1450. 18 0
  1451. 11 00001220
  1452. 10 00001367
  1453. 0 6 "[35]"
  1454. 10 00001354
  1455. 16 AHDErr "Can't find {2} macro function in {1}."
  1456. 2 147 1
  1457. 16 AskLoad "{0}"
  1458. 0 776 "{1}" "{5}"
  1459. 6 3
  1460. 15
  1461. 9
  1462. 10 00000882
  1463. 0 6 "[35][13]'Add The American Heritage Dictionary to the Tools menu.[13]"
  1464. 0 6 "CALL {6}()[13]"
  1465. 0 30 0
  1466. 2 103 1
  1467. 13
  1468. 5 1
  1469. 18 1
  1470. 11 00001607
  1471. 0 34 1 0
  1472. 2 147 1
  1473. 0 776 "{1}" "{5}"
  1474. 16 AHDErr "Can't save {1}."
  1475. 16 AskLoad "{0}"
  1476. 6 3
  1477. 15
  1478. 9
  1479. 0 30 1
  1480. 16 "{6}"
  1481. 16 AHDMsg "The American Heritage Dictionary has been added to the Tools menu."
  1482. 2 147 1
  1483. 0 776 "{1}" "{5}"
  1484. 6 3
  1485. 15
  1486. 9
  1487. 14 AskLoad
  1488. 0 2 "Choose Yes to install {0} as the new auto-load macro or No to quit."
  1489. 13
  1490. 11 00000135
  1491. 16 NewLoad "{0}"
  1492. 10 00000206
  1493. 16 AHDErr "American Heritage Dictionary NOT installed to Tools menu."
  1494. 6 1
  1495. 15
  1496. 9
  1497. 00015962
  1498.