__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<!DOCTYPE html>
<html lang="es" dir="ltr">
<head>
<base href="../../../../../">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Servicio ScriptForge.Basic</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="ScriptForge-sf_basic"></a>
    <a id="bm_id261582733781987"></a>
      <meta itemprop="keywords" content="Basic service">
    

<a id="abstract"></a>
    <h1 id="hd_id731582733781114" dir="auto">
<a id="BasicService"></a>Servicio <span class="literal">ScriptForge</span>.<span class="literal">Basic</span>
</h1>
  <p id="par_id381589189355849" class="paragraph" dir="auto">El servicio <span class="literal">ScriptForge.Basic</span> ofrece una colección de métodos de LibreOffice BASIC que ejecutar en un contexto Python. Los métodos del servicio <span class="literal">Basic</span> reproducen con exactitud la sintaxis y el comportamiento de las funciones incorporadas de BASIC.</p>

  <p id="par_id591589189364267" class="paragraph" dir="auto">Ejemplo típico:</p>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
   bas.MsgBox('Display this text in a message box from a Python script')
  </code></pre></div>
  <div class="warning">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/warning.svg" alt="warning" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id151618849022977" dir="auto">El uso del servicio <span class="literal">ScriptForge</span>.<span class="literal">Basic</span> está limitado a las secuencias Python.</p></div>
</div>
<br>
  <h2 id="hd_id581582885621841" dir="auto">Invocación del servicio</h2>
  <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_id141610734722352" dir="auto">Antes de utilizar el servicio <span class="literal">Basic</span>, importe el método <span class="literal">CreateScriptService()</span> del módulo <span class="literal">scriptforge</span>:</p></div>
</div>
<br>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    from scriptforge import CreateScriptService
    bas = CreateScriptService("Basic")
  </code></pre></div>
  <h2 id="hd_id201618922972557" dir="auto">Propiedades</h2>
  <a id="properties_toc"></a>
  <table border="1" class="" cellpadding="0" cellspacing="0">
   <tr>
       <th rowspan="" colspan="" class="tableheadcell" dir="auto"><p id="par_id401618922991909" class="tableheadintable" dir="auto">Nombre</p></th>
       <th rowspan="" colspan="" class="tableheadcell" dir="auto"><p id="par_id591618922991909" class="tableheadintable" dir="auto">De solo lectura</p></th>
       <th rowspan="" colspan="" class="tableheadcell" dir="auto"><p id="par_id211618922991909" class="tableheadintable" dir="auto">Tipo</p></th>
       <th rowspan="" colspan="" class="tableheadcell" dir="auto"><p id="par_id971618923022846" class="tableheadintable" dir="auto">Descripción</p></th>
   </tr>
   <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id541619003984227" class="tablecontentintable" dir="auto">MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_YESNO, MB_YESNOCANCEL</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id21619004009875" class="tablecontentintable" dir="auto">Sí</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id111619004011627" class="tablecontentintable" dir="auto">Integer</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id791619004012484" class="tablecontentintable" dir="auto">Valores: 0, 1, 5, 4, 3</p>
       </td>
   </tr>
    <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id161619003998035" class="tablecontentintable" dir="auto">MB_ICONEXCLAMATION, MB_ICONINFORMATION, MB_ICONQUESTION, MB_ICONSTOP</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id201619004097755" class="tablecontentintable" dir="auto">Sí</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id981619004098700" class="tablecontentintable" dir="auto">Integer</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id311619004099683" class="tablecontentintable" dir="auto">Valores: 48, 64, 32, 16<br></p>
       </td>
    </tr>
   <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id831618922991909" class="tablecontentintable" dir="auto">MB_ABORTRETRYIGNORE, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id581618922991909" class="tablecontentintable" dir="auto">Sí</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
         <p id="par_id161618922991910" class="tablecontentintable" dir="auto">Integer</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id211618923312141" class="tablecontentintable" dir="auto">Valores: 2, 128, 256, 512</p>
       </td>
   </tr>
   <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id471618924470655" class="tablecontentintable" dir="auto">IDABORT, IDCANCEL, IDIGNORE, IDNO, IDOK, IDRETRY, IDYES</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id961618924503848" class="tablecontentintable" dir="auto">Sí</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id571618924505303" class="tablecontentintable" dir="auto">Integer</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id871618924506654" class="tablecontentintable" dir="auto">Valores: 3, 2, 5, 7, 1, 4, 6<br>Constantes que indican el botón seleccionado del <span class="literal">MsgBox</span>.</p>
       </td>
   </tr>
    <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id421619006246768" class="tablecontentintable" dir="auto">StarDesktop</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id731619006254384" class="tablecontentintable" dir="auto">Sí</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id711619006255184" class="tablecontentintable" dir="auto">Objeto<br>de UNO</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id541619006255653" class="tablecontentintable" dir="auto">Returns the <a target="_top" href="es/text/sbasic/shared/stardesktop.html"><span class="literal">StarDesktop</span></a> object that represents the LibreOffice application.</p>
       </td>
    </tr>
    <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id421619006246257" class="tablecontentintable" dir="auto">ThisComponent</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id731619006034384" class="tablecontentintable" dir="auto">Sí</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id711619006259094" class="tablecontentintable" dir="auto">Objeto<br>de UNO</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id541619006256911" class="tablecontentintable" dir="auto">If the current component refers to a LibreOffice document, this method returns the UNO object representing the document. This property returns <span class="literal">None</span> when the current component does not correspond to a document.</p>
       </td>
    </tr>
    <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id421619006230624" class="tablecontentintable" dir="auto">ThisDatabaseDocument</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id731619006259634" class="tablecontentintable" dir="auto">Sí</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id711619004425514" class="tablecontentintable" dir="auto">Objeto<br>de UNO</p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id541619006255121" class="tablecontentintable" dir="auto">If the script is being executed from a Base document or any of its subcomponents this method returns the main component of the Base instance. This property returns <span class="literal">None</span> otherwise.</p>
       </td>
    </tr>
  </table>
<br>
  
  <a id="methods_toc"></a>
  <table border="1" class="" cellpadding="0" cellspacing="0">
   <tr>
     <th rowspan="" colspan="3" class="tableheadcell" dir="auto">
       <p id="par_id651606319520519" class="tableheadintable" dir="auto">Lista de métodos en el servicio Basic</p>
     </th>
   </tr>
   <tr>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id761611086279902" class="tablecontentintable" dir="auto">
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#CDate">CDate</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#CDateFromUnoDateTime">CDateFromUnoDateTime</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#CDateToUnoDateTime">CDateToUnoDateTime</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#ConvertFromUrl">ConvertFromUrl</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#ConvertToUrl">ConvertToUrl</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#CreateUnoService">CreateUnoService</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#CreateUnoStruct">CreateUnoStruct</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#DateAdd">DateAdd</a><br>
           </p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id141611086279902" class="tablecontentintable" dir="auto">
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#DateDiff">DateDiff</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#DatePart">DatePart</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#DateValue">DateValue</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#Format">Format</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#GetDefaultContext">GetDefaultContext</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#GetGuiType">GetGuiType</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#GetPathSeparator">GetPathSeparator</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#GetSystemTicks">GetSystemTicks</a><br>
           </p>
       </td>
       <td rowspan="" colspan="" dir="auto">
           <p id="par_id761611086279903" class="tablecontentintable" dir="auto">
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#BasicLibraries">GlobalScope.BasicLibraries</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#DialogLibraries">GlobalScope.DialogLibraries</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#InputBox">InputBox</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#MsgBox">MsgBox</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#Now">Now</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#RGB">RGB</a><br>
             <a target="_top" href="es/text/sbasic/shared/03/sf_basic.html#Xray">Xray</a><br><br>
           </p>
       </td>
   </tr>
  </table>
