home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 July & August / Pcwk78b98.iso / Smart30 / ENGLISH / PRODUCTS / LOTUS009.DSK / BUILDER.SAM < prev    next >
INI File  |  1993-06-14  |  18KB  |  1,370 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.     QMS-PS 810
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     This is the template for the build.smm macro.
  19.     
  20.     
  21.     
  22.     
  23.     740107301
  24.     7
  25.     736633139
  26.     10
  27.     8
  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. [ParaNum]
  54.     1
  55. [tag]
  56.     Body Text
  57.     2
  58.     [fnt]
  59.         Times New Roman
  60.         240
  61.         0
  62.         49152
  63.     [algn]
  64.         1
  65.         1
  66.         0
  67.         0
  68.         0
  69.     [spc]
  70.         33
  71.         273
  72.         1
  73.         0
  74.         0
  75.         1
  76.         100
  77.     [brk]
  78.         4
  79.     [line]
  80.         8
  81.         0
  82.         1
  83.         0
  84.         1
  85.         1
  86.         1
  87.         10
  88.         10
  89.         1
  90.     [spec]
  91.         0
  92.         2
  93.         
  94.         0
  95.         1
  96.         1
  97.         0
  98.         0
  99.         0
  100.         0
  101.     [nfmt]
  102.         280
  103.         1
  104.         2
  105.         .
  106.         ,
  107.         $
  108.     Body Text
  109.     0
  110.     0
  111. [tag]
  112.     Body Single
  113.     3
  114.     [fnt]
  115.         Times New Roman
  116.         240
  117.         0
  118.         49152
  119.     [algn]
  120.         1
  121.         1
  122.         0
  123.         0
  124.         0
  125.     [spc]
  126.         33
  127.         273
  128.         1
  129.         0
  130.         0
  131.         1
  132.         100
  133.     [brk]
  134.         4
  135.     [line]
  136.         8
  137.         0
  138.         1
  139.         0
  140.         1
  141.         1
  142.         1
  143.         10
  144.         10
  145.         1
  146.     [spec]
  147.         0
  148.         0
  149.         
  150.         0
  151.         1
  152.         1
  153.         0
  154.         0
  155.         0
  156.         0
  157.     [nfmt]
  158.         280
  159.         1
  160.         2
  161.         .
  162.         ,
  163.         $
  164.     Body Single
  165.     0
  166.     0
  167. [tag]
  168.     Bullet
  169.     4
  170.     [fnt]
  171.         Times New Roman
  172.         240
  173.         0
  174.         49152
  175.     [algn]
  176.         1
  177.         1
  178.         0
  179.         288
  180.         288
  181.     [spc]
  182.         33
  183.         273
  184.         1
  185.         0
  186.         0
  187.         1
  188.         100
  189.     [brk]
  190.         4
  191.     [line]
  192.         8
  193.         0
  194.         1
  195.         0
  196.         1
  197.         1
  198.         1
  199.         10
  200.         10
  201.         1
  202.     [spec]
  203.         0
  204.         0
  205.         <*0>
  206.         360
  207.         1
  208.         1
  209.         0
  210.         0
  211.         0
  212.         0
  213.     [nfmt]
  214.         272
  215.         1
  216.         2
  217.         .
  218.         ,
  219.         $
  220.     Bullet
  221.     0
  222.     0
  223. [tag]
  224.     Bullet 1
  225.     5
  226.     [fnt]
  227.         Times New Roman
  228.         240
  229.         0
  230.         49152
  231.     [algn]
  232.         1
  233.         1
  234.         288
  235.         288
  236.         288
  237.     [spc]
  238.         33
  239.         273
  240.         1
  241.         0
  242.         0
  243.         1
  244.         100
  245.     [brk]
  246.         4
  247.     [line]
  248.         8
  249.         0
  250.         1
  251.         0
  252.         1
  253.         1
  254.         1
  255.         10
  256.         10
  257.         1
  258.     [spec]
  259.         0
  260.         0
  261.         <*5>
  262.         0
  263.         1
  264.         1
  265.         0
  266.         0
  267.         0
  268.         0
  269.     [nfmt]
  270.         280
  271.         1
  272.         2
  273.         .
  274.         ,
  275.         $
  276.     Bullet 1
  277.     0
  278.     0
  279. [tag]
  280.     Number List
  281.     6
  282.     [fnt]
  283.         Times New Roman
  284.         240
  285.         0
  286.         49152
  287.     [algn]
  288.         1
  289.         1
  290.         360
  291.         360
  292.         360
  293.     [spc]
  294.         33
  295.         273
  296.         1
  297.         0
  298.         0
  299.         1
  300.         100
  301.     [brk]
  302.         4
  303.     [line]
  304.         8
  305.         0
  306.         1
  307.         0
  308.         1
  309.         1
  310.         1
  311.         10
  312.         10
  313.         1
  314.     [spec]
  315.         0
  316.         0
  317.         <*:>.
  318.         360
  319.         1
  320.         1
  321.         0
  322.         16
  323.         0
  324.         0
  325.     [nfmt]
  326.         272
  327.         1
  328.         2
  329.         .
  330.         ,
  331.         $
  332.     Number List
  333.     0
  334.     0
  335. [tag]
  336.     Subhead
  337.     7
  338.     [fnt]
  339.         Times New Roman
  340.         240
  341.         0
  342.         49155
  343.     [algn]
  344.         1
  345.         1
  346.         0
  347.         0
  348.         0
  349.     [spc]
  350.         33
  351.         273
  352.         1
  353.         72
  354.         72
  355.         1
  356.         100
  357.     [brk]
  358.         68
  359.     [line]
  360.         8
  361.         0
  362.         1
  363.         0
  364.         1
  365.         1
  366.         1
  367.         10
  368.         10
  369.         1
  370.     [spec]
  371.         0
  372.         1
  373.         
  374.         0
  375.         1
  376.         1
  377.         0
  378.         0
  379.         0
  380.         0
  381.     [nfmt]
  382.         272
  383.         1
  384.         2
  385.         .
  386.         ,
  387.         $
  388.     Body Text
  389.     0
  390.     0
  391. [tag]
  392.     Title
  393.     8
  394.     [fnt]
  395.         Arial
  396.         360
  397.         0
  398.         16385
  399.     [algn]
  400.         4
  401.         1
  402.         0
  403.         0
  404.         0
  405.     [spc]
  406.         33
  407.         446
  408.         1
  409.         144
  410.         72
  411.         1
  412.         100
  413.     [brk]
  414.         16
  415.     [line]
  416.         8
  417.         0
  418.         1
  419.         0
  420.         1
  421.         1
  422.         1
  423.         10
  424.         10
  425.         1
  426.     [spec]
  427.         0
  428.         0
  429.         
  430.         0
  431.         1
  432.         1
  433.         0
  434.         0
  435.         0
  436.         0
  437.     [nfmt]
  438.         272
  439.         1
  440.         2
  441.         .
  442.         ,
  443.         $
  444.     Title
  445.     0
  446.     0
  447. [tag]
  448.     Header
  449.     9
  450.     [fnt]
  451.         Times New Roman
  452.         240
  453.         0
  454.         49152
  455.     [algn]
  456.         1
  457.         1
  458.         0
  459.         0
  460.         0
  461.     [spc]
  462.         33
  463.         273
  464.         1
  465.         0
  466.         0
  467.         1
  468.         100
  469.     [brk]
  470.         4
  471.     [line]
  472.         8
  473.         0
  474.         1
  475.         0
  476.         1
  477.         1
  478.         1
  479.         10
  480.         10
  481.         1
  482.     [spec]
  483.         0
  484.         0
  485.         
  486.         0
  487.         1
  488.         1
  489.         0
  490.         0
  491.         0
  492.         0
  493.     [nfmt]
  494.         280
  495.         1
  496.         2
  497.         .
  498.         ,
  499.         $
  500.     Header
  501.     0
  502.     0
  503. [tag]
  504.     Footer
  505.     11
  506.     [fnt]
  507.         Times New Roman
  508.         240
  509.         0
  510.         49152
  511.     [algn]
  512.         1
  513.         1
  514.         0
  515.         0
  516.         0
  517.     [spc]
  518.         33
  519.         273
  520.         1
  521.         0
  522.         0
  523.         1
  524.         100
  525.     [brk]
  526.         4
  527.     [line]
  528.         8
  529.         0
  530.         1
  531.         0
  532.         1
  533.         1
  534.         1
  535.         10
  536.         10
  537.         1
  538.     [spec]
  539.         0
  540.         0
  541.         
  542.         0
  543.         1
  544.         1
  545.         0
  546.         0
  547.         0
  548.         0
  549.     [nfmt]
  550.         280
  551.         1
  552.         2
  553.         .
  554.         ,
  555.         $
  556.     Footer
  557.     0
  558.     0
  559. [lay]
  560.     Standard
  561.     513
  562.     [rght]
  563.         15840
  564.         12240
  565.         1
  566.         576
  567.         720
  568.         1
  569.         1080
  570.         576
  571.         0
  572.         1
  573.         0
  574.         1
  575.         0
  576.         2
  577.         1
  578.         576
  579.         11664
  580.         12
  581.         1
  582.         720
  583.         1
  584.         1440
  585.         1
  586.         2160
  587.         1
  588.         2880
  589.         1
  590.         3600
  591.         1
  592.         4320
  593.         1
  594.         5040
  595.         1
  596.         5760
  597.         1
  598.         6480
  599.         1
  600.         7200
  601.         1
  602.         7920
  603.         1
  604.         8640
  605.     [hrght]
  606.     [lyfrm]
  607.         1
  608.         11200
  609.         0
  610.         0
  611.         12240
  612.         1080
  613.         0
  614.         1
  615.         3
  616.         1 0 0 0 0 0 0
  617.         0
  618.         0
  619.         1
  620.     [frmlay]
  621.         1080
  622.         12240
  623.         1
  624.         1440
  625.         72
  626.         1
  627.         792
  628.         1440
  629.         0
  630.         1
  631.         0
  632.         1
  633.         1
  634.         0
  635.         1
  636.         1440
  637.         10800
  638.         2
  639.         2
  640.         4680
  641.         3
  642.         9360
  643.     [txt]
  644. >
  645.     [frght]
  646.     [lyfrm]
  647.         1
  648.         13248
  649.         0
  650.         15120
  651.         12240
  652.         15840
  653.         0
  654.         1
  655.         3
  656.         1 0 0 0 0 0 0
  657.         0
  658.         0
  659.         2
  660.     [frmlay]
  661.         15840
  662.         12240
  663.         1
  664.         1440
  665.         648
  666.         1
  667.         15192
  668.         1440
  669.         0
  670.         1
  671.         0
  672.         1
  673.         1
  674.         0
  675.         1
  676.         1440
  677.         10800
  678.         2
  679.         2
  680.         4680
  681.         3
  682.         9360
  683.     [txt]
  684. >
  685. [elay]
  686. [l1]
  687.     0
  688. [edoc]
  689. <:#284,11088>
  690.  
  691. <:#284,11088>
  692.  
  693. <:#284,11088>
  694.  
  695. <:#284,11088>
  696.  
  697. Define        ErrorMessage    "LTSCE01.DLL not found.  Copy the dll to your Ami Pro Directory."
  698.  
  699.  
  700. <:#284,11088>' Declare functions
  701.  
  702. <:#284,11088>Declare    FontDlg(Action, Hdlg, id)
  703.  
  704. <:#284,11088>Declare    CellEngine(action,Form)
  705.  
  706. <:#284,11088>Declare    StrPath(Filename)
  707.  
  708. <:#284,11088>Declare    SizeBox(Hdlg, NumberEditControls)
  709.  
  710. <:#284,11088>Declare GetFormats(Action)
  711.  
  712. <:#284,11088>
  713.  
  714. <:#284,11088>' WinApi defines
  715.  
  716. <:#284,11088>Define SetWindowText(hwnd, text)    DllCall("user,SetWindowText,IHC", %1, %2)
  717.  
  718. <:#284,11088>Define MoveWindow() DllCall("User,MoveWindow,HHHHHHA",%1,%2,%3,%4,%5,%6)
  719.  
  720. <:#284,11088>DEFINE GetWindowRect()    DllCall("user,GetWindowRect,HHN",%1,%2)
  721.  
  722. <:#284,11088>Define ShowWindow(hWnd, stuff) DllCall("user,ShowWindow,HHH", %1, %2)
  723.  
  724. <:#284,11088>Define getsystemmetrics() dllcall("user,getsystemmetrics,HH", %1)
  725.  
  726. <:#284,11088>
  727.  
  728. <:#284,11088>
  729.  
  730. <:#284,11088>Define    GetPrefix()    GetGlobalVar$("Prefix")
  731.  
  732. <:#284,11088>Define    GetSuffix()    GetGlobalVar$("Suffix")
  733.  
  734. <:#284,11088>
  735.  
  736. <:#284,11088>
  737.  
  738. @Subhead@<:#284,11088>Function Main()
  739.  
  740. <:#284,11088>DefStr hInstance;
  741.  
  742. <:#284,11088>
  743.  
  744. <:#284,11088>
  745.  
  746. <:#284,11088>Mac = GetRunningMacroFile$()
  747.  
  748. <:#284,11088>MacPath = StrPath(Mac)
  749.  
  750. <:#284,11088>FontDlg(1,0,0)
  751.  
  752. <:#284,11088>CellEngine(1,0)
  753.  
  754. <:#284,11088>GetFormats(1)
  755.  
  756. <:#284,11088>FillEdit(1000, HelpText)
  757.  
  758. <:#284,11088>SetDlgCallBack(0,"{Mac}!InitDlg")
  759.  
  760. <:#284,11088>For Id = 8001 to 8009
  761.  
  762. <:#284,11088>    SetDlgCallBack(Id, "{Mac}!DataChange")
  763.  
  764. <:#284,11088>Next
  765.  
  766. <:#284,11088>
  767.  
  768. <:#284,11088>FillEdit(1001, Value1Text)
  769.  
  770. <:#284,11088>FillEdit(1002, Value2Text)
  771.  
  772. <:#284,11088>FillEdit(1003, Value3Text)
  773.  
  774. <:#284,11088>FillEdit(1004, Value4Text)
  775.  
  776. <:#284,11088>FillEdit(1005, Value5Text)
  777.  
  778. <:#284,11088>FillEdit(1006, Value6Text)
  779.  
  780. <:#284,11088>FillEdit(1007, Value7Text)
  781.  
  782. <:#284,11088>FillEdit(1008, Value8Text)
  783.  
  784. <:#284,11088>FillEdit(1009, Value9Text)
  785.  
  786. <:#284,11088>
  787.  
  788. <:#284,11088>
  789.  
  790. <:#284,11088>Box = DialogBox(".","Deprec")
  791.  
  792. <:#284,11088>If Box = 3
  793.  
  794. <:#284,11088>    ' box closed with the copy button
  795.  
  796. <:#284,11088>    Answer = GetDialogField$(8010)
  797.  
  798. <:#284,11088>    ClipBoardWrite(Answer,1)
  799.  
  800. <:#284,11088>Endif
  801.  
  802. <:#284,11088>
  803.  
  804. <:#284,11088>FontDlg(4,0,0)
  805.  
  806. <:#284,11088>CellEngine(0,0)
  807.  
  808. <:#284,11088>GetFormats(0)
  809.  
  810. <:#284,11088>End function
  811.  
  812. <:#284,11088>
  813.  
  814. <:#284,11088>
  815.  
  816. @Subhead@<:#284,11088>Function DataChange(Hdlg, id, value)
  817.  
  818. <:#284,11088>IgnoreKeyBoard(2)
  819.  
  820. <:#284,11088>DefStr Allowance;
  821.  
  822. Value1 = GetDlgItemText(hDlg, 8001) 
  823.  
  824. Value2 = GetDlgItemText(hDlg, 8002)
  825.  
  826. value3 = GetDlgItemText(hDlg, 8003)
  827.  
  828. value4 = GetDlgItemText(hDlg, 8004)
  829.  
  830. value5 = GetDlgItemText(hDlg, 8005)
  831.  
  832. value6 = GetDlgItemText(hdlg, 8006)
  833.  
  834. value7 = GetDlgItemText(hdlg, 8007)
  835.  
  836. value8 = GetDlgItemText(hdlg, 8008)
  837.  
  838. value9 = GetDlgItemText(hdlg, 8009)
  839.  
  840. <:#284,11088>Answer = CellEngine(3,Formula)      
  841.  
  842. Answer = FormatNum$("","",2,Answer * 1)
  843.  
  844. <:#284,11088>SetDlgItemText(hDlg, 8010, Answer)
  845.  
  846. <:#284,11088>End Function
  847.  
  848. <:#284,11088>
  849.  
  850. @Subhead@<:#284,11088>Function InitDlg(hDlg, id, value)
  851.  
  852. <:#284,11088>' use the fontdlg function to display the following control with a small font
  853.  
  854. <:#284,11088>HourGlass(on)
  855.  
  856. <:#284,11088>SetWindowText(Hdlg, DialogTitle)
  857.  
  858. <:#284,11088>FontDlg(3, Hdlg, 1000)
  859.  
  860. <:#284,11088>For Id = 1 to 9
  861.  
  862. <:#284,11088>    FontDlg(3, Hdlg, id + 1000)
  863.  
  864. <:#284,11088>    FontDlg(3, Hdlg, id + 8000)
  865.  
  866. <:#284,11088>    If Id <;> NumberItems
  867.  
  868. <:#284,11088>        ShowWindow(GetDlgItem(Hdlg, id + 1000), 0)
  869.  
  870. <:#284,11088>        ShowWindow(GetDlgItem(Hdlg, id + 8000), 0)
  871.  
  872. <:#284,11088>    Endif
  873.  
  874. <:#284,11088>Next
  875.  
  876. <:#284,11088>FontDlg(3, Hdlg, 8010)
  877.  
  878. <:#284,11088>FontDlg(3, Hdlg, 8011)
  879.  
  880. <:#284,11088>SizeBox(Hdlg, NumberItems)
  881.  
  882. <:#284,11088>HourGlass(off)
  883.  
  884. <:#284,11088>
  885.  
  886. <:#284,11088>End Function
  887.  
  888. <:#284,11088>
  889.  
  890. <:#284,11088>
  891.  
  892. @Subhead@<:#284,11088>Function SizeBox(Hdlg, NumberEditControls)
  893.  
  894. <:#284,11088>Define    Repaint 1
  895.  
  896. <:#284,11088>Dim Rect(4)
  897.  
  898. <:#284,11088>Stat = GetSystemMetrics(4)
  899.  
  900. <:#284,11088>GetWindowRect(Hdlg, &Rect)
  901.  
  902. <:#284,11088>DeltaX = Rect(3) - Rect(1);
  903.  
  904. <:#284,11088>NumberIncrease = (NumberEditControls - 3);    
  905.  
  906. <:#284,11088>If NumberIncrease <<0
  907.  
  908. <:#284,11088>    NumberIncrease = 0
  909.  
  910. <:#284,11088>Endif
  911.  
  912. <:#284,11088>If Stat = 20
  913.  
  914. <:#284,11088>    DeltaY = (20 * NumberIncrease) + 140;
  915.  
  916. <:#284,11088>Else
  917.  
  918. <:#284,11088>    DeltaY = (26 * NumberIncrease) + 190;
  919.  
  920. <:#284,11088>Endif
  921.  
  922. <:#284,11088>MoveWindow(Hdlg, Rect(1), Rect(2), DeltaX, DeltaY, Repaint)
  923.  
  924. <:#284,11088>End Function
  925.  
  926. <:#284,11088>
  927.  
  928. <:#284,11088>
  929.  
  930. @Subhead@<:#284,11088>Function GetFormats(Action)
  931.  
  932. <:#284,11088>iCurrency = GetProfileString$("Intl","iCurrency","Win.ini")
  933.  
  934. <:#284,11088>currency = GetProfileString$("Intl","sCurrency","Win.ini")
  935.  
  936. <:#284,11088>AllocGlobalVar("Prefix",1)
  937.  
  938. <:#284,11088>AllocGlobalVar("Suffix",1)
  939.  
  940. <:#284,11088>
  941.  
  942. <:#284,11088>Switch Action
  943.  
  944. <:#284,11088>    Case 1     ' turn this on
  945.  
  946. <:#284,11088>        Switch iCurrency
  947.  
  948. <:#284,11088>            Case 0
  949.  
  950. <:#284,11088>                Prefix = Currency
  951.  
  952. <:#284,11088>                Suffix = ""
  953.  
  954. <:#284,11088>            Case 1
  955.  
  956. <:#284,11088>                Prefix = ""
  957.  
  958. <:#284,11088>                Suffix = Currency
  959.  
  960. <:#284,11088>            Case 2
  961.  
  962. <:#284,11088>                Prefix = StrCat$(Currency," ")
  963.  
  964. <:#284,11088>                Suffix = ""
  965.  
  966. <:#284,11088>            Case 3
  967.  
  968. <:#284,11088>                Prefix = ""
  969.  
  970. <:#284,11088>                Suffix = StrCat$(" ",Currency)
  971.  
  972. <:#284,11088>        endSwitch
  973.  
  974. <:#284,11088>        SetGlobalVar("Suffix",Suffix)
  975.  
  976. <:#284,11088>        SetGlobalVar("Prefix",Prefix)
  977.  
  978. <:#284,11088>
  979.  
  980. <:#284,11088>    Case 0    ' free globals
  981.  
  982. <:#284,11088>        FreeGlobalVar("Suffix")
  983.  
  984. <:#284,11088>        FreeGlobalVar("Prefix")
  985.  
  986. <:#284,11088>        
  987.  
  988. <:#284,11088>EndSwitch
  989.  
  990. <:#284,11088>End Function
  991.  
  992. <:#284,11088>
  993.  
  994. <:#284,11088>
  995.  
  996. <:#284,11088>
  997.  
  998. @Subhead@<:#284,11088>function strpath(filename)
  999.  
  1000. <:#284,11088>defstr char;
  1001.  
  1002. <:#284,11088>Length = len(FileName)
  1003.  
  1004. <:#284,11088>WHILE "\" != Assign(&Char, MID$(FileName, Length, 1))
  1005.  
  1006. <:#284,11088>    Length = Length - 1
  1007.  
  1008. <:#284,11088>WEND
  1009.  
  1010. <:#284,11088>InFileName = Right$(FileName, (len(FileName) - Length))
  1011.  
  1012. <:#284,11088>InDir = Left$(FileName, Length - 1) 
  1013.  
  1014. <:#284,11088>if right$(indir, 1) <<<;> "\"
  1015.  
  1016. <:#284,11088>    indir = strcat$(indir, "\")
  1017.  
  1018. <:#284,11088>endif
  1019.  
  1020. <:#284,11088>return indir
  1021.  
  1022. <:#284,11088>end function
  1023.  
  1024. <:#284,11088>
  1025.  
  1026. <:#284,11088>
  1027.  
  1028. <:#284,11088>
  1029.  
  1030. <:p<* >>
  1031.  
  1032. @Subhead@<:#284,11088>Function CellEngine(Action,Form)
  1033.  
  1034. <:#284,11088>'Available Actions
  1035.  
  1036. <:#284,11088>'    1         Start the engine and allocate globalvar
  1037.  
  1038. <:#284,11088>'    2        Return the handle to the instance of the sheet
  1039.  
  1040. <:#284,11088>'    3        Pass the formula as the second param
  1041.  
  1042. <:#284,11088>'    0        Shut everything down
  1043.  
  1044. <:#284,11088>'    Default    Expect a formula and return an answer
  1045.  
  1046. <:#284,11088>
  1047.  
  1048. <:#284,11088>' these defines may be useful at the beginning of your macro
  1049.  
  1050. <:#284,11088>Define StartEngine    1
  1051.  
  1052. <:#284,11088>Define GetInstance    2
  1053.  
  1054. <:#284,11088>Define CloseEngine    0
  1055.  
  1056. <:#284,11088>
  1057.  
  1058. <:#284,11088>Define    CECREATEINSTANCE(LPHANDLE)    DllCall("LTSCE01.DLL,CECREATEINSTANCE,HO",%1)
  1059.  
  1060. <:#284,11088>Define    CEDESTROYINSTANCE(HANDLE)    DllCall("LTSCE01.DLL,CEDESTROYINSTANCE,HH",%1)
  1061.  
  1062. <:#568,11088>Define    CECALCNOW(HINSTANCE, lpFormula, lpOutPut)    DllCall("LTSCE01.DLL,CECALCNOW,HHCC",%1,%2,%3)
  1063.  
  1064. <:#284,11088>
  1065.  
  1066. <:#284,11088>DefStr hInstance, Answer, Var;
  1067.  
  1068. <:#284,11088>Mac = GetRunningMacroFile$()
  1069.  
  1070. <:#284,11088>GlobalInstance = StrCat$(Mac,"hIstance")
  1071.  
  1072. <:#284,11088>AmiDir = GetAmiDirectory$()
  1073.  
  1074. <:#284,11088>
  1075.  
  1076. <:#284,11088>Switch Action
  1077.  
  1078. <:#284,11088>    Case 1
  1079.  
  1080. <:#284,11088>        ' start the engine
  1081.  
  1082. <:#284,11088>        LibId = DLLLoadLib("{AmiDir}LTSCE01.DLL","CECreateInstance","HO")
  1083.  
  1084. <:#284,11088>        If LibId = 0
  1085.  
  1086.             Message(ErrorMessage)    
  1087.  
  1088. <:#284,11088>            Return -1;
  1089.  
  1090. <:#284,11088>        Endif
  1091.  
  1092. <:#284,11088>        RetVal = CECREATEINSTANCE(&hInstance)
  1093.  
  1094. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1095.  
  1096. <:#284,11088>        AllocGlobalVar("{Mac}LibId",1)
  1097.  
  1098. <:#284,11088>        SetGlobalVar("{Mac}Libid",LibId)
  1099.  
  1100. <:#284,11088>        SetGlobalVar("{GlobalInstance}",hInstance)
  1101.  
  1102. <:#284,11088>        Return hInstance;
  1103.  
  1104. <:#284,11088>        Break;
  1105.  
  1106. <:#284,11088>
  1107.  
  1108. <:#284,11088>    Case 2
  1109.  
  1110. <:#284,11088>        ' return the handle to the instance of the sheet
  1111.  
  1112. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1113.  
  1114. <:#284,11088>        hInstance = GetGlobalVar$("{GlobalInstance}")
  1115.  
  1116. <:#284,11088>        Return hInstance;
  1117.  
  1118. <:#284,11088>        Break;
  1119.  
  1120. <:#284,11088>
  1121.  
  1122. <:#284,11088>    Case 3
  1123.  
  1124. <:#284,11088>        ' Calculate the formula and return the answer
  1125.  
  1126. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1127.  
  1128. <:#284,11088>        hInstance = GetGlobalVar$("{GlobalInstance}")
  1129.  
  1130. <:#284,11088>        CECalcNow(hInstance,"{Form}",&Answer)
  1131.  
  1132. <:#284,11088>        Return Answer;
  1133.  
  1134. <:#284,11088>        Break;
  1135.  
  1136. <:#284,11088>    
  1137.  
  1138. <:#284,11088>
  1139.  
  1140. <:#284,11088>    Case 0
  1141.  
  1142. <:#284,11088>        ' destroy the instance of the sheet and free the global var and libid
  1143.  
  1144. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1145.  
  1146. <:#284,11088>        AllocGlobalVar("{Mac}LibId",1)
  1147.  
  1148. <:#284,11088>        hInstance = GetGlobalVar$("{GlobalInstance}")
  1149.  
  1150. <:#284,11088>        LibId = GetGlobalVar$("{Mac}LibId")
  1151.  
  1152. <:#284,11088>        If hInstance
  1153.  
  1154. <:#284,11088>            CEDestroyInstance(hInstance)
  1155.  
  1156. <:#284,11088>            DllFreeLib(Libid)
  1157.  
  1158. <:#284,11088>        Endif
  1159.  
  1160. <:#284,11088>        FreeGlobalVar("{GlobalInstance}")
  1161.  
  1162. <:#284,11088>        FreeGlobalVar("{Mac}LibId")
  1163.  
  1164. <:#284,11088>        Break;
  1165.  
  1166. <:#284,11088>
  1167.  
  1168. <:#284,11088>    Default
  1169.  
  1170. <:#284,11088>EndSwitch
  1171.  
  1172. <:#284,11088>End Function
  1173.  
  1174. <:#284,11088>
  1175.  
  1176. <:#284,11088>
  1177.  
  1178. <:#284,11088>
  1179.  
  1180. <:#284,11088>
  1181.  
  1182. <:#284,11088>
  1183.  
  1184. @Subhead@<:#284,11088>Function FontDlg(Action, Hdlg, id)
  1185.  
  1186. <:#284,11088>' 1    Create a font and allocvar
  1187.  
  1188. <:#284,11088>' 2    Return the handle of the create font 
  1189.  
  1190. <:#284,11088>' 3    Set the id specified to the font
  1191.  
  1192. <:#284,11088>' 4    Freeglobalvar and delete created object
  1193.  
  1194. <:#284,11088>
  1195.  
  1196. @Outline2@<:#568,11088>define    CreateFontDLG()        DllCall("gdi,CreateFont,HHHHHHHHHHHHHHC", %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14)
  1197.  
  1198. @Outline2@<:#284,11088>define    DeleteObjectDLG(handle)    DllCall("gdi,DeleteObject,HH", %1)
  1199.  
  1200. @Outline2@<:#568,11088>define    SendMessageDLG(hwnd, msg, wpara, lparm)    DllCall("user,SendMessage,HHHHJ", %1, %2, %3, %4)
  1201.  
  1202. @Outline2@<:#284,11088>
  1203.  
  1204. @Outline2@<:#284,11088>Mac = GetRunningMacroFile$()
  1205.  
  1206. @Outline2@<:#284,11088>
  1207.  
  1208. <:#284,11088>Switch Action
  1209.  
  1210. <:#284,11088>    Case 1    ' Create the font and store it
  1211.  
  1212. @Outline2@<:#284,11088>        Font = CreateFontDLG(13, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv")
  1213.  
  1214. <:#284,11088>        AllocGlobalVar("{Mac}FontHandle",1)
  1215.  
  1216. <:#284,11088>        If Font
  1217.  
  1218. <:#284,11088>            SetGlobalVar("{Mac}FontHandle",Font)
  1219.  
  1220. <:#284,11088>            Return Font
  1221.  
  1222. <:#284,11088>        Else
  1223.  
  1224. <:#284,11088>            Return 0;    ' no font
  1225.  
  1226. <:#284,11088>        Endif
  1227.  
  1228. <:#284,11088>        Break;
  1229.  
  1230. <:#284,11088>    Case 2    ' Return the handle to the font
  1231.  
  1232. <:#284,11088>        Handle = GetGlobalVar$("{Mac}FontHandle")
  1233.  
  1234. <:#284,11088>        If Handle 
  1235.  
  1236. <:#284,11088>            Return Handle
  1237.  
  1238. <:#284,11088>        Else
  1239.  
  1240. <:#284,11088>            Return 0
  1241.  
  1242. <:#284,11088>        Endif
  1243.  
  1244. <:#284,11088>
  1245.  
  1246. <:#284,11088>    Case 3    ' Set the id to the font
  1247.  
  1248. <:#284,11088>        Handle = GetGlobalVar$("{Mac}FontHandle")
  1249.  
  1250. <:#284,11088>        If Handle 
  1251.  
  1252. <:#284,11088>            IdControl = GetDlgITem(Hdlg, id)
  1253.  
  1254. <:#284,11088>            SendMessageDlg(idControl, 0x30, Handle, 0)
  1255.  
  1256. <:#284,11088>            Return 1
  1257.  
  1258. <:#284,11088>        Else
  1259.  
  1260. <:#284,11088>            Return 0
  1261.  
  1262. <:#284,11088>        Endif
  1263.  
  1264. <:#284,11088>        Break;        
  1265.  
  1266. <:#284,11088>        
  1267.  
  1268. <:#284,11088>    Case 4    ' Delete the font and clear the var
  1269.  
  1270. <:#284,11088>        Handle = GetGlobalVar$("{Mac}FontHandle")
  1271.  
  1272. <:#284,11088>        If Handle
  1273.  
  1274. <:#284,11088>            DeleteObjectDLG(Handle)
  1275.  
  1276. <:#284,11088>            Stat = 1    
  1277.  
  1278. <:#284,11088>        Else
  1279.  
  1280. <:#284,11088>            Stat = 0
  1281.  
  1282. <:#284,11088>        Endif
  1283.  
  1284. <:#284,11088>        FreeGlobalVar("{Mac}FontHandle")
  1285.  
  1286. <:#284,11088>        Return Stat        
  1287.  
  1288. <:#284,11088>    Default
  1289.  
  1290. <:#284,11088>        Message("Fontdlg received an invalid parameter {Action}")
  1291.  
  1292. <:#284,11088>EndSwitch    
  1293.  
  1294. <:#284,11088>
  1295.  
  1296. <:#284,11088>End Function
  1297.  
  1298. <:#284,11088>
  1299.  
  1300. @Subhead@<:#284,11088>
  1301.  
  1302. <:#284,11088>
  1303.  
  1304. <:#284,11088>
  1305.  
  1306. <:#284,11088>
  1307.  
  1308. <:#284,11088>
  1309.  
  1310. <:#284,11088>
  1311.  
  1312. <:#284,11088>DIALOG    Deprec
  1313.  
  1314. <:#284,11088>-2134376448    23    78    50    158    159    ""    ""    "Dialog Title"
  1315.  
  1316. <:#284,11088>FONT    8    "Helv"
  1317.  
  1318. <:#284,11088>60    28    33    12    8001    1350631552    "edit"    ""    0 
  1319.  
  1320. <:#284,11088>60    42    33    12    8002    1350631552    "edit"    ""    0 
  1321.  
  1322. <:#284,11088>60    56    33    12    8003    1350631552    "edit"    ""    0 
  1323.  
  1324. <:#284,11088>60    70    33    12    8004    1350631552    "edit"    ""    0 
  1325.  
  1326. <:#284,11088>60    84    33    12    8005    1350631552    "edit"    ""    0 
  1327.  
  1328. <:#284,11088>60    98    33    12    8006    1350631552    "edit"    ""    0 
  1329.  
  1330. <:#284,11088>60    112    33    12    8007    1350631552    "edit"    ""    0 
  1331.  
  1332. <:#284,11088>60    126    33    12    8008    1350631552    "edit"    ""    0 
  1333.  
  1334. <:#284,11088>60    140    33    12    8009    1350631552    "edit"    ""    0 
  1335.  
  1336. <:#284,11088>114    3    40    14    1    1342373889    "button"    "OK"    0 
  1337.  
  1338. <:#284,11088>114    19    40    14    3    1342373888    "button"    "Copy"    0 
  1339.  
  1340. <:#284,11088>106    52    38    8    8010    1342177282    "static"    ""    0 
  1341.  
  1342. <:#284,11088>98    39    57    29    20    1342177287    "button"    "Answer"    0 
  1343.  
  1344. <:#284,11088>4    2    103    24    1000    1342177280    "static"    ""    0 
  1345.  
  1346. <:#284,11088>4    30    56    8    1001    1342177280    "static"    "value1text"    0 
  1347.  
  1348. <:#284,11088>4    44    56    8    1002    1342177280    "static"    "value2text"    0 
  1349.  
  1350. <:#284,11088>4    58    56    8    1003    1342177280    "static"    "value3text"    0 
  1351.  
  1352. <:#284,11088>4    72    56    8    1004    1342177280    "static"    "value4text"    0 
  1353.  
  1354. <:#284,11088>4    86    56    8    1005    1342177280    "static"    "value5text"    0 
  1355.  
  1356. <:#284,11088>3    99    56    8    1006    1342177280    "static"    "value6text"    0 
  1357.  
  1358. <:#284,11088>3    111    56    8    1007    1342177280    "static"    "value7text"    0 
  1359.  
  1360. <:#284,11088>2    123    56    8    1008    1342177280    "static"    "value8text"    0 
  1361.  
  1362. <:#284,11088>1    141    56    8    1009    1342177280    "static"    "value9text"    0 
  1363.  
  1364. <:#284,11088>END DIALOG
  1365.  
  1366. >
  1367.  
  1368. [Embedded]
  1369. 00018250
  1370.