mid__01A42EDE8A6CCF118F3E00805FD4AC5302478B1C@RED-76-MSG.dns.microsoft.com
22ca0001
From: Joe Souza
The error received is just a warning. It is telling you (for efficiency
reasons), that you have a macro declared that is never used, e.g. dead
code. I'm assuming that this is in your UI file, and you want this
macro to be called whenever you want to replace something. This can be
done by binding it to a keystroke combination, or by adding a new menu
item that will call the macro. In this example we'll bind it to a
keystroke combination.
What you need to do is find this line near the end of the UI file:
Replace()
This line tells the editor to call the Replace() function when the
Ctrl-R keystroke combination is pressed. Change the line so it looks
like this:
mReplace()
Note the function/macro name is now "mReplace" instead of "Replace".
You must then rebind the UI file to the editor. This can be done by
running "SC32 -be32 ui\tse", without the quotes, and replacing "ui\tse"
with the name of your UI file.
After binding the new UI, the editor will call your macro when Ctrl-R is
pressed.
> ----------
> From: Smith, Byron[SMTP:SmithB@nasd.com]
> Sent: Thursday, July 10, 1997 12:17 PM
> To: 'tsepro@semware.com'
> Subject: help for a beginner
>
> I am finally making the time to make an attempt at creating a macro.
> It
> seemed like it would be simple at first but it is turning out to be
> quite difficult for me especially since I have not done any programing
> since the days of gwbasic back in the early 80's...
>
> Anyway.. I am trying to create a macro that will do a search of a
> file
> and replace some pre-defined strings.
>
> There is one new string and about 20 old strings that need to be
> replaced.
>
> As an experiment I tried to play around with the example in the TSE
> Pro
> Macro ref guide that is used for Replace().
>
> My problem is:
>
> 1) It doesn't replace anything
> 2) It compiles with an error I can't find a reference to in the
> manuals
> 3) I really stink at Macro Programming.
>
> Any help would be appreciated.
>
> I am trying to change a piece of text like ABC/RAT to GOAT/EATER.
>
> I am using the following Macro source
>
> integer proc mReplace()
> string po[15], npo[15]
>
> po = " "
> npo = " "
> return(iif (Ask("Search for: ", po) and
> Ask ("replace with:", npo) ,
> Replace(po, npo, Query (ReplaceOptions)), FALSE))
> end
>
> I keep getting the following message when I compile or debug the macro
> source:
> Note 001 (1,14) 'mReplace' declared but never used
>
>
> What does this mean?
> Is there a better way to do this...
>
> any help is appreciated to get me in the right direction.
>
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|