<br>
  

<a id="CDate"></a>
  
  <a id="bm_id92158919969187"></a>
    <meta itemprop="keywords" content="Basic service,CDate">
  
  <h2 id="hd_id201589199698020" dir="auto">CDate</h2>
  <p id="par_id71621894830071" class="paragraph" dir="auto">Converts a numeric expression or a string to a <span class="literal">datetime</span>.<span class="literal">datetime</span> Python native object.</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_id431621896441258" dir="auto">This method exposes the Basic builtin function <a target="_top" href="es/text/sbasic/shared/03100300.html">CDate</a> to Python scripts.</p></div>
</div>
<br>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id591621897208785" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.CDate(expression: any): obj</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id401621896675880" class="paragraph" dir="auto"><span class="emph">expression</span>: a numeric expression or a string representing a date.</p>
  <div class="embedded">
<a id="CDate_str_date"></a>
  <p id="par_id3125864" class="paragraph" dir="auto">Cuando se convierte una expresión de cadena, la fecha y la hora se debe introducir, ya sea como una de las pautas de aceptación de fechas definidas para su configuración regional (vea <span id="swlnsystextsbasicshared03100300xml_1" class="switchinline"><span hidden="true" id="MACtextsbasicshared03100300xml_1" class="MAC"><span class="menuitem">LibreOffice ▸ Preferencias</span></span><span hidden="true" id="defaulttextsbasicshared03100300xml_1"><span class="menuitem">Herramientas ▸ Opciones</span></span></span><span class="menuitem"> ▸ Idiomas y regiones ▸ Generales</span>) o en el formato de fechas de la ISO (por el momento, solo se acepta el formato con guiones: «2012-12-31», por ejemplo). En las expresiones numéricas, los valores a la izquierda del decimal representan la fecha, comenzando a partir del 31 de diciembre de 1899. Los valores a la derecha del decimal representan la hora.</p>
</div>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    d = bas.CDate(1000.25)
    bas.MsgBox(str(d)) # 1902-09-26 06:00:00
    bas.MsgBox(d.year) # 1902
  </code></pre></div>


<a id="CDateFromUnoDateTime"></a>
  
  <a id="bm_id92158919969335"></a>
    <meta itemprop="keywords" content="Basic service,CDateFromUnoDateTime">
  
  <h2 id="hd_id201589199691468" dir="auto">CDateFromUnoDateTime</h2>
  <p id="par_id481621950748686" class="paragraph" dir="auto">Converts a UNO date/time representation to a <span class="literal">datetime.datetime</span> Python native object.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id691621950580345" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.CDateFromUnoDateTime(unodate: uno): obj</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id41621950816227" class="paragraph" dir="auto"><span class="emph">unodate</span>: A UNO date/time object of one of the following types: <span class="literal">com.sun.star.util.DateTime</span>, <span class="literal">com.sun.star.util.Date</span> or <span class="literal">com.sun.star.util.Time</span></p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <p id="par_id281621952224847" class="paragraph" dir="auto">El ejemplo siguiente crea un objeto <span class="literal">com.sun.star.util.DateTime</span> y lo convierte en un objeto <span class="literal">datetime.datetime</span> de Python.</p>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    uno_date = bas.CreateUnoStruct('com.sun.star.util.DateTime')
    uno_date.Year = 1983
    uno_date.Month = 2
    uno_date.Day = 23
    new_date = bas.CDateFromUnoDateTime(uno_date)
    bas.MsgBox(str(new_date)) # 1983-02-23 00:00:00
  </code></pre></div>


<a id="CDateToUnoDateTime"></a>
  
  <a id="bm_id92158919967133"></a>
    <meta itemprop="keywords" content="Basic service,CDateToUnoDateTime">
  
  <h2 id="hd_id201589199690087" dir="auto">CDateToUnoDateTime</h2>
  <p id="par_id741621952469980" class="paragraph" dir="auto">Converts a date representation into a <span class="literal">com.sun.star.util.DateTime</span> object.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id691621950580116" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.CDateToUnoDateTime(date: obj): uno</span>
  </p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id511621952524000" class="paragraph" dir="auto"><span class="emph">date</span>: A Python date/time object of one of the following types: <span class="literal">datetime.datetime</span>, <span class="literal">datetime.date</span>, <span class="literal">datetime.time</span>, <span class="literal">float (time.time)</span> or <span class="literal">time.struct_time</span>.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    from datetime import datetime
    current_datetime = datetime.now()
    uno_date = bas.CDateToUnoDateTime(current_datetime)
    bas.MsgBox(str(uno_date.Year) + "-" + str(uno_date.Month) + "-" + str(uno_date.Day))
  </code></pre></div>


<a id="ConvertFromUrl"></a>
  
  <a id="bm_id92158919969883"></a>
    <meta itemprop="keywords" content="Basic service,ConvertFromUrl">
  
  <h2 id="hd_id201589199698251" dir="auto">ConvertFromUrl</h2>
  <p id="par_id93158919969864" class="paragraph" dir="auto">Devuelve la ruta en la notación del sistema correspondiente a un URL <span class="literal">file:</span> dado.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id201618496409224" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.ConvertFromUrl(url: str): str</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id321618502481706" class="paragraph" dir="auto"> <span class="emph">url</span>: un URL <span class="literal">file:</span> absoluto.</p>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id81618502493505" class="paragraph" dir="auto">A system path file name.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    filename = bas.ConvertFromUrl( "file:///C:/Program%20Files%20(x86)/LibreOffice/News.txt")
    bas.MsgBox(filename)
  </code></pre></div>


<a id="ConvertToUrl"></a>
  
  <a id="bm_id721589200121249"></a>
    <meta itemprop="keywords" content="Basic service,ConvertToUrl">
  
  <h2 id="hd_id261589210021415" dir="auto">ConvertToUrl</h2>
  <p id="par_id658519200121138" class="paragraph" dir="auto">Devuelve un URL <span class="literal">file:</span> para la ruta de sistema dada.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id761618501052294" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.ConvertToUrl(systempath: str): str</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id401618521015903" class="paragraph" dir="auto"><span class="emph">systempath</span>: una ruta de nombre de archivo en el formato del sistema, como una cadena.</p>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id61658101307414" class="paragraph" dir="auto">Un URL <span class="literal">file:</span> como cadena.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    url = bas.ConvertToUrl( 'C:\Program Files(x86)\LibreOffice\News.txt')
    bas.MsgBox(url)
  </code></pre></div>


