Update for new 2.7.0 development work.
[fvwm.git] / doc / commands / TestRc.xml
blobbd3316d51f4d138772543996f7a970fbc4a8c033
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!-- $Id: TestRc.xml,v 1.4 2007/10/06 09:17:36 domivogt Exp $ -->
3 <!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
4   "../docbook-xml/docbookx.dtd"
6 <!ENTITY % myents SYSTEM "../fvwm.ent" >
7 %myents;
8 ]>
11 <section id='TestRc'>
12 <title>TestRc</title>
14 <cmdsynopsis>
15         <command>TestRc</command
16         ><arg choice='opt'
17                 >(<optional>!</optional
18                 ><replaceable>returncode</replaceable
19         >)</arg
20         ><arg choice='plain'
21                 ><replaceable>command</replaceable
22         ></arg>
23 </cmdsynopsis>
24 <!--/command-->
26 <para>Performs
27 <replaceable>command</replaceable>
28 if the last conditional command returned the value
29 <replaceable>returncode</replaceable>.
30 Instead of the numeric values 0 (no match), 1 (match), -1 (error),
31 and -2 (break) the symbolic names "<fvwmopt cmd="TestRc" opt="NoMatch"/>",
32 "<fvwmopt cmd="TestRc" opt="Match"/>", "<fvwmopt cmd="TestRc" opt="Error"/>" and
33 "<fvwmopt cmd="TestRc" opt="Break"/>" can be used.  If no
34 <replaceable>returncode</replaceable>
35 is given, the default 0 is assumed.  If the return code is
36 prefixed with '!', the command is executed if
37 <replaceable>returncode</replaceable>
38 does not match the value returned by the conditional command.
39 The <emphasis remap='B'>TestRc</emphasis>
40 command can only be used inside functions.  If the
41 <replaceable>command</replaceable>
42 is another conditional command, the previous return code is
43 replaced by the new one.  Example:</para>
45 <programlisting>
46 <fvwmref cmd="AddToFunc"/> ToggleXterm
47 + I <fvwmref cmd="All"/> (my_xtermwindow) <fvwmref cmd="Close"/>
48 + I TestRc (NoMatch) <fvwmref cmd="Exec"/> xterm -T my_xtermwindow
49 </programlisting>
52 </section>