delet macro

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

delet macro

flo statistik
hi,

ist it possible to delete a macro?
Reply | Threaded
Open this post in threaded view
|

Re: delet macro

Keith McCormick
Hi Flo,

If you mean what I think you do, you only have to exit SPSS and
return, or just define a new macro with the same name. The old macro
will cease to exist.

Did you have something else in mind?

HTH, Keith
www.keithmccormick.com

On 8/8/07, flo statistik <[hidden email]> wrote:
> hi,
>
> ist it possible to delete a macro?
>
Reply | Threaded
Open this post in threaded view
|

Fwd: delet macro

flo statistik
Hi Keith,

no I want to delete the macro within a session.

My Problem was (I fixed it but not verry elegant) the following:

I wrote an macro which defined a new one. In the macro call one can choose
the name of the new macro.

example.

!mac /newmac = !example /... /...

if !example is not defined at that moment everything is fine. But if its
defined (for example because one called the macro with another dataset) then
spss expanded !example and my macro (!mac) didn't work. set mexpand don't
work if its in the macrodefinition. Now one has to give the new macroname in
quotes.

!mac /newmac = '!example'

this works but isn't elegant.

flo
Reply | Threaded
Open this post in threaded view
|

Re: delet macro

Keith McCormick
Hi Flo,

No way to kill it during the session. Sounds tricky in any case!

What is the purpose of the macro? Perhaps this is a great time to give
python a try. If you explain the macro in full perhaps someone who
knows python on the list (I know some) can figure out a new solution.

Best, Keith
www.keithmccormick.com

On 8/9/07, flo statistik <[hidden email]> wrote:

> Hi Keith,
>
> no I want to delete the macro within a session.
>
> My Problem was (I fixed it but not verry elegant) the following:
>
> I wrote an macro which defined a new one. In the macro call one can choose
> the name of the new macro.
>
> example.
>
> !mac /newmac = !example /... /...
>
> if !example is not defined at that moment everything is fine. But if its
> defined (for example because one called the macro with another dataset) then
> spss expanded !example and my macro (!mac) didn't work. set mexpand don't
> work if its in the macrodefinition. Now one has to give the new macroname in
> quotes.
>
> !mac /newmac = '!example'
>
> this works but isn't elegant.
>
> flo
>
Reply | Threaded
Open this post in threaded view
|

Fwd: delet macro

flo statistik
Hi Keith,

you are definetly right. One can do this with python. By I think its allways
the same problem when I want to call a macro ore a python function in my
syntaxeditor (I don't want to leave the syntax to keep it simple for the
users which work with this project in the future). Anyway I have to move on
and I have a stopgap which is rather elegant but works.

Nevertheless thanks for your help!

Flo

p.s. one should have definetly more time to find nice solutions.