<a id="CreateUnoService"></a>
  
  <a id="bm_id721589200121249"></a>
    <meta itemprop="keywords" content="Basic service,CreateUnoService">
  
  <h2 id="hd_id261589200121415" dir="auto">CreateUnoService</h2>
  <p id="par_id651589200121138" class="paragraph" dir="auto">Crea una instancia de un servicio de UNO mediante el <span class="literal">ProcessServiceManager</span>.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id221618556258876" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.CreateUnoService(servicename: str): uno</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id361589200121646" class="paragraph" dir="auto"><span class="emph">servicename</span>: A fully qualified service name such as <span class="literal">com.sun.star.ui.dialogs.FilePicker</span> or <span class="literal">com.sun.star.sheet.FunctionAccess</span>.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    dsk = bas.CreateUnoService('com.sun.star.frame.Desktop')
  </code></pre></div>


<a id="CreateUnoStruct"></a>
  
  <a id="bm_id721569200121087"></a>
    <meta itemprop="keywords" content="Basic service,CreateUnoStruct">
  
  <h2 id="hd_id261589202228475" dir="auto">CreateUnoStruct</h2>
  <p id="par_id651589200135438" class="paragraph" dir="auto">Returns an instance of a UNO structure of the specified type.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id221618556258097" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.CreateUnoStruct(unostructure: str): uno</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id3615892001216366" class="paragraph" dir="auto"><span class="emph">unostructure</span>: A fully qualified structure name such as <span class="literal">com.sun.star.beans.Property</span> or <span class="literal">com.sun.star.util.DateTime</span>.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    date_struct = CreateUnoStruct('com.sun.star.util.DateTime')
  </code></pre></div>


<a id="DateAdd"></a>
  
  <a id="bm_id311599410266448"></a>
    <meta itemprop="keywords" content="Basic service,DateAdd">
  
  <h2 id="hd_id91599410266599" dir="auto">DateAdd</h2>
  <p id="par_id901599410483300" class="paragraph" dir="auto">Suma una fecha o un lapso de tiempo a una fecha u hora dada un cierto número de veces y devuelve la fecha resultante.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id771618557939013" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.DateAdd(interval: str, number: num, date: datetime): datetime</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id581618562143601" class="paragraph" dir="auto"> <span class="emph">interval</span>: A string expression from the following table, specifying the date or time interval.</p>
  <div class="embedded">
<a id="datetable"></a>
<table border="1" class="" cellpadding="0" cellspacing="0">
  <tr>
    <th rowspan="" colspan="" class="tableheadcell" dir="auto">
      <p id="par_idN10636" class="tableheadintable" dir="auto">interval (string value)</p>
    </th>
    <th rowspan="" colspan="" class="tableheadcell" dir="auto">
      <p id="par_idN1063C" class="tableheadintable" dir="auto">Explicación</p>
    </th>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10643" class="tablecontentintable" dir="auto">yyyy</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10649" class="tablecontentintable" dir="auto">Año</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10650" class="tablecontentintable" dir="auto">q</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10656" class="tablecontentintable" dir="auto">Trimestre</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1065D" class="tablecontentintable" dir="auto">m</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10663" class="tablecontentintable" dir="auto">Mes</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1066A" class="tablecontentintable" dir="auto">y</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10670" class="tablecontentintable" dir="auto">Día del año</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10677" class="tablecontentintable" dir="auto">w</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1067D" class="tablecontentintable" dir="auto">Día de la semana</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10684" class="tablecontentintable" dir="auto">ww</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1068A" class="tablecontentintable" dir="auto">Semana del año</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10691" class="tablecontentintable" dir="auto">d</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10697" class="tablecontentintable" dir="auto">Día</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1069E" class="tablecontentintable" dir="auto">h</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106A4" class="tablecontentintable" dir="auto">Hora</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106AB" class="tablecontentintable" dir="auto">n</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106B1" class="tablecontentintable" dir="auto">Minuto</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106B8" class="tablecontentintable" dir="auto">s</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106BE" class="tablecontentintable" dir="auto">Segundo</p>
    </td>
  </tr>
</table>
<br>

</div>
  <p id="par_id281618562144897" class="paragraph" dir="auto"><span class="emph">number</span>: A numerical expression specifying how often the <span class="literal">interval</span> value will be added when positive or subtracted when negative.</p>
  <p id="par_id811618561843272" class="paragraph" dir="auto"><span class="emph">date</span>: A given <span class="literal">datetime.datetime</span> value, the <span class="literal">interval</span> value will be added <span class="literal">number</span> times to this <span class="literal">datetime.datetime</span> value.</p>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id181618561778320" class="paragraph" dir="auto">A <span class="literal">datetime.datetime</span> value.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    dt = datetime.datetime(2004, 1, 31)
    dt = bas.DateAdd("m", 1, dt)
    print(dt)
  </code></pre></div>


<a id="DateDiff"></a>
  
  <a id="bm_id601589202413561"></a>
    <meta itemprop="keywords" content="Basic service,DateDiff">
  
  <h2 id="hd_id611589202413141" dir="auto">DateDiff</h2>
  <p id="par_id991589202413257" class="paragraph" dir="auto">Returns the number of date or time intervals between two given date/time values.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id441618562866810" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.DateDiff(interval: str, date1: datetime, date2: datetime, firstdayofweek = 1, firstweekofyear = 1): int</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id481618563770490" class="paragraph" dir="auto"><span class="emph">interval</span>: A string expression specifying the date interval, as detailed in above <span class="literal">DateAdd</span> method.</p>
  <p id="par_id121618563772932" class="paragraph" dir="auto"><span class="emph">date1</span>, <span class="emph">date2</span>: The two <span class="literal">datetime.datetime</span> values to be compared.</p>
  <div class="embedded">
<a id="weekyear"></a>
<p id="par_idN1066A" class="paragraph" dir="auto"> <span class="emph">firstdayofweek</span>: An optional parameter that specifies the starting day of a week.</p>

