Is it possible to use "if - else" block in functio

I want to make a simple toggle function, something like this:

[code]DestroyFunc function
AddToFunc function

  • I All (“A_Window”, Shaded) WindowShade Off {Break function}
  • I {Else} All (“A_Window”) WindowShade
    [/code]

This is damn simple but I don’t know how to make this “if - else” code block, I searched the forum and manpage, but nothing particular on this topic was found.

And thanks, like always :slight_smile:

I believe “TestRc” is what you’re looking for.

from the man:

Well, as someone has already vaguely mentioned you can use “TestRc” to
evaluate whether the last executed command (i.e. the command before
the TestRc line) within a function ran or not. That is essentially the
same as saying if… else.

Mind you, if you wanted anything more specific, I would probably advise
shelling out via PipeRead, to evaluate conditions there – although unless
you’re having to evaluate the output from a command (such as
interpolation) using TestRc should suffice. It does depend on what you’re
tring to do.

– Thomas Adam

Thank you guys, the problem has been solved.

BTW, my first FVWM “configuration-from-scratch” has been roughly finished!
(^o^)/