TIP: Click on subject to list as thread! ANSI
echo: semware
to: All
from: `Sammy Mitchell`
date: 2003-02-25 05:17:50
subject: [TSEPro] Re: Running a just-compiled macro repeatedly

From: "Sammy Mitchell" 
@Date: Mon, 24 Feb 2003 13:47:51 -0500
@Sender: semware-owner{at}sawasdi.apana.org.au



Fred Holmes wrote:
>What you say is correct, but I can't do that most of the
>time. If I were to select "Execute" from the menu presented
>after a successful compile, the macro would run against
>(process) the macro's own code itself, which isn't what I
>need.  I have to select cancel at that menu, then switch to
>the buffer/file that I want to run the macro against, and
>then Ctrl-X, macroname to run the macro then.

As someone else suggested, you could load the macro after
the compile, and execute it when you need to.

Note that the compile macro menu execute is a little bit of
a misnomer.  It actually calls LoadMacro() first, and then
ExecMacro().

ExecMacro() always attempts to run a macro already loaded,
into memory, if it can be found.

LoadMacro() always loads a macro from disk, even if it is
already loaded into memory.

Alternatively, you could change your  from
ExecMacro(), to using an Ask() prompt, get the macro to be
run, and calling LoadMacro(macro), and finally
ExecMacro(macro).  Does this make sense?

Something like (pseudo code, not fully fleshed out):

proc myExecMacroFromDisk()
    string s[_MAXPATH_] = ""

    while Ask("Execute Macro:", s, _EXECMACRO_HISTORY_)
        if LoadMacro(s)
            ExecMacro(s)
            break
        endif
        Warn("Error loading ", s)
    endwhile
end

>Under those circumstances, it seems to be running the
>loaded macro code from the previous compilation.  At least
>I only get good/changed results if I first purge the macro
>from the macro, purge menu.

>I've been trying to think through the logic of it, and
>perhaps it is something that just has to be, or something
>else will break?

Does what I said above make sense?

I'm not sure from reading your post if you have any other
questions about this or not.  If you do, feel free to let me
know.

--
Sammy Mitchell

--
TSEPro Mailing List
List Maintenance: www.semware.com/html/list.htm



---
[sawasdi.apana.org.au] (3:800/846.13)
* Origin: apana>>>>>fidonet
SEEN-BY: 633/267 270
@PATH: 800/846 1 640/954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.