<table border="1" class="" cellpadding="0" cellspacing="0">
  <tr>
    <th rowspan="" colspan="" class="tableheadcell" dir="auto">
      <p id="par_idN1067A" class="tableheadintable" dir="auto">firstdayofweek value</p>
    </th>
    <th rowspan="" colspan="" class="tableheadcell" dir="auto">
      <p id="par_idN10680" class="tableheadintable" dir="auto">Explicación</p>
    </th>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10687" class="tablecontentintable" dir="auto">0</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1068D" class="tablecontentintable" dir="auto">Utilizar valor predeterminado del sistema</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10694" class="tablecontentintable" dir="auto">1</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1069A" class="tablecontentintable" dir="auto">Sunday (valor predeterminado)</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106A1" class="tablecontentintable" dir="auto">2</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106A7" class="tablecontentintable" dir="auto">Lunes</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106AE" class="tablecontentintable" dir="auto">3</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106B4" class="tablecontentintable" dir="auto">Martes</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106BB" class="tablecontentintable" dir="auto">4</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106C1" class="tablecontentintable" dir="auto">Miércoles</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106C8" class="tablecontentintable" dir="auto">5</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106CE" class="tablecontentintable" dir="auto">Jueves</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106D5" class="tablecontentintable" dir="auto">6</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106DB" class="tablecontentintable" dir="auto">Viernes</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106E2" class="tablecontentintable" dir="auto">7</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN106E8" class="tablecontentintable" dir="auto">Sábado</p>
    </td>
  </tr>
</table>
<br>

<p id="par_idN106EB" class="paragraph" dir="auto"> <span class="emph">firstweekofyear</span>: An optional parameter that specifies the starting week of a year.</p>

<table border="1" class="" cellpadding="0" cellspacing="0">
  <tr>
    <th rowspan="" colspan="" class="tableheadcell" dir="auto">
      <p id="par_idN106FB" class="tableheadintable" dir="auto">firstweekofyear value</p>
    </th>
    <th rowspan="" colspan="" class="tableheadcell" dir="auto">
      <p id="par_idN10701" class="tableheadintable" dir="auto">Explicación</p>
    </th>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10708" class="tablecontentintable" dir="auto">0</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1070E" class="tablecontentintable" dir="auto">Utilizar valor predeterminado del sistema</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10715" class="tablecontentintable" dir="auto">1</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1071B" class="tablecontentintable" dir="auto">Week 1 es la semana del día 1 de enero (predeterminado)</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10722" class="tablecontentintable" dir="auto">2</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10728" class="tablecontentintable" dir="auto">Week 1 es la primera semana que contiene cuatro o más días de ese año</p>
    </td>
  </tr>
  <tr>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN1072F" class="tablecontentintable" dir="auto">3</p>
    </td>
    <td rowspan="" colspan="" dir="auto">
      <p id="par_idN10735" class="tablecontentintable" dir="auto">Week 1 es la primera semana que únicamente contiene días del año nuevo</p>
    </td>
  </tr>
</table>
<br>

</div>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id121618563454738" class="paragraph" dir="auto">Un número.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    date1 = datetime.datetime(2005,1, 1)
    date2 = datetime.datetime(2005,12,31)
    diffDays = bas.DateDiff('d', date1, date2)
    print(diffDays)
  </code></pre></div>


