home *** CD-ROM | disk | FTP | other *** search
/ 808 Great Letters / 808Letters.iso / refcd / referenz / install.smm < prev    next >
Encoding:
INI File  |  1995-01-11  |  18.1 KB  |  1,465 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     _macro.sty
  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 ReferenZing to Tools menu
  19.     
  20.     
  21.     
  22.     
  23.     780690202
  24.     29
  25.     735410161
  26.     420
  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 1
  167.     5
  168.     [fnt]
  169.         Times New Roman
  170.         240
  171.         0
  172.         49152
  173.     [algn]
  174.         1
  175.         1
  176.         288
  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.         <*5>
  204.         0
  205.         1
  206.         1
  207.         0
  208.         0
  209.         0
  210.         0
  211.     [nfmt]
  212.         280
  213.         1
  214.         2
  215.         .
  216.         ,
  217.         $
  218.     Bullet 1
  219.     0
  220.     0
  221. [tag]
  222.     Number List
  223.     6
  224.     [fnt]
  225.         Times New Roman
  226.         240
  227.         0
  228.         49152
  229.     [algn]
  230.         1
  231.         1
  232.         360
  233.         360
  234.         360
  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.         <*:>.
  260.         360
  261.         1
  262.         1
  263.         0
  264.         0
  265.         0
  266.         0
  267.     [nfmt]
  268.         272
  269.         1
  270.         2
  271.         .
  272.         ,
  273.         $
  274.     Number List
  275.     0
  276.     0
  277. [tag]
  278.     Subhead
  279.     7
  280.     [fnt]
  281.         Times New Roman
  282.         240
  283.         0
  284.         49155
  285.     [algn]
  286.         1
  287.         1
  288.         0
  289.         0
  290.         0
  291.     [spc]
  292.         33
  293.         273
  294.         1
  295.         72
  296.         72
  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.         2
  315.         
  316.         0
  317.         1
  318.         1
  319.         0
  320.         0
  321.         0
  322.         0
  323.     [nfmt]
  324.         272
  325.         1
  326.         2
  327.         .
  328.         ,
  329.         $
  330.     Subhead
  331.     0
  332.     0
  333. [tag]
  334.     Title
  335.     8
  336.     [fnt]
  337.         Arial
  338.         360
  339.         0
  340.         16385
  341.     [algn]
  342.         4
  343.         1
  344.         0
  345.         0
  346.         0
  347.     [spc]
  348.         33
  349.         446
  350.         1
  351.         144
  352.         72
  353.         1
  354.         100
  355.     [brk]
  356.         16
  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.         1
  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.     Title
  387.     0
  388.     0
  389. [tag]
  390.     Header
  391.     9
  392.     [fnt]
  393.         Times New Roman
  394.         240
  395.         0
  396.         49152
  397.     [algn]
  398.         1
  399.         1
  400.         0
  401.         0
  402.         0
  403.     [spc]
  404.         33
  405.         273
  406.         1
  407.         0
  408.         0
  409.         1
  410.         100
  411.     [brk]
  412.         4
  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.         0
  427.         
  428.         0
  429.         1
  430.         1
  431.         0
  432.         0
  433.         0
  434.         0
  435.     [nfmt]
  436.         280
  437.         1
  438.         2
  439.         .
  440.         ,
  441.         $
  442.     Header
  443.     0
  444.     0
  445. [tag]
  446.     Footer
  447.     11
  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.     Footer
  499.     0
  500.     0
  501. [tag]
  502.     Bullet
  503.     12
  504.     [fnt]
  505.         Times New Roman
  506.         240
  507.         0
  508.         49152
  509.     [algn]
  510.         1
  511.         1
  512.         0
  513.         288
  514.         288
  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.         <*0>
  540.         360
  541.         1
  542.         1
  543.         0
  544.         0
  545.         0
  546.         0
  547.     [nfmt]
  548.         272
  549.         1
  550.         2
  551.         .
  552.         ,
  553.         $
  554.     Bullet
  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.     19 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.     62 0 36 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.     99 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.     144 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.     188 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.     216 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 ReferenZing to Tools menu at startup.
  696.  
  697. <:#284,9360>
  698.  
  699. <:#284,9360>Run this macro file to install ReferenZing to the Ami Pro 3.0 Tools menu.  
  700.  
  701. <:#284,9360>
  702.  
  703. <:#284,9360>Choose Tools/Macros/Playback and select INSTALL.SMM
  704.  
  705. <:#284,9360>
  706.  
  707. <:#568,9360>Macros INSTALL.SMM & REFER.SMM are located in the ReferenZing directory, which is normally C:\REFERENZ.
  708.  
  709. <:#284,9360>
  710.  
  711. <:#284,9360>If an error occurs:
  712.  
  713. <:#284,9360>
  714.  
  715. <:#284,9360>Be sure that this file, INSTALL.SMM and REFER.SMM are in the ReferenZing directory.
  716.  
  717. <:#284,9360>
  718.  
  719. <:#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 REFER.SMM.  
  720.  
  721. <:#284,9360>
  722.  
  723. <:#284,9360>If there is already an autoload macro assigned, you can edit it and add a call to REFER.SMM.  
  724.  
  725. <:#284,9360>
  726.  
  727. <:#852,9360>Below the first line that begins with "FUNCTION," add a line with, "CALL c:\path\REFER.SMM!REFERINS()" replacing "c:\path" with the drive and directory where macro is installed.
  728.  
  729. <:#284,9360>
  730.  
  731. <:p<* >>
  732.  
  733. <:#284,9360><+!>FUNCTION ReferLoad(Cmd)<-!>
  734.  
  735. <:#284,9360>DEFSTR Char;
  736.  
  737. <:#284,9360>
  738.  
  739. <:#568,9360>IF (Decide("Choose Yes to install ReferenZing to the Ami Pro Tools menu or choose No to quit.") = 0)
  740.  
  741. <:#284,9360>    EXIT FUNCTION
  742.  
  743. <:#284,9360>ENDIF
  744.  
  745. <:#284,9360>
  746.  
  747. <:#284,9360>Quote = "REFER.SMM"
  748.  
  749. <:#284,9360>
  750.  
  751. <:#284,9360>'Use path of INSTALL macro to find REFER macro
  752.  
  753. <:#284,9360>ReferMac = GetRunningMacroFile$()
  754.  
  755. <:#284,9360>I = LEN(ReferMac)
  756.  
  757. <:#284,9360>WHILE "\" != Assign(&Char, MID$(ReferMac, I, 1))
  758.  
  759. <:#284,9360>    I = I - 1
  760.  
  761. <:#284,9360>WEND
  762.  
  763. <:#284,9360>ReferMac = Left$(ReferMac, I)
  764.  
  765. <:#284,9360>ReferMac = strcat$(ReferMac, Quote)
  766.  
  767. <:#284,9360>ReferMac = LCASE$(ReferMac)
  768.  
  769. <:#284,9360>'Make sure that the REFER macro exists in the specified path
  770.  
  771. <:#284,9360>IF "" = FindFirst$(ReferMac, 33)    'include read-only and archive flags
  772.  
  773. <:#284,9360>    CALL ReferErr("Can't find {ReferMac}.")
  774.  
  775. <:#284,9360>    EXIT FUNCTION
  776.  
  777. <:#284,9360>ENDIF 
  778.  
  779. <:#284,9360>AutoLoad = GetProfileString$("AmiPro", "automacroload", "amipro.ini")
  780.  
  781. <:#284,9360>'If there isn't currently an auto load macro or it is disabled, assign ours as the auto load macro.
  782.  
  783. <:#284,9360>'If there is already an auto load macro, call it from REFER.SMM.
  784.  
  785. <:#284,9360>IF (AutoLoad = "")
  786.  
  787. <:#284,9360>    CALL NewLoad(REFERMac)
  788.  
  789. <:#284,9360>ELSEIF "0" = LEFT$(AutoLoad, 1)
  790.  
  791. <:#284,9360>    CALL NewLoad(REFERMac)
  792.  
  793. <:#284,9360>ELSEIF (UCASE$(QUOTE) = UCASE$(RIGHT$(AutoLoad, LEN(QUOTE))))
  794.  
  795. <:#284,9360>    'CALL REFERErr("{QUOTE} is already the autoload macro")
  796.  
  797. <:#568,9360>    CALL NewLoad(REFERMac)    ' reinstall anyway, in case path is invalid or macro is old
  798.  
  799. <:#284,9360>    EXIT FUNCTION
  800.  
  801. <:#284,9360>ELSE
  802.  
  803. <:#284,9360>    AutoLoad = MID$(AutoLoad, 3, LEN(AutoLoad) - 2)
  804.  
  805. <:#284,9360>    FuncName = ""    'Filename may be followed by name of function to run
  806.  
  807. <:#284,9360>    I = strchr(1, AutoLoad, "!")
  808.  
  809. <:#284,9360>    IF (I <;>1)
  810.  
  811. <:#284,9360>        FuncName = MID$(AutoLoad, I + 1, LEN(AutoLoad) - I + 1)
  812.  
  813. <:#284,9360>        J = strchr(1, FuncName, "(")
  814.  
  815. <:#284,9360>        IF (J <;> 0)    ' trim parentheses from name
  816.  
  817. <:#284,9360>            FuncName = LEFT$(FuncName, J - 1)
  818.  
  819. <:#284,9360>        ENDIF
  820.  
  821. <:#284,9360>        AutoLoad = LEFT$(AutoLoad, I - 1)
  822.  
  823. <:#284,9360>    ENDIF
  824.  
  825. <:#284,9360>    CALL ModifyLoad(REFERMac, AutoLoad, FuncName)
  826.  
  827. <:#284,9360>ENDIF
  828.  
  829. <:#284,9360>
  830.  
  831. <:#284,9360><+!>END FUNCTION<-!>
  832.  
  833. <:#284,9360>
  834.  
  835. <:#284,9360>
  836.  
  837. <:#284,9360><+!>FUNCTION REFERErr(string)<-!>
  838.  
  839. <:#284,9360>    Message(string)
  840.  
  841. <:#284,9360><+!>END FUNCTION<-!>
  842.  
  843. <:#284,9360>
  844.  
  845. <:#284,9360>
  846.  
  847. <:#284,9360><+!>FUNCTION REFERMSG(string)<-!>
  848.  
  849. <:#284,9360>    Message(string)
  850.  
  851. <:#284,9360><+!>END FUNCTION<-!>
  852.  
  853. <:#284,9360>
  854.  
  855. <:#284,9360>
  856.  
  857. <:#284,9360><+!>FUNCTION NewLoad(REFERMac)<-!>
  858.  
  859. <:#284,9360>'Install REFER.SMM as the new Autoload macro
  860.  
  861. <:#284,9360>
  862.  
  863. <:#284,9360>REFERMac = strcat$("1," REFERMac)
  864.  
  865. <:#284,9360>WriteProfileString("AmiPro", "automacroload", REFERMac, "amipro.ini")
  866.  
  867. <:#284,9360>AutoLoad = GetProfileString$("AmiPro", "automacroload", "amipro.ini")
  868.  
  869. <:#284,9360>IF (AutoLoad <<<;> REFERMac)
  870.  
  871. <:#284,9360>    REFERErr("Can't install auto-load macro {REFERMac}.")
  872.  
  873. <:#284,9360>ELSE
  874.  
  875. <:#284,9360>    Cmd = MID$(REFERMac, 3, LEN(REFERMac))
  876.  
  877. <:#284,9360>    Cmd = strcat$(Cmd, "!REFERINS")
  878.  
  879. <:#284,9360>    CALLI {Cmd}()
  880.  
  881. <:#568,9360>    REFERMSG("Auto-load macro is now {REFERMac}.  ReferenZing has been added to the Tools menu.")
  882.  
  883. <:#284,9360>ENDIF
  884.  
  885. <:#284,9360>
  886.  
  887. <:#284,9360><+!>END FUNCTION<-!>
  888.  
  889. <:#284,9360>
  890.  
  891. <:p<* >>
  892.  
  893. <:#284,9360><+!>FUNCTION ModifyLoad(REFERMac, AutoLoad, FuncName)<-!>
  894.  
  895. <:#284,9360>'Edit existing auto-load macro to invoke ReferenZing macro from it
  896.  
  897. <:#284,9360>
  898.  
  899. <:#284,9360>'Find current AutoLoad macro
  900.  
  901. <:#284,9360>'If no path specified for autoload macro, prepend the Ami macro path to filename
  902.  
  903. <:#284,9360>IF strchr(1, AutoLoad, "\") << 0
  904.  
  905. <:#284,9360>    MacDir = GetMacPath$()
  906.  
  907. <:#284,9360>    IF ("\" <<<;> RIGHT$(MacDir, 1))
  908.  
  909. <:#284,9360>        MacDir = strcat$(MacDir, "\")
  910.  
  911. <:#284,9360>    ENDIF
  912.  
  913. <:#284,9360>    AutoLoad = strcat$(MacDir, AutoLoad)
  914.  
  915. <:#284,9360>ENDIF
  916.  
  917. <:#284,9360>IF FindFirst$(AutoLoad, 33) = ""
  918.  
  919. <:#284,9360>    REFERErr("Can't find {AutoLoad} auto-load macro to modify.")
  920.  
  921. <:#284,9360>    CALL AskLoad(REFERMac)
  922.  
  923. <:#284,9360>    EXIT FUNCTION
  924.  
  925. <:#284,9360>ENDIF
  926.  
  927. <:#284,9360>
  928.  
  929. <:#284,9360>'Check whether AutoLoad macro is already open and close it if so (abandoning changes)
  930.  
  931. <:#284,9360>IF (SelectWindow(AutoLoad))
  932.  
  933. <:#284,9360>    FileChanged(1, 0)
  934.  
  935. <:#284,9360>    FileClose()
  936.  
  937. <:#284,9360>ENDIF
  938.  
  939. <:#284,9360>
  940.  
  941. <:#284,9360>'Make sure it is read-write
  942.  
  943. <:#284,9360>ReadOnly = DOSGetFileAttr(AutoLoad) & 1
  944.  
  945. <:#284,9360>IF ReadOnly
  946.  
  947. <:#284,9360>    IF DOSSetFileAttr(AutoLoad, 0)
  948.  
  949. <:#284,9360>        REFERERR("Can't change read-only attribute of {AutoLoad}.")
  950.  
  951. <:#284,9360>        CALL AskLoad(REFERMac)
  952.  
  953. <:#284,9360>        EXIT FUNCTION
  954.  
  955. <:#284,9360>    ENDIF
  956.  
  957. <:#284,9360>ENDIF
  958.  
  959. <:#284,9360>
  960.  
  961. <:#284,9360>'Open the file
  962.  
  963. <:#284,9360>IF (FileOpen(AutoLoad, 1, "") <<<;> 1)
  964.  
  965. <:#284,9360>    REFERErr("Can't open {AutoLoad}.")
  966.  
  967. <:#284,9360>    CALL AskLoad(REFERMac)
  968.  
  969. <:#284,9360>    DOSSetFileAttr(AutoLoad, ReadOnly)
  970.  
  971. <:#284,9360>    EXIT FUNCTION
  972.  
  973. <:#284,9360>ENDIF
  974.  
  975. <:#284,9360>
  976.  
  977. <:#284,9360>'. . . continued . . .
  978.  
  979. <:#284,9360>
  980.  
  981. <:#284,9360>
  982.  
  983. <:#284,9360><**>'Macro command string = filename + '!' + macro name
  984.  
  985. <:#284,9360>Cmd = strcat$(REFERMac, "!REFERINS")
  986.  
  987. <:#284,9360>
  988.  
  989. <:#284,9360>'Check whether ReferenZing is already installed
  990.  
  991. <:#284,9360>IF (Replace(0, 0, FindFromPage1, Cmd, "") = 1)
  992.  
  993. <:#568,9360>    REFERERR("ReferenZing Version 1.0  has already been installed in auto-load macro {AutoLoad}.")
  994.  
  995. <:#284,9360>    FileClose()
  996.  
  997. <:#284,9360>    DOSSetFileAttr(AutoLoad, ReadOnly)
  998.  
  999. <:#284,9360>    EXIT FUNCTION
  1000.  
  1001. <:#284,9360>ENDIF
  1002.  
  1003. <:#284,9360>
  1004.  
  1005. <:#284,9360>'Find end of main or specified function and insert call to ReferenZing
  1006.  
  1007. <:#284,9360>TYPE("<[>CTRLHome]") ' go to the beginning of the document
  1008.  
  1009. <:#284,9360>WHILE(TRUE) ' create a loop
  1010.  
  1011. <:#284,9360>    IF (Replace(0, 0, 0, "FUNCTION", "") = 1)
  1012.  
  1013. <:#284,9360>        TYPE("<[>ESC]<[>CTRLLeft]") ' deselect the word
  1014.  
  1015. <:#284,9360>        'Function must be at start of line, else assume this isn't a real function definition
  1016.  
  1017. <:#284,9360>        IF (GetTextBeforeCursor$() = "")
  1018.  
  1019. <:#284,9360>            IF (FuncName = "")    'If function name unspecified, use first one in file
  1020.  
  1021. <:#284,9360>                BREAK
  1022.  
  1023. <:#284,9360>            ELSE            'Else check for specified function name
  1024.  
  1025. <:#284,9360>                TYPE("<[>CTRLRight]")    ' next word is function name
  1026.  
  1027. <:#284,9360>                ThisFunc = LEFT$(CurWord$(), strchr(1, CurWord$(), "(") - 1)
  1028.  
  1029. <:#284,9360>                IF (LCASE$(ThisFunc) = LCASE$(FuncName))
  1030.  
  1031. <:#284,9360>                    BREAK        ' this is the auto-load function
  1032.  
  1033. <:#284,9360>                ENDIF
  1034.  
  1035. <:#284,9360>            ENDIF
  1036.  
  1037. <:#284,9360>        ENDIF
  1038.  
  1039. <:#284,9360>        TYPE("<[>End]") ' go to end of line then continue search to prevent endless loop
  1040.  
  1041. <:#284,9360>    ELSE
  1042.  
  1043. <:#284,9360>        REFERERR("Can't find {FuncName} macro function in {AutoLoad}.")
  1044.  
  1045. <:#284,9360>        FileClose()
  1046.  
  1047. <:#284,9360>        CALL AskLoad(REFERMAC)
  1048.  
  1049. <:#284,9360>        DOSSetFileAttr(AutoLoad, ReadOnly)
  1050.  
  1051. <:#284,9360>        EXIT FUNCTION
  1052.  
  1053. <:#284,9360>    ENDIF
  1054.  
  1055. <:#284,9360>WEND
  1056.  
  1057. <:#284,9360>
  1058.  
  1059. <:#284,9360>TYPE("<[>End]<[>Enter]'Add ReferenZing Version 1.0 to the Tools menu.<[>Enter]")
  1060.  
  1061. <:#284,9360>TYPE("CALL {Cmd}()<[>Enter]")
  1062.  
  1063. <:#284,9360>
  1064.  
  1065. <:#284,9360>'Try to save the file
  1066.  
  1067. <:#284,9360>Messages(Off)
  1068.  
  1069. <:#284,9360>IF (Save() != 1)
  1070.  
  1071. <:#284,9360>    FileChanged(1, 0)
  1072.  
  1073. <:#284,9360>    FileClose()
  1074.  
  1075. <:#284,9360>    DOSSetFileAttr(AutoLoad, ReadOnly)
  1076.  
  1077. <:#284,9360>    REFERERR("Can't save {AutoLoad}.")
  1078.  
  1079. <:#284,9360>    CALL AskLoad(REFERMAC)
  1080.  
  1081. <:#284,9360>    EXIT FUNCTION
  1082.  
  1083. <:#284,9360>ENDIF
  1084.  
  1085. <:#284,9360>Messages(On)
  1086.  
  1087. <:#568,9360>'If saved successfully, put ReferenZing on Tools menu now and inform user of successful completion
  1088.  
  1089. <:#284,9360>CALLI {Cmd}()
  1090.  
  1091. <:#284,9360>REFERMSG("ReferenZing has been added to the Tools menu.")
  1092.  
  1093. <:#284,9360>FileClose()
  1094.  
  1095. <:#284,9360>DOSSetFileAttr(AutoLoad, ReadOnly)
  1096.  
  1097. <:#284,9360>
  1098.  
  1099. <:#284,9360><+!>END FUNCTION<-!>
  1100.  
  1101. <:#284,9360>
  1102.  
  1103. <:#284,9360>
  1104.  
  1105. <:#284,9360><+!>FUNCTION AskLoad(REFERMAC)<-!>
  1106.  
  1107. <:#284,9360>'If we couldn't modify the old auto-load macro, ask the user whether to switch to our macro
  1108.  
  1109. <:#284,9360>
  1110.  
  1111. <:#284,9360>IF Decide("Choose Yes to install {REFERMAC} as the new auto-load macro or No to quit.")
  1112.  
  1113. <:#284,9360>    CALL NewLoad(REFERMAC)
  1114.  
  1115. <:#284,9360>ELSE
  1116.  
  1117. <:#284,9360>    REFERERR("ReferenZing Version 1 .0 NOT installed to Tools menu.")
  1118.  
  1119. <:#284,9360>ENDIF
  1120.  
  1121. <:#284,9360>
  1122.  
  1123. <:#284,9360><+!>END FUNCTION<-!>
  1124.  
  1125. <:#284,9360>
  1126.  
  1127. >
  1128.  
  1129. [Embedded]
  1130. 00014736
  1131. >
  1132. [macsum] 6
  1133. ReferLoad 0 1 8 19
  1134. REFERErr 1168 1 1 71
  1135. REFERMSG 1204 1 1 76
  1136. NewLoad 1240 1 3 81
  1137. ModifyLoad 1663 3 5 99
  1138. AskLoad 3388 1 1 205
  1139. [macse]
  1140. 14 ReferLoad
  1141. 0 2 "Choose Yes to install ReferenZing to the Ami Pro Tools menu or choose No to quit."
  1142. 13
  1143. 5 0
  1144. 18 0
  1145. 11 00000143
  1146. 6 1
  1147. 15
  1148. 9
  1149. 7 "REFER.SMM"
  1150. 8 3
  1151. 0 802
  1152. 13
  1153. 8 4
  1154. 0 14 "{4}"
  1155. 13
  1156. 8 5
  1157. 7 "\"
  1158. 0 15 "{4}" "{5}" 1
  1159. 13
  1160. 0 805 &2 [X]
  1161. 13
  1162. 18 1
  1163. 11 00000301
  1164. 6 5
  1165. 5 1
  1166. 3 1
  1167. 8 5
  1168. 10 00000200
  1169. 0 806 "{4}" "{5}"
  1170. 13
  1171. 8 4
  1172. 0 16 "{4}" "{3}"
  1173. 13
  1174. 8 4
  1175. 0 17 "{4}"
  1176. 13
  1177. 8 4
  1178. 7 ""
  1179. 0 280 "{4}" 33
  1180. 13
  1181. 18 0
  1182. 11 00000465
  1183. 16 ReferErr "Can't find {4}."
  1184. 6 1
  1185. 15
  1186. 9
  1187. 0 286 "AmiPro" "automacroload" "amipro.ini"
  1188. 13
  1189. 8 6
  1190. 6 6
  1191. 7 ""
  1192. 18 0
  1193. 11 00000580
  1194. 16 NewLoad "{4}"
  1195. 10 00001156
  1196. 7 "0"
  1197. 0 806 "{6}" 1
  1198. 13
  1199. 18 0
  1200. 11 00000656
  1201. 16 NewLoad "{4}"
  1202. 10 00001156
  1203. 0 18 "{3}"
  1204. 13
  1205. 0 14 "{3}"
  1206. 13
  1207. 0 807 "{6}" [X]
  1208. 13
  1209. 0 18 [X]
  1210. 13
  1211. 18 0
  1212. 11 00000785
  1213. 16 NewLoad "{4}"
  1214. 6 1
  1215. 15
  1216. 9
  1217. 10 00001156
  1218. 0 14 "{6}"
  1219. 13
  1220. 5 2
  1221. 3 1
  1222. 0 15 "{6}" 3 [X]
  1223. 13
  1224. 8 6
  1225. 7 ""
  1226. 8 7
  1227. 0 13 1 "{6}" "!"
  1228. 13
  1229. 8 5
  1230. 6 5
  1231. 5 1
  1232. 18 3
  1233. 11 00001123
  1234. 6 5
  1235. 5 1
  1236. 3 0
  1237. 0 14 "{6}"
  1238. 13
  1239. 6 5
  1240. 3 1
  1241. 5 1
  1242. 3 0
  1243. 0 15 "{6}" [X] [X]
  1244. 13
  1245. 8 7
  1246. 0 13 1 "{7}" "("
  1247. 13
  1248. 8 8
  1249. 6 8
  1250. 5 0
  1251. 18 3
  1252. 11 00001082
  1253. 6 8
  1254. 5 1
  1255. 3 1
  1256. 0 806 "{7}" [X]
  1257. 13
  1258. 8 7
  1259. 6 5
  1260. 5 1
  1261. 3 1
  1262. 0 806 "{6}" [X]
  1263. 13
  1264. 8 6
  1265. 16 ModifyLoad "{4}" "{6}" "{7}"
  1266. 6 1
  1267. 15
  1268. 9
  1269. 14 REFERErr
  1270. 0 3 "{0}"
  1271. 6 1
  1272. 15
  1273. 9
  1274. 14 REFERMSG
  1275. 0 3 "{0}"
  1276. 6 1
  1277. 15
  1278. 9
  1279. 14 NewLoad
  1280. 0 16 "1," "{0}"
  1281. 13
  1282. 8 0
  1283. 0 287 "AmiPro" "automacroload" "{0}" "amipro.ini"
  1284. 0 286 "AmiPro" "automacroload" "amipro.ini"
  1285. 13
  1286. 8 2
  1287. 6 2
  1288. 6 0
  1289. 18 1
  1290. 11 00000235
  1291. 16 REFERErr "Can't install auto-load macro {0}."
  1292. 10 00000411
  1293. 0 14 "{0}"
  1294. 13
  1295. 0 15 "{0}" 3 [X]
  1296. 13
  1297. 8 3
  1298. 0 16 "{3}" "!REFERINS"
  1299. 13
  1300. 8 3
  1301. 16 "{3}"
  1302. 16 REFERMSG "Auto-load macro is now {0}.  ReferenZing has been added to the Tools menu."
  1303. 6 1
  1304. 15
  1305. 9
  1306. 14 ModifyLoad
  1307. 0 13 1 "{1}" "\"
  1308. 13
  1309. 5 0
  1310. 18 5
  1311. 11 00000174
  1312. 0 295
  1313. 13
  1314. 8 4
  1315. 7 "\"
  1316. 0 807 "{4}" 1
  1317. 13
  1318. 18 1
  1319. 11 00000147
  1320. 0 16 "{4}" "\"
  1321. 13
  1322. 8 4
  1323. 0 16 "{4}" "{1}"
  1324. 13
  1325. 8 1
  1326. 0 280 "{1}" 33
  1327. 13
  1328. 7 ""
  1329. 18 0
  1330. 11 00000306
  1331. 16 REFERErr "Can't find {1} auto-load macro to modify."
  1332. 16 AskLoad "{0}"
  1333. 6 3
  1334. 15
  1335. 9
  1336. 0 796 "{1}"
  1337. 13
  1338. 11 00000355
  1339. 0 34 1 0
  1340. 2 147 1
  1341. 0 775 "{1}"
  1342. 13
  1343. 5 1
  1344. 25 1
  1345. 8 5
  1346. 6 5
  1347. 11 00000524
  1348. 0 776 "{1}" 0
  1349. 13
  1350. 11 00000524
  1351. 16 REFERERR "Can't change read-only attribute of {1}."
  1352. 16 AskLoad "{0}"
  1353. 6 3
  1354. 15
  1355. 9
  1356. 2 102 1 "{1}" 1 ""
  1357. 13
  1358. 5 1
  1359. 18 1
  1360. 11 00000652
  1361. 16 REFERErr "Can't open {1}."
  1362. 16 AskLoad "{0}"
  1363. 0 776 "{1}" "{5}"
  1364. 6 3
  1365. 15
  1366. 9
  1367. 0 16 "{0}" "!REFERINS"
  1368. 13
  1369. 8 6
  1370. 2 488 1 0 0 8192 "{6}" ""
  1371. 13
  1372. 5 1
  1373. 18 0
  1374. 11 00000871
  1375. 16 REFERERR "ReferenZing Version 1.0  has already been installed in auto-load macro {1}."
  1376. 2 147 1
  1377. 0 776 "{1}" "{5}"
  1378. 6 3
  1379. 15
  1380. 9
  1381. 0 6 "[16420]"
  1382. 5 1
  1383. 11 00001373
  1384. 2 488 1 0 0 0 "FUNCTION" ""
  1385. 13
  1386. 5 1
  1387. 18 0
  1388. 11 00001249
  1389. 0 6 "[27][16421]"
  1390. 0 37
  1391. 13
  1392. 7 ""
  1393. 18 0
  1394. 11 00001224
  1395. 6 2
  1396. 7 ""
  1397. 18 0
  1398. 11 00001071
  1399. 10 00001373
  1400. 10 00001224
  1401. 0 6 "[16423]"
  1402. 0 23
  1403. 13
  1404. 0 23
  1405. 13
  1406. 0 13 1 [X] "("
  1407. 13
  1408. 5 1
  1409. 3 1
  1410. 0 806 [X] [X]
  1411. 13
  1412. 8 7
  1413. 0 17 "{7}"
  1414. 13
  1415. 0 17 "{2}"
  1416. 13
  1417. 18 0
  1418. 11 00001224
  1419. 10 00001373
  1420. 0 6 "[35]"
  1421. 10 00001360
  1422. 16 REFERERR "Can't find {2} macro function in {1}."
  1423. 2 147 1
  1424. 16 AskLoad "{0}"
  1425. 0 776 "{1}" "{5}"
  1426. 6 3
  1427. 15
  1428. 9
  1429. 10 00000886
  1430. 0 6 "[35][13]'Add ReferenZing Version 1.0 to the Tools menu.[13]"
  1431. 0 6 "CALL {6}()[13]"
  1432. 0 30 0
  1433. 2 103 1
  1434. 13
  1435. 5 1
  1436. 18 1
  1437. 11 00001606
  1438. 0 34 1 0
  1439. 2 147 1
  1440. 0 776 "{1}" "{5}"
  1441. 16 REFERERR "Can't save {1}."
  1442. 16 AskLoad "{0}"
  1443. 6 3
  1444. 15
  1445. 9
  1446. 0 30 1
  1447. 16 "{6}"
  1448. 16 REFERMSG "ReferenZing has been added to the Tools menu."
  1449. 2 147 1
  1450. 0 776 "{1}" "{5}"
  1451. 6 3
  1452. 15
  1453. 9
  1454. 14 AskLoad
  1455. 0 2 "Choose Yes to install {0} as the new auto-load macro or No to quit."
  1456. 13
  1457. 11 00000135
  1458. 16 NewLoad "{0}"
  1459. 10 00000204
  1460. 16 REFERERR "ReferenZing Version 1 .0 NOT installed to Tools menu."
  1461. 6 1
  1462. 15
  1463. 9
  1464. 00014761
  1465.