__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<!DOCTYPE html>
<html lang="es" dir="ltr">
<head>
<base href="../../../../">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Definir condiciones</title>
<link rel="shortcut icon" href="media/navigation/favicon.ico">
<link type="text/css" href="normalize.css" rel="Stylesheet">
<link type="text/css" href="prism.css" rel="Stylesheet">
<link type="text/css" href="default.css" rel="Stylesheet">
<script type="text/javascript" src="polyfills.js"></script><script type="text/javascript" src="languages.js"></script><script type="text/javascript" src="es/langnames.js"></script><script type="text/javascript" src="flexsearch.debug.js"></script><script type="text/javascript" src="prism.js"></script><script type="text/javascript" src="help2.js" defer></script><script type="text/javascript" src="a11y-toggle.js" defer></script><script type="text/javascript" src="paginathing.js" defer></script><script type="text/javascript" src="es/bookmarks.js" defer></script><script type="text/javascript" src="es/contents.js" defer></script><script type="text/javascript" src="help.js" defer></script><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<header id="TopLeftHeader"><a class="symbol" href="es/text/shared/05/new_help.html"><div></div></a><a class="logo" href="es/text/shared/05/new_help.html"><p dir="auto">Ayuda de LibreOffice 25.2</p></a><div class="dropdowns"><div class="modules">
<button type="button" data-a11y-toggle="modules-nav" id="modules" aria-haspopup="true" aria-expanded="false" aria-controls="modules-nav">Módulo</button><nav id="modules-nav" hidden=""></nav>
</div></div></header><aside class="leftside"><input id="accordion-1" name="accordion-menu" type="checkbox"><label for="accordion-1" dir="auto">Contenido</label><div id="Contents" class="contents-treeview"></div></aside><div id="SearchFrame"><div id="Bookmarks">
<input id="search-bar" type="search" class="search" placeholder="Buscar en los marcadores del módulo elegido" dir="auto"><div class="nav-container" tabindex="0"><nav class="index" dir="auto"></nav></div>
</div></div>
<div id="DisplayArea" itemprop="softwareHelp" itemscope="true" itemtype="http://schema.org/SoftwareApplication">
<noscript><div id="WarnJS"><h1 dir="auto">Active JavaScript en el navegador para mostrar las páginas de ayuda de LibreOffice.</h1></div></noscript>
<a id="bm_id3145828"></a><meta itemprop="keywords" content="expresiones lógicas"> <meta itemprop="keywords" content="formular condiciones"> <meta itemprop="keywords" content="condiciones,en campos y secciones"> <meta itemprop="keywords" content="campos,definir condiciones"> <meta itemprop="keywords" content="secciones,definir condiciones"> <meta itemprop="keywords" content="variables,en condiciones"> <meta itemprop="keywords" content="datos del usuario,en condiciones"> <meta itemprop="keywords" content="bases de datos,en condiciones"> <meta itemprop="keywords" content="ocultar,campos de bases de datos">
<h1 id="hd_id3145828" dir="auto">
<a id="defining_conditions"></a>Definir condiciones</h1>
<p id="par_id3145242" class="paragraph" dir="auto">Las condiciones son expresiones lógicas que permiten controlar la visualización de <a target="_top" href="es/text/swriter/01/04090000.html">campos</a> y <a target="_top" href="es/text/swriter/01/04020000.html">secciones</a> en el documento. Aunque los ejemplos siguientes se aplican a los campos, también sirven para las secciones.</p>
<p id="par_id3147171" class="paragraph" dir="auto">Puede definir condiciones para los campos siguientes:</p>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3151185" class="listitem" dir="auto">Texto condicional: muestra el texto A si la condición es verdadera o el texto B si la condición es falsa.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3149289" class="listitem" dir="auto">Texto oculto: oculta el contenido del campo si la condición es verdadera.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3145412" class="listitem" dir="auto">Párrafo oculto: oculta el párrafo si la condición es verdadera.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3147515" class="listitem" dir="auto">Cualquier registro y Registro siguiente: controla el acceso a los registros de la base de datos.</p>
</li>
</ol>
<p id="par_id3149802" class="paragraph" dir="auto">La manera más sencilla de definir una condición es escribir la expresión lógica directamente en el cuadro <span class="emph">Condición</span> mediante los valores siguientes:</p>
<table border="1" class="" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3153677" class="tablecontentintable" dir="auto">TRUE</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3152960" class="tablecontentintable" dir="auto">La condición se cumple siempre. Otra alternativa consiste en introducir cualquier valor distinto de 0, como texto de condición.</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3155900" class="tablecontentintable" dir="auto">FALSE</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3154191" class="tablecontentintable" dir="auto">La condición no se cumple. Otra alternativa consiste en introducir el valor 0.</p>
</td>
</tr>
</table>
<br>
<div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id3147090" dir="auto">Si deja el cuadro <span class="emph">Condición</span> vacío, se interpreta que la condición no se ha cumplido.</p></div>
</div>
<br>
<p id="par_id3148980" class="paragraph" dir="auto">Si define una condición, use los mismos <a target="_top" href="es/text/swriter/02/14020000.html">elementos</a> para definir una fórmula, en concreto operadores comparativos, funciones matemáticas y estadísticas, formatos numéricos, variables y constantes.</p>
<p id="par_id3153638" class="paragraph" dir="auto">Puede usar los tipos de variables siguientes cuando defina una condición:</p>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3155135" class="listitem" dir="auto"><a target="_top" href="es/text/swriter/02/14020000.html">Variables de LibreOffice</a> predefinidas que usan estadísticas en las propiedades de los documentos</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3156273" class="listitem" dir="auto">Variables personalizadas que se crean con el campo «Establecer variable»</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3149174" class="listitem" dir="auto">Variables basadas en los datos de usuario</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3145781" class="listitem" dir="auto">Variables basadas en el contenido de los campos de la base de datos</p>
</li>
</ol>
<p id="par_id3155916" class="paragraph" dir="auto">No puede usar variables internas, como la página y los números de los capítulos en la expresión de las condiciones.</p>
<h2 id="hd_id3151375" dir="auto">Condiciones y variables</h2>
<p id="par_id3150122" class="paragraph" dir="auto">Los ejemplos siguientes utilizan una variable llamada «x»:</p>
<table border="1" class="" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3147417" class="tablecontentintable" dir="auto">x == 1 o x EQ 1</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3147500" class="tablecontentintable" dir="auto">La condición es verdadera si «x» equivale a 1.</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3145259" class="tablecontentintable" dir="auto">x != 1 o x NEQ 1</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3150551" class="tablecontentintable" dir="auto">La condición es verdadera si «x» no equivale a 1.</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3147749" class="tablecontentintable" dir="auto">sinx == 0</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3146345" class="tablecontentintable" dir="auto">La condición es verdadera si «x» es un múltiplo de pi.</p>
</td>
</tr>
</table>
<br>
<p id="par_id3149846" class="paragraph" dir="auto">Para usar operadores comparativos con cadenas de caracteres, aquéllos deben estar limitados por comillas dobles:</p>
<table border="1" class="" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3151078" class="tablecontentintable" dir="auto">x == "ABC" o x EQ "ABC"</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3150162" class="tablecontentintable" dir="auto">Comprueba si la variable «x» contiene (verdadero) la cadena de caracteres «ABC» o no (falso).</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3153301" class="tablecontentintable" dir="auto">x == "" o x EQ ""</p>
<p id="par_id3156120" class="tablecontentintable" dir="auto">o</p>
<p id="par_id3156133" class="tablecontentintable" dir="auto">!x o NOT x</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3156112" class="tablecontentintable" dir="auto">Comprueba si la variable «x» contiene una cadena vacía.</p>
</td>
</tr>
</table>
<br>
<div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id3150097" dir="auto">El operador comparativo «igual» se debe representar mediante dos signos de igual (==) en una condición. Por ejemplo, si define una variable «x» con el valor de 1, la condición se debe escribir como x==1.</p></div>
</div>
<br>
<h2 id="hd_id3148791" dir="auto">Datos de identidad</h2>
<p id="par_id3150028" class="paragraph" dir="auto">Puede incluir datos del usuario al definir condiciones. Para cambiar los datos del usuario, vaya a <span id="swlnsystextswriter0104090200xml_1" class="switchinline"><span hidden="true" id="MACtextswriter0104090200xml_1" class="MAC"><span class="emph">LibreOffice ▸ Preferencias</span></span><span hidden="true" id="defaulttextswriter0104090200xml_1"><span class="emph">Herramientas ▸ Opciones</span></span></span><span class="emph"> ▸ LibreOffice ▸ Datos de usuario</span>. Estos datos se deben introducir como cadenas. Puede consultar los datos del usuario mediante «==» (EQ, igual), «!=» (NEQ, distinto) y «!» (NOT, no).</p>
<p id="par_id3153124" class="paragraph" dir="auto">La tabla siguiente muestra las variables de los datos del usuario y su significado:</p>
<table border="1" class="" cellpadding="0" cellspacing="0">
<tr>
<th rowspan="" colspan="" class="tableheadcell" dir="auto">
<p id="par_id3149632" class="tableheadintable" dir="auto">Variable</p>
</th>
<th rowspan="" colspan="" class="tableheadcell" dir="auto">
<p id="par_id3150662" class="tableheadintable" dir="auto">Significado</p>
</th>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3154026" class="tablecontentintable" dir="auto">user_firstname</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3149953" class="tablecontentintable" dir="auto">Nombre</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3147272" class="tablecontentintable" dir="auto">user_lastname</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3149601" class="tablecontentintable" dir="auto">Apellidos</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3150770" class="tablecontentintable" dir="auto">user_initials</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3155529" class="tablecontentintable" dir="auto">Iniciales</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3148705" class="tablecontentintable" dir="auto">user_company</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3148728" class="tablecontentintable" dir="auto">Empresa</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3155361" class="tablecontentintable" dir="auto">user_street</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3154222" class="tablecontentintable" dir="auto">Calle</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3145108" class="tablecontentintable" dir="auto">user_country</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3146885" class="tablecontentintable" dir="auto">País</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3149580" class="tablecontentintable" dir="auto">user_zipcode</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3156241" class="tablecontentintable" dir="auto">Código postal</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3148922" class="tablecontentintable" dir="auto">user_city</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3148945" class="tablecontentintable" dir="auto">Ciudad</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3156053" class="tablecontentintable" dir="auto">user_title</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3159219" class="tablecontentintable" dir="auto">Título</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3156435" class="tablecontentintable" dir="auto">user_position</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3145178" class="tablecontentintable" dir="auto">Posición</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3150797" class="tablecontentintable" dir="auto">user_tel_work</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3150820" class="tablecontentintable" dir="auto">Número de teléfono (trabajo)</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3150894" class="tablecontentintable" dir="auto">user_tel_home</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3155320" class="tablecontentintable" dir="auto">Número de teléfono (privado)</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3154400" class="tablecontentintable" dir="auto">user_fax</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3153363" class="tablecontentintable" dir="auto">Número de fax</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3153390" class="tablecontentintable" dir="auto">user_email</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3154948" class="tablecontentintable" dir="auto">Dirección de correo electrónico</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3145603" class="tablecontentintable" dir="auto">user_state</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3150129" class="tablecontentintable" dir="auto">Estado (no en todas las versiones de LibreOffice)</p>
</td>
</tr>
</table>
<br>
<p id="par_id3150147" class="paragraph" dir="auto">Por ejemplo, para ocultar un párrafo, texto o una sección de un usuario con una inicial concreta, como «LM», escriba la condición: «user_initials=="LM"».</p>
<h2 id="hd_id3154115" dir="auto">Condiciones y campos de base de datos</h2>
<p id="par_id3154128" class="paragraph" dir="auto">Puede definir las condiciones para acceder a las bases de datos o los campos de bases de datos. Por ejemplo puede comprobar el contenido de un campo de la base de datos de una condición o usar los campos de la base de datos en expresiones lógicas. La tabla siguiente muestra más ejemplos del uso de bases de datos en las condiciones:</p>
<table border="1" class="" cellpadding="0" cellspacing="0">
<tr>
<th rowspan="" colspan="" class="tableheadcell" dir="auto">
<p id="par_id3156066" class="tableheadintable" dir="auto">Ejemplo</p>
</th>
<th rowspan="" colspan="" class="tableheadcell" dir="auto">
<p id="par_id3156088" class="tableheadintable" dir="auto">Significado</p>
</th>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3155948" class="paragraphintable" dir="auto">Base de datos.Tabla.Empresa</p>
<p id="par_id3148673" class="paragraphintable" dir="auto">Base de datos.Tabla.Empresa NEQ ""</p>
<p id="par_id3148687" class="paragraphintable" dir="auto">Base de datos.Tabla.Empresa != ""</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3155373" class="paragraphintable" dir="auto">La condición es verdadera si el campo EMPRESA no está vacío. (En el primer ejemplo no se requiere ningún operador.)</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3149977" class="paragraphintable" dir="auto">!Base de datos.Tabla.Empresa</p>
<p id="par_id3149991" class="paragraphintable" dir="auto">NOT Base de datos.Tabla.Empresa</p>
<p id="par_id3150004" class="paragraphintable" dir="auto">Base de datos.Tabla.Empresa EQ ""</p>
<p id="par_id3146911" class="paragraphintable" dir="auto">Base de datos.Tabla.Empresa ==""</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3148733" class="paragraphintable" dir="auto">Devuelve VERDADERO si el campo EMPRESA está vacío.</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3148762" class="paragraphintable" dir="auto">BaseDeDatos.Tabla.Empresa !="Sun"</p>
<p id="par_id3153016" class="paragraphintable" dir="auto">BaseDeDatos.Tabla.Empresa NEQ "Sun"</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3153040" class="paragraphintable" dir="auto">Devuelve VERDADERO si el contenido actual del campo EMPRESA no es "Sun". (El signo de exclamación representa un NO lógico.)</p>
</td>
</tr>
<tr>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3154605" class="paragraphintable" dir="auto">Base de datos.Tabla.Nombre AND Base de datos.Tabla.Apellidos</p>
</td>
<td rowspan="" colspan="" dir="auto">
<p id="par_id3153059" class="paragraphintable" dir="auto">Devuelve TRUE si el registro contiene el nombre y el apellido.</p>
</td>
</tr>
</table>
<br>
<div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id3159247" dir="auto">Tenga en cuenta que existe una diferencia entre el no lógico «!» (NOT) y el operador de desigualdad «!=» (NEQ).</p></div>
</div>
<br>
<p id="par_id3153876" class="paragraph" dir="auto">Cuando haga referencia a un campo de base de datos en una condición, emplee la forma Nombredebasededatos.Nombredetabla.Nombredecampo. Si un nombre contiene un carácter que es un operador, por ejemplo un signo menos (-), ponga el nombre entre corchetes, por ejemplo Nombredebasededatos.[Nombre-tabla].Nombredecampo. En los campos de nombres nunca debe haber espacios en blanco.</p>
<h3 id="par_id3153891" dir="auto">Ejemplo: Ocultar un campo vacío de la base de datos</h3>
<p id="par_id3150051" class="paragraph" dir="auto">Puede que desee crear una condición que oculte un campo vacío, por ejemplo, si el campo COMPANY está vacío en algunos de los registros de datos.</p>
<p id="par_id3150067" class="paragraph" dir="auto">Seleccione la entrada de lista <span class="emph">Párrafo oculto</span> y escriba la condición siguiente: Addressbook.Addresses.Company EQ ""</p>
<p id="par_id3147110" class="paragraph" dir="auto">o escriba lo siguiente</p>
<p id="par_id3147123" class="paragraph" dir="auto">NOT Libretadirecciones.Direcciones.Empresa</p>
<p id="par_id3147136" class="paragraph" dir="auto">Si el campo EMPRESA de la base de datos está vacío, la condición es verdadera y el párrafo se oculta.</p>
<div class="note">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/note.svg" alt="note" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id3150232" dir="auto">Para ver en pantalla los párrafos ocultos, diríjase a <span id="swlnsystextswriter0104090200xml_2" class="switchinline"><span hidden="true" id="MACtextswriter0104090200xml_2" class="MAC"><span class="menuitem">LibreOffice ▸ Preferencias</span></span><span hidden="true" id="defaulttextswriter0104090200xml_2"><span class="menuitem">Herramientas ▸ Opciones</span></span></span><span class="menuitem"> ▸ LibreOffice Writer ▸ Ver</span> y desmarque la casilla <span class="emph">Párrafos ocultos</span>.</p></div>
</div>
<br>
<h2 id="hd_id3145218" dir="auto">Ejemplos de condiciones en campos</h2>
<p id="par_id3145231" class="paragraph" dir="auto">Los ejemplos siguientes usan el campo Texto condicional, aunque se pueden aplicar a cualquier campo que se pueda vincular a una condición. La sintaxis que se usa para las condiciones también se usa para los campos Texto oculto, Párrafo oculto, Cualquier registro o Registro siguiente.</p>
<h2 id="hd_id3150311" dir="auto">Para mostrar texto condicional basado en el número de páginas:</h2>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3150333" class="listitem" dir="auto">Vaya a <span class="emph">Insertar ▸ Campo ▸ Más campos</span> y, a continuación, pulse en la pestaña <span class="emph">Funciones</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3147471" class="listitem" dir="auto">En la lista <span class="emph">Tipo</span>, pulse en «Texto condicional».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3154294" class="listitem" dir="auto">En el cuadro <span class="emph">Condición</span>, escriba «page == 1».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3154319" class="listitem" dir="auto">En el cuadro <span class="emph">Entonces</span>, escriba «Solo hay una página».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3150640" class="listitem" dir="auto">En el cuadro <span class="emph">Si no</span>, escriba «Hay varias páginas».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3153086" class="listitem" dir="auto">Pulse en <span class="emph">Insertar</span> y, a continuación, en <span class="emph">Cerrar</span>.</p>
</li>
</ol>
<h2 id="hd_id3155814" dir="auto">Para mostrar texto condicional basado en una variable definida por el usuario</h2>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3155836" class="listitem" dir="auto">Vaya a <span class="emph">Insertar ▸ Campo ▸ Más campos</span> y, a continuación, pulse en la pestaña <span class="emph">Variables</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3155109" class="listitem" dir="auto">En la lista <span class="emph">Tipo</span>, pulse en «Establecer variable».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3147008" class="listitem" dir="auto">En el cuadro <span class="emph">Nombre</span>, escriba «Beneficio».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3147032" class="listitem" dir="auto">En el cuadro <span class="emph">Valor</span>, escriba «5000».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3152974" class="listitem" dir="auto">Pulse en <span class="emph">Insertar</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3152998" class="listitem" dir="auto">Pulse en la pestaña <span class="emph">Funciones</span> y, a continuación, en «Texto condicional» en la lista <span class="emph">Tipo</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3150952" class="listitem" dir="auto">En el cuadro <span class="emph">Condición</span>, escriba «Beneficio < 5000».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3156291" class="listitem" dir="auto">En el cuadro <span class="emph">Entonces</span>, escriba «No se cumple el objetivo».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3156317" class="listitem" dir="auto">En el cuadro <span class="emph">Si no</span>, escriba «Se cumple el objetivo».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3154366" class="listitem" dir="auto">Pulse en <span class="emph">Insertar</span>.</p>
</li>
</ol>
<p id="par_id3154389" class="paragraph" dir="auto">Para editar el contenido de la variable «Beneficio», pulse dos veces en el campo de la variable.</p>
<h2 id="hd_id3155573" dir="auto">Para mostrar texto condicional basado en el contenido de un campo de la base de datos:</h2>
<p id="par_id3155587" class="paragraph" dir="auto">En la primera parte de este ejemplo se inserta un espacio entre los campos «Nombres» y «Apellidos» de un documento, mientras que en la segunda parte se inserta texto según el contenido de un campo. Este ejemplo requiere que se registre un origen de datos de direcciones con LibreOffice.</p>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3150523" class="listitem" dir="auto">Vaya a <span class="emph">Insertar ▸ Campo ▸ Más campos</span> y, a continuación, pulse en la pestaña <span class="emph">Base de datos</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3148811" class="listitem" dir="auto">En la lista <span class="emph">Tipo de campo</span>, pulse en «Campos de combinación de correspondencia».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3148841" class="listitem" dir="auto">En el cuadro <span class="emph">Seleccionar base de datos</span>, pulse dos veces sobre una libreta de direcciones, a continuación pulse "Nombre" y después <span class="emph">Insertar</span>. Haga lo mismo con "Apellidos".</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3147549" class="listitem" dir="auto">Sitúe el cursor en el documento, entre los dos campos; pulse un espacio y vuelva al diálogo <span class="emph">Campos</span>:</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3150416" class="listitem" dir="auto">Pulse la pestaña <span class="emph">Funciones</span> y a continuación "Texto condicional" en la lista <span class="emph">Tipo de campo</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3153589" class="listitem" dir="auto">En el cuadro <span class="emph">Condición</span>, escriba: «Addressbook.addresses.firstname».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3153615" class="listitem" dir="auto">En el cuadro <span class="emph">Entonces</span> escriba un espacio y deje en blanco el cuadro <span class="emph">Si no</span>.</p>
</li>
</ol>
<p id="par_id3153562" class="paragraph" dir="auto">Ahora puede usar una condición para insertar texto basado en el contenido del campo Nombre.</p>
<ol itemprop="HowTo" itemscope="true" itemtype="http://schema.org/HowToSection" dir="auto">
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3150574" class="listitem" dir="auto">En el diálogo <span class="emph">Campos</span> pulse la pestaña <span class="emph">Funciones</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3150605" class="listitem" dir="auto">Seleccione «Texto condicional» en el cuadro <span class="emph">Tipo</span>.</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3151277" class="listitem" dir="auto">En el cuadro <span class="emph">Condición</span>, escriba: «Addressbook.addresses.firstname == "Miguel"»</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3151303" class="listitem" dir="auto">En el cuadro <span class="emph">Entonces</span>, escriba «Apreciado/a».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3149138" class="listitem" dir="auto">En el cuadro <span class="emph">Si no</span>, escriba «Hola».</p>
</li>
<li itemprop="itemListElement" itemscope="true" itemtype="http://schema.org/HowToStep" dir="auto">
<p id="par_id3149163" class="listitem" dir="auto">Pulse en <span class="emph">Insertar</span>.</p>
</li>
</ol>
</div>
<div id="DonationFrame"></div>
<footer><h2 style="text-align: center;"><a href="https://books.libreoffice.org" target="_blank">Libros de LibreOffice</a></h2>
<div class="noteicon" dir="auto" style="display:flex;justify-content:center;flex-wrap:wrap;row-gap:15px;">
<img src="media/navigation/libo-writer.svg" alt="Writer Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-calc.svg" alt="Calc Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-impress.svg" alt="Impress Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-draw.svg" alt="Draw Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-base.svg" alt="Base Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-math.svg" alt="Math Icon" style="width:60px;height:60px;"><img src="media/navigation/libo-symbol-black.svg" alt="Getting Started Icon" style="width:60px;height:60px;">
</div>
<div id="DEBUG" class="debug">
<h3 class="bug">Help content debug info:</h3>
<p dir="auto">This page is: <a href="https://opengrok.libreoffice.org/xref/help/source/text/swriter/01/04090200.xhp" target="_blank">/text/swriter/01/04090200.xhp</a></p>
<p dir="auto">Title is: Definir condiciones</p>
<p id="bm_module" dir="auto"></p>
<p id="bm_system" dir="auto"></p>
<p id="bm_HID" dir="auto"></p>
</div></footer>
</body>
</html>
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| 01150000.html | File | 9.22 KB | 0644 |
|
| 01160100.html | File | 4.68 KB | 0644 |
|
| 01160200.html | File | 4.54 KB | 0644 |
|
| 01160300.html | File | 5.5 KB | 0644 |
|
| 01160400.html | File | 4.89 KB | 0644 |
|
| 01160500.html | File | 6.21 KB | 0644 |
|
| 02110000.html | File | 40.75 KB | 0644 |
|
| 02110100.html | File | 14.71 KB | 0644 |
|
| 02120000.html | File | 17.47 KB | 0644 |
|
| 02120100.html | File | 4.98 KB | 0644 |
|
| 02130000.html | File | 5.92 KB | 0644 |
|
| 02140000.html | File | 17.87 KB | 0644 |
|
| 02150000.html | File | 9.52 KB | 0644 |
|
| 02170000.html | File | 7.09 KB | 0644 |
|
| 03050000.html | File | 8.46 KB | 0644 |
|
| 03070000.html | File | 4.99 KB | 0644 |
|
| 03080000.html | File | 6.49 KB | 0644 |
|
| 03090000.html | File | 7.26 KB | 0644 |
|
| 03100000.html | File | 6.88 KB | 0644 |
|
| 03120000.html | File | 5.58 KB | 0644 |
|
| 03130000.html | File | 5.4 KB | 0644 |
|
| 03140000.html | File | 6.09 KB | 0644 |
|
| 04010000.html | File | 15.43 KB | 0644 |
|
| 04020000.html | File | 8.81 KB | 0644 |
|
| 04020100.html | File | 11.59 KB | 0644 |
|
| 04020200.html | File | 5.28 KB | 0644 |
|
| 04030000.html | File | 9.44 KB | 0644 |
|
| 04040000.html | File | 8.52 KB | 0644 |
|
| 04060000.html | File | 9.37 KB | 0644 |
|
| 04060100.html | File | 7.87 KB | 0644 |
|
| 04070000.html | File | 9.16 KB | 0644 |
|
| 04070100.html | File | 6.43 KB | 0644 |
|
| 04070200.html | File | 8.29 KB | 0644 |
|
| 04070300.html | File | 7.4 KB | 0644 |
|
| 04090000.html | File | 8.81 KB | 0644 |
|
| 04090001.html | File | 15.14 KB | 0644 |
|
| 04090002.html | File | 21.54 KB | 0644 |
|
| 04090003.html | File | 17.77 KB | 0644 |
|
| 04090004.html | File | 12.04 KB | 0644 |
|
| 04090005.html | File | 18.74 KB | 0644 |
|
| 04090006.html | File | 12.08 KB | 0644 |
|
| 04090007.html | File | 10.2 KB | 0644 |
|
| 04090100.html | File | 4.97 KB | 0644 |
|
| 04090200.html | File | 34.93 KB | 0644 |
|
| 04090300.html | File | 7.93 KB | 0644 |
|
| 04120000.html | File | 5.36 KB | 0644 |
|
| 04120100.html | File | 17.92 KB | 0644 |
|
| 04120200.html | File | 9.13 KB | 0644 |
|
| 04120201.html | File | 6.17 KB | 0644 |
|
| 04120210.html | File | 7.52 KB | 0644 |
|
| 04120211.html | File | 10.99 KB | 0644 |
|
| 04120212.html | File | 11.21 KB | 0644 |
|
| 04120213.html | File | 9.38 KB | 0644 |
|
| 04120214.html | File | 9.26 KB | 0644 |
|
| 04120215.html | File | 9.48 KB | 0644 |
|
| 04120216.html | File | 6.69 KB | 0644 |
|
| 04120217.html | File | 7.45 KB | 0644 |
|
| 04120219.html | File | 5.72 KB | 0644 |
|
| 04120220.html | File | 5.4 KB | 0644 |
|
| 04120221.html | File | 11.42 KB | 0644 |
|
| 04120222.html | File | 12.17 KB | 0644 |
|
| 04120223.html | File | 11.42 KB | 0644 |
|
| 04120224.html | File | 11.46 KB | 0644 |
|
| 04120225.html | File | 11.69 KB | 0644 |
|
| 04120226.html | File | 11.47 KB | 0644 |
|
| 04120227.html | File | 10.35 KB | 0644 |
|
| 04120229.html | File | 6.35 KB | 0644 |
|
| 04120250.html | File | 12.16 KB | 0644 |
|
| 04120300.html | File | 7.54 KB | 0644 |
|
| 04130000.html | File | 10.58 KB | 0644 |
|
| 04130100.html | File | 6.9 KB | 0644 |
|
| 04150000.html | File | 12.45 KB | 0644 |
|
| 04180400.html | File | 8.36 KB | 0644 |
|
| 04190000.html | File | 9.46 KB | 0644 |
|
| 04200000.html | File | 8.51 KB | 0644 |
|
| 04220000.html | File | 5.67 KB | 0644 |
|
| 04230000.html | File | 5.7 KB | 0644 |
|
| 04990000.html | File | 10.24 KB | 0644 |
|
| 05030200.html | File | 15.09 KB | 0644 |
|
| 05030400.html | File | 7.54 KB | 0644 |
|
| 05030800.html | File | 11.83 KB | 0644 |
|
| 05040000.html | File | 13.7 KB | 0644 |
|
| 05040500.html | File | 14.15 KB | 0644 |
|
| 05040501.html | File | 6.21 KB | 0644 |
|
| 05040600.html | File | 7.97 KB | 0644 |
|
| 05040700.html | File | 8.36 KB | 0644 |
|
| 05040800.html | File | 7.09 KB | 0644 |
|
| 05060000.html | File | 8.92 KB | 0644 |
|
| 05060100.html | File | 28.9 KB | 0644 |
|
| 05060200.html | File | 15.29 KB | 0644 |
|
| 05060201.html | File | 14.9 KB | 0644 |
|
| 05060300.html | File | 6.99 KB | 0644 |
|
| 05060700.html | File | 17.59 KB | 0644 |
|
| 05060800.html | File | 7.52 KB | 0644 |
|
| 05060900.html | File | 10.51 KB | 0644 |
|
| 05080000.html | File | 7.85 KB | 0644 |
|
| 05090000.html | File | 7.39 KB | 0644 |
|
| 05090100.html | File | 9.87 KB | 0644 |
|
| 05090200.html | File | 6.76 KB | 0644 |
|
| 05090201.html | File | 9.87 KB | 0644 |
|
| 05090300.html | File | 10 KB | 0644 |
|
| 05100000.html | File | 6.2 KB | 0644 |
|
| 05100400.html | File | 6.94 KB | 0644 |
|
| 05110100.html | File | 6.34 KB | 0644 |
|
| 05120100.html | File | 6 KB | 0644 |
|
| 05120400.html | File | 6.65 KB | 0644 |
|
| 05130000.html | File | 13.04 KB | 0644 |
|
| 05130002.html | File | 13.64 KB | 0644 |
|
| 05130004.html | File | 9.36 KB | 0644 |
|
| 05130100.html | File | 17.29 KB | 0644 |
|
| 05150000.html | File | 6.87 KB | 0644 |
|
| 05150100.html | File | 9.35 KB | 0644 |
|
| 05150104.html | File | 3.97 KB | 0644 |
|
| 05150200.html | File | 6.15 KB | 0644 |
|
| 05150300.html | File | 5.66 KB | 0644 |
|
| 05170000.html | File | 12.45 KB | 0644 |
|
| 05190000.html | File | 7.63 KB | 0644 |
|
| 05200000.html | File | 5.17 KB | 0644 |
|
| 06030000.html | File | 12.41 KB | 0644 |
|
| 06040000.html | File | 8 KB | 0644 |
|
| 06060000.html | File | 10.99 KB | 0644 |
|
| 06060100.html | File | 10.95 KB | 0644 |
|
| 06080000.html | File | 5.02 KB | 0644 |
|
| 06080100.html | File | 14.36 KB | 0644 |
|
| 06080200.html | File | 9.38 KB | 0644 |
|
| 06090000.html | File | 7.97 KB | 0644 |
|
| 06100000.html | File | 10.72 KB | 0644 |
|
| 06110000.html | File | 5.13 KB | 0644 |
|
| 06120000.html | File | 4.5 KB | 0644 |
|
| 06160000.html | File | 4.92 KB | 0644 |
|
| 06170000.html | File | 4.32 KB | 0644 |
|
| 06180000.html | File | 9.06 KB | 0644 |
|
| 06190000.html | File | 4.27 KB | 0644 |
|
| 06200000.html | File | 4.3 KB | 0644 |
|
| 06210000.html | File | 4.17 KB | 0644 |
|
| 06220000.html | File | 4.22 KB | 0644 |
|
| 06990000.html | File | 6.62 KB | 0644 |
|
| HeadingRowsRepeat.html | File | 5.69 KB | 0644 |
|
| RowSplit.html | File | 5.51 KB | 0644 |
|
| SpotlightCharStyles.html | File | 8.04 KB | 0644 |
|
| SpotlightMenu.html | File | 5.78 KB | 0644 |
|
| SpotlightParaStyles.html | File | 8.66 KB | 0644 |
|
| TableAutoFitMenu.html | File | 11.25 KB | 0644 |
|
| TableConvertMenu.html | File | 5.39 KB | 0644 |
|
| TableDeleteMenu.html | File | 6.25 KB | 0644 |
|
| TableInsertMenu.html | File | 8.66 KB | 0644 |
|
| TableNumberRecognition.html | File | 7.76 KB | 0644 |
|
| TableSelectMenu.html | File | 5.93 KB | 0644 |
|
| accessibility_check.html | File | 11.18 KB | 0644 |
|
| contentcontrol00.html | File | 8.08 KB | 0644 |
|
| format_frame.html | File | 5.42 KB | 0644 |
|
| format_object.html | File | 6.66 KB | 0644 |
|
| goto.html | File | 6.5 KB | 0644 |
|
| legacynumbering.html | File | 11.58 KB | 0644 |
|
| mailmerge00.html | File | 9.48 KB | 0644 |
|
| mailmerge01.html | File | 6.64 KB | 0644 |
|
| mailmerge02.html | File | 5.22 KB | 0644 |
|
| mailmerge03.html | File | 9.51 KB | 0644 |
|
| mailmerge04.html | File | 8.12 KB | 0644 |
|
| mailmerge05.html | File | 6.68 KB | 0644 |
|
| mm_copyto.html | File | 4.39 KB | 0644 |
|
| mm_cusaddlis.html | File | 5.26 KB | 0644 |
|
| mm_cusgrelin.html | File | 5.88 KB | 0644 |
|
| mm_emabod.html | File | 6.47 KB | 0644 |
|
| mm_emailmergeddoc.html | File | 7.54 KB | 0644 |
|
| mm_finent.html | File | 4.76 KB | 0644 |
|
| mm_matfie.html | File | 4.67 KB | 0644 |
|
| mm_newaddblo.html | File | 5.56 KB | 0644 |
|
| mm_newaddlis.html | File | 5.86 KB | 0644 |
|
| mm_printmergeddoc.html | File | 5.76 KB | 0644 |
|
| mm_savemergeddoc.html | File | 5.74 KB | 0644 |
|
| mm_seladdblo.html | File | 6.28 KB | 0644 |
|
| mm_seladdlis.html | File | 5.8 KB | 0644 |
|
| mm_seltab.html | File | 4.25 KB | 0644 |
|
| navigator_context_menu.html | File | 29.8 KB | 0644 |
|
| outlinecontent_visibility.html | File | 12.12 KB | 0644 |
|
| page.html | File | 19.75 KB | 0644 |
|
| pagenumbering.html | File | 6.93 KB | 0644 |
|
| paragraph_hyphenation.html | File | 16.7 KB | 0644 |
|
| paragraph_signature.html | File | 9.12 KB | 0644 |
|
| protectdocument.html | File | 5.99 KB | 0644 |
|
| select_text.html | File | 5.2 KB | 0644 |
|
| selection_mode.html | File | 5.05 KB | 0644 |
|
| show_whitespace.html | File | 5.83 KB | 0644 |
|
| sidebar_comments.html | File | 13.38 KB | 0644 |
|
| sidebar_design.html | File | 8.84 KB | 0644 |
|
| sidebar_quickfind.html | File | 10.62 KB | 0644 |
|
| spotlight_chars_df.html | File | 6.6 KB | 0644 |
|
| style_inspector.html | File | 13.33 KB | 0644 |
|
| title_page.html | File | 9.48 KB | 0644 |
|
| translate.html | File | 7.64 KB | 0644 |
|
| view_images_charts.html | File | 5.74 KB | 0644 |
|
| view_resolved_comments.html | File | 5.03 KB | 0644 |
|
| view_table_bounds.html | File | 5.03 KB | 0644 |
|
| watermark.html | File | 10.12 KB | 0644 |
|