<a id="DatePart"></a>
  
  <a id="bm_id691589202925124"></a>
    <meta itemprop="keywords" content="Basic service,DatePart">
  
  <h2 id="hd_id3615892029256" dir="auto">DatePart</h2>
  <p id="par_id81589202925519" class="paragraph" dir="auto">The <span class="literal">DatePart</span> function returns a specified part of a date.</p>
 <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id761618670376341" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.DatePart(interval: str, date: datetime,  firstdayofweek = 1, firstweekofyear = 1): int</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id761618672192231" class="paragraph" dir="auto"><span class="emph">interval</span>: A string expression specifying the date interval, as detailed in above <span class="literal">DateAdd</span> method.</p>
  <p id="par_id61618672313838" class="paragraph" dir="auto"><span class="emph">date</span>: The date/time from which the result is calculated.</p>
  <p id="par_id511619445271897" class="paragraph" dir="auto"><span class="emph">firstdayofweek, firstweekofyear</span>: optional parameters that respectively specify the starting day of a week and the starting week of a year, as detailed in above <span class="literal">DateDiff</span> method.</p>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id791618672371743" class="paragraph" dir="auto">The extracted part for the given date/time.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    print(bas.DatePart("ww", datetime.datetime(2005,12,31)
    print(bas.DatePart('q', datetime.datetime(1999,12,30)
  </code></pre></div>


<a id="DateValue"></a>
  
  <a id="bm_id141589203370367"></a>
    <meta itemprop="keywords" content="Basic service,DateValue">
  
  <h2 id="hd_id161589203370594" dir="auto">DateValue</h2>
  <p id="par_id121589203370778" class="paragraph" dir="auto">Calcula un dato de fecha a partir de una cadena de fecha.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id721618673403017" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.DateValue(date: str): datetime</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <div class="embedded">
<a id="parm1"></a>
  <p id="par_id3153770" class="paragraph" dir="auto"><span class="emph">date</span>: A string that contains the date that will be converted to a <span class="emph">Date</span> object.</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_id841643046880968" dir="auto">La cadena pasada a <span class="literal">DateValue</span> debe expresarse en uno de los formatos de fecha definidos por su configuración regional (vea <span id="swlnsystextsbasicshared03030102xml_1" class="switchinline"><span hidden="true" id="MACtextsbasicshared03030102xml_1" class="MAC"><span class="menuitem">LibreOffice ▸ Preferencias</span></span><span hidden="true" id="defaulttextsbasicshared03030102xml_1"><span class="menuitem">Herramientas ▸ Opciones</span></span></span><span class="menuitem"> ▸ Idiomas y regiones ▸ Generales</span>) o en el formato «aaaa-mm-dd» (año, mes y día separados por guiones) de la ISO.</p></div>
</div>
<br>
</div>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id441618674018955" class="paragraph" dir="auto">La fecha calculada.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    dt = bas.DateValue("23-02-2011")
    print(dt)
  </code></pre></div>


<a id="Format"></a>
  
  <a id="bm_id71158920514765"></a>
    <meta itemprop="keywords" content="Basic service,Format">
  
  <h2 id="hd_id811529844547824" dir="auto">Format</h2>
  <p id="par_id458161678389887" class="paragraph" dir="auto">Convierte un número en una cadena y después le da formato de acuerdo con las especificaciones indicadas.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id901618678405855" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.Format(expression: any, format = ''): str</span></p>
  <div class="embedded">
<a id="ValueParms"></a>
<div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
<p id="par_id3149415" class="paragraph" dir="auto"> <span class="emph">expresión</span>: la expresión numérica que quiere convertir en una cadena formateada.</p>
<p id="par_id3147531" class="paragraph" dir="auto"> <span class="emph">formato</span>: una cadena que especifica el código de formato para el número. Si se omite <span class="literal">formato</span>, la función Format funciona igual que la función <span class="literal">Str()</span> de LibreOffice BASIC.</p>

<div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
<p id="par_id3148474" class="paragraph" dir="auto">Cadena de texto.</p>
</div>
  <h3 id="hd_id751618825527776" dir="auto">Códigos de formato</h3>
  <div class="embedded">
<a id="codes"></a>
<p id="par_id3147265" class="paragraph" dir="auto">La lista siguiente describe los códigos que puede utilizar para dar formato a una expresión numérica:</p>
<p id="par_id3153380" class="paragraph" dir="auto"> <span class="emph">0:</span> If <span class="literal">expression</span> has a digit at the position of the 0 in the <span class="literal">format</span> code, the digit is displayed, otherwise a zero is displayed.</p>
<p id="par_id3151210" class="paragraph" dir="auto">If <span class="literal">expression</span> has fewer digits than the number of zeros in the <span class="literal">format</span> code, (on either side of the decimal), leading or trailing zeros are displayed. If the <span class="literal">expression</span> has more digits to the left of the decimal separator than the amount of zeros in the <span class="literal">format</span> code, the additional digits are displayed without formatting.</p>
<p id="par_id3151176" class="paragraph" dir="auto">Decimal places in the <span class="literal">expression</span> are rounded according to the number of zeros that appear after the decimal separator in the <span class="literal">format</span> code.</p>
<p id="par_id3154123" class="paragraph" dir="auto"> <span class="emph">#</span>: si <span class="literal">expresión</span> contiene un dígito en la posición del sustitutivo # en el código <span class="literal">formato</span>, se muestra el dígito; de lo contrario, nada aparecerá en esta posición.</p>
<p id="par_id3148452" class="paragraph" dir="auto">This symbol works like the 0, except that leading or trailing zeroes are not displayed if there are more # characters in the <span class="literal">format</span> code than digits in the <span class="literal">expression</span>. Only the relevant digits of the <span class="literal">expression</span> are displayed.</p>
<p id="par_id3159150" class="paragraph" dir="auto"> <span class="emph">.</span>: el sustitutivo para decimales determina el número de espacios decimales a la izquierda y a la derecha del separador decimal.</p>
<p id="par_id3159252" class="paragraph" dir="auto">If the <span class="literal">format</span> code contains only # placeholders to the left of this symbol, numbers less than 1 begin with a decimal separator. To always display a leading zero with fractional numbers, use 0 as a placeholder for the first digit to the left of the decimal separator.</p>
<p id="par_id3153368" class="paragraph" dir="auto"> <span class="emph">%:</span> Multiplies the <span class="literal">expression</span>by 100 and inserts the percent sign (%) where the <span class="literal">expression</span> appears in the <span class="literal">format</span> code.</p>
<p id="par_id3149481" class="paragraph" dir="auto"> <span class="emph">E- E+ e- e+ :</span> If the <span class="literal">format</span> code contains at least one digit placeholder (0 or #) to the right of the symbol E-, E+, e-, or e+, the <span class="literal">expression</span> is formatted in the scientific or exponential format. The letter E or e is inserted between the number and the exponent. The number of placeholders for digits to the right of the symbol determines the number of digits in the exponent.</p>
<p id="par_id3149262" class="paragraph" dir="auto">Si el exponente es negativo, se muestra un signo menos justo antes de un exponente con E-, E+, e-, e+. Si el exponente es positivo, sólo se muestra un signo más antes de exponentes con E+ o e+.</p>
<p id="par_id3148617" class="paragraph" dir="auto">The thousands delimiter is displayed if the <span class="literal">format</span> code contains the delimiter enclosed by digit placeholders (0 or #).</p>
<p id="par_id3163713" class="paragraph" dir="auto">El uso de un punto como separador de miles y decimal depende del valor de configuración regional. El carácter real que se muestra como separador decimal depende del formato numérico de la configuración del sistema. Los ejemplos que se muestran aquí asumen que la configuración regional es "US".</p>
<p id="par_id3152887" class="paragraph" dir="auto"> <span class="emph">- + $ ( ) space:</span> A plus (+), minus (-), dollar ($), space, or brackets entered directly in the <span class="literal">format</span> code is displayed as a literal character.</p>
<p id="par_id3148576" class="paragraph" dir="auto">Para que se muestren caracteres distintos de los que se indican aquí, es necesario colocarles una contrabarra (\) antes o entrecomillarlos (" ").</p>
<p id="par_id3153139" class="paragraph" dir="auto"> <span class="emph">\ :</span> The backslash displays the next character in the <span class="literal">format</span> code.</p>
<p id="par_id3153366" class="paragraph" dir="auto">Characters in the <span class="literal">format</span> code that have a special meaning can only be displayed as literal characters if they are preceded by a backslash. The backslash itself is not displayed, unless you enter a double backslash (\\) in the format code.</p>
<p id="par_id3155411" class="paragraph" dir="auto">Los caracteres que deben precederse por una barra oblicua inversa en el código de formato para que se muestren como caracteres literales son: caracteres de formato de hora y fecha (a, c, d, h, m, n, p, q, s, t, w, y, /, :), caracteres de formato numérico (#, 0, %, E, e, coma, punto) y caracteres de formato de cadena (@, &amp;, &lt;, &gt;, !).</p>
<p id="par_id3145749" class="paragraph" dir="auto">You can also use the following predefined number formats. Except for <span class="literal">"General Number"</span>, all of the predefined format codes return the number as a decimal number with two decimal places.</p>
<p id="par_id3150113" class="paragraph" dir="auto">Si se usan formatos predefinidos, el nombre del formato debe entrecomillarse.</p>
</div>
  <h3 id="hd_id681618825574599" dir="auto">Formatos predefinidos</h3>
  <div class="embedded">
<a id="formats"></a>
<p id="par_id3154730" class="paragraph" dir="auto"> <span class="emph">General Number</span>: los números se muestran tal como se han introducido.</p>
<p id="par_id3153158" class="paragraph" dir="auto"> <span class="emph">Currency</span>: inserta un signo de dólar delante del número y encierra los números negativos entre paréntesis.</p>
<p id="par_id3154490" class="paragraph" dir="auto"> <span class="emph">Fixed</span>: muestra al menos un dígito delante del separador decimal.</p>
<p id="par_id3153415" class="paragraph" dir="auto"> <span class="emph">Standard</span>: muestra números con un separador de millares.</p>
<p id="par_id3150715" class="paragraph" dir="auto"> <span class="emph">Percent</span>: multiplica el número por 100 y le añade un signo de porcentaje.</p>
<p id="par_id3153836" class="paragraph" dir="auto"> <span class="emph">Scientific</span>: muestra números en formato científico (por ejemplo, 1,00E+03 para 1000).</p>
<p id="par_id3153707" class="paragraph" dir="auto">Un código de <span class="literal">formato</span> puede dividirse en tres secciones, separadas por punto y coma. La primera define el formato de los valores positivos; la segunda, el de los negativos; y la tercera se aplica al cero. Si solamente se especifica un código de <span class="literal">formato</span>, este se aplicará a todos los números.</p>
</div>
  <div class="embedded">
<a id="languageformat"></a>
<p id="par_id3153381" class="paragraph" dir="auto">Puede definir el formato regional de los números, las fechas y las monedas en LibreOffice BASIC al dirigirse a <span id="swlnsystextsbasicshared00000003xml_1" class="switchinline"><span hidden="true" id="MACtextsbasicshared00000003xml_1" class="MAC"><span class="emph">LibreOffice ▸ Preferencias</span></span><span hidden="true" id="defaulttextsbasicshared00000003xml_1"><span class="emph">Herramientas ▸ Opciones</span></span></span><span class="emph"> ▸ Idiomas y regiones ▸ Generales</span>. En los códigos de formato de BASIC, el punto decimal (<span class="emph">.</span>) se utiliza siempre como <span class="emph">sustitutivo</span> del separador decimal definido en la configuración regional elegida; este punto se reemplazará por el carácter correspondiente.</p>
<p id="par_id3150870" class="paragraph" dir="auto">Lo mismo se aplica a los valores de configuración de los formatos de fecha, hora y moneda. El código de formato de Basic se interpretará y se mostrará según los valores de configuración del entorno local correspondientes.</p>
</div>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    txt = bas.Format(6328.2, '##.##0.00')
    print(txt)
  </code></pre></div>


<a id="GetDefaultContext"></a>
  
  <a id="bm_id71158950214765"></a>
    <meta itemprop="keywords" content="Basic service,GetDefaultContext">
  
  <h2 id="hd_id811589205147428" dir="auto">GetDefaultContext</h2>
  <p id="par_id451618876389887" class="paragraph" dir="auto">Devuelve el contexto predeterminado del servicio de procesos de fábrica, si lo hay; de lo contrario, devuelve una referencia nula.</p>
  <p id="par_id881618848030897" class="paragraph" dir="auto"><span class="literal">GetDefaultContext</span> is an alternative to the <a target="_top" href="es/text/sbasic/python/python_programming.html">getComponentContext()</a> method available from <span class="literal">XSCRIPTCONTEXT</span> global variable or from <a target="_top" href="es/text/sbasic/python/python_programming.html">uno.py</a> module.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id901668178405855" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.GetDefaultContext(): uno</span></p>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id381618831451271" class="paragraph" dir="auto">The default component context is used, when instantiating services via <span class="literal">XMultiServiceFactory</span>. See the <span class="literal">Professional UNO</span> chapter in the Developer's Guide on <a target="_blank" href="https://api.libreoffice.org/">api.libreoffice.org</a> for more information.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    ctx = bas.GetDefaultContext()
  </code></pre></div>


<a id="GetGuiType"></a>
  
  <a id="bm_id11758950214765"></a>
    <meta itemprop="keywords" content="Basic service,GetGuiType">
  
  <h2 id="hd_id118589205147428" dir="auto">GetGuiType</h2>
  <p id="par_id154618876389887" class="paragraph" dir="auto">Returns a numerical value that specifies the graphical user interface. This function is only provided for backward compatibility with previous versions.</p>
  <p id="par_id341618848532640" class="paragraph" dir="auto">Refer to <span class="literal">system()</span> method from <span class="literal">platform</span> Python module to <a target="_top" href="es/text/sbasic/python/python_platform.html">identify the operating system</a>.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id109668178405855" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.GetGuiType(): int</span></p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    n = bas.GetGuiType()
  </code></pre></div>


<a id="GetPathSeparator"></a>
  
  <a id="bm_id71158950214567"></a>
    <meta itemprop="keywords" content="Basic service,GetPathSeparator">
  
  <h2 id="hd_id811589205147824" dir="auto">GetPathSeparator</h2>
  <p id="par_id451618876389788" class="paragraph" dir="auto">Devuelve el separador de directorios, que depende del sistema operativo, utilizado para especificar las rutas de acceso de los archivos.</p>
    <p id="par_id341618848562340" class="paragraph" dir="auto">Use <span class="literal">os.pathsep</span> from <span class="literal">os</span> Python module to <a target="_top" href="es/text/sbasic/python/python_platform.html">identify the path separator</a>.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id901668178405558" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.GetPathSeparator(): str</span></p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    sep = bas.GetPathSeparator()
  </code></pre></div>


<a id="GetSystemTicks"></a>
  
  <a id="bm_id71155980214765"></a>
    <meta itemprop="keywords" content="Basic service,GetSystemTicks">
  
  <h2 id="hd_id811589503147428" dir="auto">GetSystemTicks</h2>
  <p id="par_id451618678389887" class="paragraph" dir="auto">Returns the number of system ticks provided by the operating system. You can use this function to optimize certain processes. Use this method to estimate time in milliseconds:</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id901667188405855" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.GetSystemTicks(): int</span></p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    ticks_ini = bas.GetSystemTicks()
    time.sleep(1)
    ticks_end = bas.GetSystemTicks()
    bas.MsgBox("{} - {} = {}".format(ticks_end, ticks_ini,ticks_end - ticks_ini))
  </code></pre></div>


<a id="BasicLibraries"></a>
  
  <a id="bm_id61618905161499"></a>    <meta itemprop="keywords" content="Basic service,GlobalScope.BasicLibraries">
  <h2 id="hd_id311618905373414" dir="auto">GlobalScope.BasicLibraries</h2>
  <p id="par_id741622396277528" class="paragraph" dir="auto">Returns the UNO object containing all shared Basic libraries and modules.</p>
  <p id="par_id911622396571584" class="paragraph" dir="auto">This method is the Python equivalent to <span class="literal">GlobalScope</span>.<span class="literal">BasicLibraries</span> in Basic scripts.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id511622395511116" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.GlobalScope.BasicLibraries(): uno</span>
  </p>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id641622396435583" class="paragraph" dir="auto"><a target="_blank" href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1XLibraryContainer.html"><span class="literal">com.sun.star.script.XLibraryContainer</span></a></p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <p id="par_id281622398076950" class="paragraph" dir="auto">El ejemplo siguiente carga la biblioteca Gimmicks de BASIC si todavía no se ha cargado.</p>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    libs = bas.GlobalScope.BasicLibraries()
    if not libs.isLibraryLoaded("Gimmicks"):
        libs.loadLibrary("Gimmicks")
  </code></pre></div>


<a id="DialogLibraries"></a>
  
  <a id="bm_id61618905163671"></a>    <meta itemprop="keywords" content="Basic service,GlobalScope.DialogLibraries">
  <h2 id="hd_id311618905376155" dir="auto">GlobalScope.DialogLibraries</h2>
  <p id="par_id381622397863419" class="paragraph" dir="auto">Devuelve el objeto UNO que contiene todas las bibliotecas compartidas de diálogos.</p>
  <p id="par_id491622397863810" class="paragraph" dir="auto">This method is the Python equivalent to <span class="literal">GlobalScope</span>.<span class="literal">DialogLibraries</span> in Basic scripts.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id181622395563705" class="paragraph" dir="auto">
    <span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.GlobalScope.DialogLibraries(): uno</span>
  </p>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id641622396435133" class="paragraph" dir="auto"><a target="_blank" href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1XLibraryContainer.html"><span class="literal">com.sun.star.comp.sfx2.DialogLibraryContainer</span></a></p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <p id="par_id811622398234384" class="paragraph" dir="auto">The following example shows a message box with the names of all available dialog libraries.</p>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    dlg_libs = bas.GlobalScope.DialogLibraries()
    lib_names = dlg_libs.getElementNames()
    bas.MsgBox("\n".join(lib_names))
  </code></pre></div>


<a id="InputBox"></a>
  
  <a id="bm_id61618905164342"></a>    <meta itemprop="keywords" content="servicio de Basic,InputBox">
  <h2 id="hd_id311618905372258" dir="auto">InputBox</h2>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id91619007097426" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.InputBox(prompt: str, [title: str], [default: str], [xpostwips: int, ypostwips: int]): str</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <div class="embedded">
<a id="parameters"></a>
<p id="par_id3153311" class="paragraph" dir="auto"> <span class="emph">prompt</span>: String expression displayed as the message in the dialog box.</p>
<p id="par_id3145315" class="paragraph" dir="auto"> <span class="emph">título</span>: expresión de cadena que se muestra en la barra de título del cuadro de diálogo.</p>
<p id="par_id3154307" class="paragraph" dir="auto"> <span class="emph">default</span>: String expression displayed in the text box as default if no other input is given.</p>
<p id="par_id3147573" class="paragraph" dir="auto"> <span class="emph">xpostwips</span>: Integer expression that specifies the horizontal position of the dialog. The position is an absolute coordinate and does not refer to the window of LibreOffice.</p>
<p id="par_id3156024" class="paragraph" dir="auto"> <span class="emph">ypostwips</span>: Integer expression that specifies the vertical position of the dialog. The position is an absolute coordinate and does not refer to the window of LibreOffice.</p>
<p id="par_id3153897" class="paragraph" dir="auto">If <span class="literal">xpostwips</span> and <span class="literal">ypostwips</span> are omitted, the dialog is centered on the screen. The position is specified in <a target="_top" href="es/text/sbasic/shared/00000002.html#twips">twips</a>.</p>
</div>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id21619008398677" class="paragraph" dir="auto">String</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <a id="ui"></a>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    txt = s.InputBox('Introduzca una oración:', "Estimadx usuarix")
    s.MsgBox(txt, s.MB_ICONINFORMATION, "Confirmation of phrase")
  </code></pre></div>
  <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_id651618921455396" dir="auto">For in-depth information please refer to <a target="_blank" href="https://wiki.documentfoundation.org/Macros/General/IO_to_Screen">Input/Output to Screen with Python</a> on the Wiki.</p></div>
</div>
<br>
  


<a id="MsgBox"></a>
  
  <a id="bm_id681618905411293"></a>    <meta itemprop="keywords" content="servicio de BASIC,MsgBox">
  <h2 id="hd_id181618br/905397758" dir="auto">MsgBox</h2>
  <p id="par_id231618922407948" class="paragraph" dir="auto">Displays a dialog box containing a message and returns an optional value.<br>MB_xx constants help specify the dialog type, the number and type of buttons to display, plus the icon type. By adding their respective values they form bit patterns, that define the <span class="literal">MsgBox</span> dialog appearance.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id71618922431508" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">bas.MsgBox(prompt: str, [buttons: int], [title: str])[: int]</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <div class="embedded">
<a id="parameters"></a>
<p id="par_id3148798" class="paragraph" dir="auto"> <span class="emph">prompt</span>: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13).</p>
<p id="par_id3150769" class="paragraph" dir="auto"> <span class="emph">title</span>: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application.</p>
<p id="par_id3147228" class="paragraph" dir="auto"> <span class="emph">buttons</span>: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. <span class="emph">buttons</span> represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values:</p>
</div>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id711619082902143" class="paragraph" dir="auto">An optional integer as detailed in above <span class="literal">IDxx</span> properties.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="embedded">
<a id="ui"></a>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    txt = s.InputBox('Introduzca una oración:', "Estimadx usuarix")
    s.MsgBox(txt, s.MB_ICONINFORMATION, "Confirmation of phrase")
  </code></pre></div>
  <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_id651618921455396" dir="auto">For in-depth information please refer to <a target="_blank" href="https://wiki.documentfoundation.org/Macros/General/IO_to_Screen">Input/Output to Screen with Python</a> on the Wiki.</p></div>
</div>
<br>
  </div>


<a id="Now"></a>
  
  <a id="bm_id791618906935711"></a>    <meta itemprop="keywords" content="servicio de BASIC,Now">
  <h2 id="hd_id231618906957248" dir="auto">Now</h2>
  <p id="par_id191619084216660" class="paragraph" dir="auto">Returns the current system date and time as a <span class="literal">datetime</span>.<span class="literal">datetime</span> Python native object.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id631619084685488" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.Now(): datetime</span></p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    bas.MsgBox(bas.Now(), bas.MB_OK, "Now")
  </code></pre></div>


<a id="RGB"></a>
  
  <a id="bm_id831618907521168"></a>    <meta itemprop="keywords" content="servicio de BASIC,RGB">
  <h2 id="hd_id871618907784332" dir="auto">RGB</h2>
  <p id="par_id621619448293385" class="paragraph" dir="auto">Returns an integer color value consisting of red, green, and blue components.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id201619096429785" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.RGB(red:int, green: int, blue: int): int</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <div class="embedded">
<a id="parameters"></a>
<a id="parameters1"></a>
<p id="par_id3152597" class="paragraph" dir="auto"> <span class="emph">red</span>: Any integer expression that represents the red component (0-255) of the composite color.</p>
<p id="par_id3146974" class="paragraph" dir="auto"> <span class="emph">green</span>: Any integer expression that represents the green component (0-255) of the composite color.</p>
<p id="par_id3151113" class="paragraph" dir="auto"> <span class="emph">blue</span>: Any integer expression that represents the blue component (0-255) of the composite color.</p>

<p id="par_id101639922410794" class="paragraph" dir="auto">The resulting <span class="literal">Long</span> value is calculated with the following formula:<br><span class="literal">Result = red×65536 + green×256 + blue</span>.</p>
<div class="warning">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/warning.svg" alt="warning" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id671639922129017" dir="auto">Under VBA compatibility mode (<a target="_top" href="es/text/sbasic/shared/03103350.html"><span class="literal">Option VBASupport 1</span></a>), the <span class="literal">Long</span> value is calculated as<br><span class="literal">Result = red + green×256 + blue×65536</span><br>See <a target="_top" href="es/text/sbasic/shared/03010306.html">RGB Function [VBA]</a></p></div>
</div>
<br>

<div class="tip">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/tip.svg" alt="tip" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id211587653651037" dir="auto">The <a target="_top" href="es/text/shared/optionen/01010501.html">color picker dialog</a> helps computing red, green and blue components of a composite color. <a target="_top" href="es/text/shared/guide/text_color.html">Changing the color of text</a> and selecting <span class="emph">Custom color</span> displays the color picker dialog.</p></div>
</div>
<br>
</div>
  <div class="embedded">
<a id="functvalue"></a>
<h3 id="hd_id061420171139087480" dir="auto">Valor de retorno:</h3>
</div>
  <p id="par_id381619096830033" class="paragraph" dir="auto">Integer</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    YELLOW = bas.RGB(255,255,0)
  </code></pre></div>


<a id="Xray"></a>
  
  <a id="bm_id81618907851793"></a>    <meta itemprop="keywords" content="servicio de BASIC,Xray">
  <h2 id="hd_id211618907871281" dir="auto">Xray</h2>
  <p id="par_id451619094057178" class="paragraph" dir="auto">Inspect Uno objects or variables.</p>
  <div class="embedded">
<a id="functsyntax"></a>
<h3 id="hd_id061420171139089682" dir="auto">Sintaxis:</h3>
</div>
  <p id="par_id301619094111856" class="paragraph" dir="auto"><span class="input" data-tooltip="Pulse en el texto para copiarlo en el portapapeles">svc.Xray(obj: any)</span></p>
  <div class="embedded">
<a id="functparameters"></a>
<h3 id="hd_id061420171139084157" dir="auto">Parámetros:</h3>
</div>
  <p id="par_id21619094660345" class="paragraph" dir="auto"><span class="emph">obj</span>: A variable or UNO object.</p>
  <div class="embedded">
<a id="functexample"></a>
<h3 id="hd_id061420171139088233" dir="auto">Ejemplo:</h3>
</div>
  <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet" data-tooltip="Pulse en el texto para copiarlo en el portapapeles"><pre dir="auto"><code class="language-python line-numbers">
    bas.Xray(bas.StarDesktop)
  </code></pre></div>


  <div class="embedded">
<a id="SF_InternalUse"></a>
      <div class="warning">
<div class="noteicon" dir="auto"><img src="media/icon-themes/res/helpimg/warning.svg" alt="warning" style="width:40px;height:40px;"></div>
<div class="notetext"><p id="par_id851506659675843" dir="auto">Todas las rutinas o identificadores BASIC de <span class="literal">ScriptForge</span> precedidas por guion bajo «_» están reservadas para uso interno. No deben utilizarse en macros BASIC o secuencias Python.</p></div>
</div>
<br>
    </div>
  <a id="relatedtopics"></a><div class="relatedtopics">
<p class="related" itemprop="mentions" dir="auto"><a id="related"></a><span class="emph">Temas relacionados</span></p>
<div class="relatedbody" itemprop="mentions">
    <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="es/text/sbasic/shared/03131900.html">GlobalScope specifier</a></p></div>
    <div class="embedded"><p class="embedded" dir="auto"><a target="_top" href="es/text/sbasic/python/python_programming.html">Programar con secuencias de órdenes en Python</a></p></div>
    <p id="par_id901618486941514" class="paragraph" dir="auto"><a target="_top" href="es/text/sbasic/python/python_programming.html">uno.fileUrlToSystemPath()</a></p>
    <p id="par_id901618496841514" class="paragraph" dir="auto"><a target="_top" href="es/text/sbasic/python/python_programming.html">uno.systemPathToFileUrl()</a></p>
    <p id="par_id951618554355538" class="paragraph" dir="auto"><a target="_blank" href="https://wiki.documentfoundation.org/Macros/General/IO_to_Screen">Input/Output to Screen with Python</a> on the wiki</p>
    <p id="par_id610918486941514" class="paragraph" dir="auto"><a target="_top" href="es/text/sbasic/python/python_programming.html">XSCRIPTCONTEXT.getComponentContext()</a></p>
    <p id="par_id901618484961514" class="paragraph" dir="auto"><a target="_top" href="es/text/sbasic/python/python_programming.html">uno.getComponentContext()</a></p>
    <p id="par_id901648186941514" class="paragraph" dir="auto"><a target="_top" href="es/text/sbasic/python/python_platform.html">platform.system()</a></p>
    <p id="par_id901816486941514" class="paragraph" dir="auto"><a target="_top" href="es/text/sbasic/python/python_platform.html">os.pathsep()</a></p>
</div>
</div>
</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/sbasic/shared/03/sf_basic.xhp" target="_blank">/text/sbasic/shared/03/sf_basic.xhp</a></p>
<p dir="auto">Title is: Servicio ScriptForge.Basic</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>

Filemanager

Name Type Size Permission Actions
avail_release.html File 8.05 KB 0644
lib_ScriptForge.html File 54.61 KB 0644
lib_depot.html File 5.35 KB 0644
lib_euro.html File 7.64 KB 0644
lib_formwizard.html File 5.38 KB 0644
lib_gimmicks.html File 7.76 KB 0644
lib_importwiz.html File 7.59 KB 0644
lib_schedule.html File 5.47 KB 0644
lib_script.html File 5.91 KB 0644
lib_template.html File 5.37 KB 0644
lib_tools.html File 74.88 KB 0644
lib_wikieditor.html File 5.62 KB 0644
sf_array.html File 84.5 KB 0644
sf_base.html File 45.49 KB 0644
sf_basic.html File 78.88 KB 0644
sf_calc.html File 209.75 KB 0644
sf_chart.html File 35.85 KB 0644
sf_database.html File 66.35 KB 0644
sf_dataset.html File 59.17 KB 0644
sf_datasheet.html File 42.59 KB 0644
sf_dialog.html File 164.91 KB 0644
sf_dialogcontrol.html File 92.57 KB 0644
sf_dictionary.html File 42.93 KB 0644
sf_document.html File 87.26 KB 0644
sf_exception.html File 47.22 KB 0644
sf_filesystem.html File 106.92 KB 0644
sf_form.html File 68.52 KB 0644
sf_formcontrol.html File 71.36 KB 0644
sf_formdocument.html File 24.99 KB 0644
sf_intro.html File 28.11 KB 0644
sf_l10n.html File 41.17 KB 0644
sf_menu.html File 36.53 KB 0644
sf_methods.html File 15.38 KB 0644
sf_platform.html File 32.07 KB 0644
sf_popupmenu.html File 32.73 KB 0644
sf_region.html File 48.56 KB 0644
sf_services.html File 13.42 KB 0644
sf_session.html File 58.96 KB 0644
sf_string.html File 125.2 KB 0644
sf_textstream.html File 28.87 KB 0644
sf_timer.html File 23.87 KB 0644
sf_toc.html File 136.53 KB 0644
sf_toolbar.html File 20.46 KB 0644
sf_toolbarbutton.html File 25.53 KB 0644
sf_ui.html File 63.35 KB 0644
sf_unittest.html File 62.35 KB 0644
sf_writer.html File 24.55 KB 0644
Filemanager