topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
harbour_for_mod_harbour error compiler | to build the .hrb file do: harbour -gh -n testhrb.prg
Please review mod_harbour/samples/plugin.prg and testhrb.prg (and .hrb) |
harbour_for_mod_harbour error compiler | Hi Antonio,
for do this test i need to obtain harbour.exe to build hrb file.
Where i find it ?
I've download all the sources for harbour_for_modharbour and recompile all
but I have the error i sent you .
Can you tell me where i can obtain harbour.exe with the last improvement ?
Thanks
Giuliano |
harbour_for_mod_harbour error compiler | Giuliano
<!-- m --><a class="postlink" href="https://github.com/harbour/core">https://github.com/harbour/core</a><!-- m --> |
harbour_for_mod_harbour error compiler | Thanks Carles,
I think we must use a particular release of harbour .
So i made a test with the official harbour release and i generate my first hrb files.
All is ok.
Now i've another problem . Some commands are giving error in compiling procedure
like DEFAULT values and TRY CATCH ...
Thanks to all
Giuliano |
harbour_for_mod_harbour error compiler | Hi to all,
here my example ( and errors ) :
[code=fw:3g7dw68d]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Function</span> TEST<span style="color: #000000;">(</span>cstring<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">local</span> number:=<span style="color: #000000;">0</span><br /><span style="color: #00C800;">DEFAULT</span> cstring <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">""</span><br /><br /><span style="color: #00C800;">IF</span> cstring == <span style="color: #ff0000;">"error"</span><br /> number:=<span style="color: #000000;">18</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">TRY</span><br /> number++<br />CATCH<br />FINALLY<br /> number:=<span style="color: #000000;">0</span><br />END<br /><br /><span style="color: #00C800;">Return</span> number<br /> </div>[/code:3g7dw68d]
test.prg(4) Error E0030 Syntax error "syntax error at 'CSTRING'"
test.prg(10) Error E0020 Incomplete statement or unbalanced delimiters
test.prg(12) Error E0020 Incomplete statement or unbalanced delimiters
test.prg(13) Error E0020 Incomplete statement or unbalanced delimiters
test.prg(15) Error E0010 ENDIF does not match IF
Thanks
Giuliano |
harbour_for_mod_harbour error compiler | Amigo,
La linea 4 debe estar como sigue:
DEFAULT cString := ""
Saludos |
harbour_for_mod_harbour error compiler | Also
[code=fw:1i0xzwwr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> hb_default<span style="color: #000000;">(</span> @cString, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span><br /> </div>[/code:1i0xzwwr] |
harbour_for_mod_harbour error compiler | Thanks cnavarro,
hb_default(.....) works perfectly.
Have you any solution for TRY CATCH ?
Bye
Giuliano |
harbour_for_mod_harbour error compiler | Giuliano,
TRY ... CATCH is already supported in mod_harbour
Please run ? hb_BuildDate() and let me know what you get |
harbour_for_mod_harbour error compiler | Antonio,
i use harbour_msvc64_20190508.zip download
from a link you have posted in this forum.
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=16&t=37140&hilit=msvc64">viewtopic.php?f=16&t=37140&hilit=msvc64</a><!-- l -->
Thanks
Giuliano |
harbour_for_mod_harbour error compiler | #xcommand TRY => BEGIN SEQUENCE WITH {| oErr | Break( oErr ) }
#xcommand CATCH [<!oErr!>] => RECOVER [USING <oErr>] <-oErr->
#xcommand FINALLY => ALWAYS
simply add these lines at the top of your PRGs, that you are going to turn into HRB files |
harbour_for_mod_harbour error compiler | Perfect.
It works.
Thanks for your support
Giuliano |
harbour_for_modharbour | Dear Antonio, what is the difference between: FiveTechSoft/harbour_for_modharbour and
FiveTechSoft/mod_harbour.
Best regards
Otto |
harbour_for_modharbour | Andreu Botella's right answer:
[quote:3cjv3zfy]The mod_harbour repo contains the code for the apache module proper, as well as builds and samples.
harbour_for_modharbour is a fork of the normal harbour/core repo adding build tools to build a version of libharbour that's specific to mod_harbour, including the compiler and debugger, as well as the contrib libraries[/quote:3cjv3zfy] |
harbour_for_modharbour+crear libreria hbgd | Hola amigos
Como puedo crear la libreria hbgd, ya que necesito probar los ejemplos que tiene de // EAN128 |
harbour_for_modharbour+crear libreria hbgd | Adolfredo,
Harbour_for_modharbour ya no hace falta. Se usó en el desarrollo de mod_harbour pero ya no se usa.
Para construir hbgd situate en la carpeta hbgd
cd c:\harbour\contrib\hbgd\
y haz:
hbmk2 hbgd |
harbour_for_modharbour+crear libreria hbgd | ok
Lo que busco es crear el codigo de barra Ean-128.
Gracia antonio. |
hardware maintenance tonight | This email is notification of hardware maintenance tonight,14 August,
2014, between 10:00 pm and 2:00am MDT (UTC/GMT-6), for the server
which hosts fivetechsupport.com.
The maintenance will include approximately 30 minutes of downtime
during this time. None of your data will be lost, and any temporary
performance issues you experience may be due to the maintenance
process.
We apologize for such short notice and for any inconvenience this may
cause.
Bluehost Support
<!-- m --><a class="postlink" href="http://www.bluehost.com">http://www.bluehost.com</a><!-- m -->
For support go to <!-- m --><a class="postlink" href="http://helpdesk.bluehost.com/">http://helpdesk.bluehost.com/</a><!-- m -->
Toll-Free: (888) 401-4678 |
harupdf tamaño del papel | buenas tardes compañeros estamos tratando de generar un ticket de un POS
no sabemos como poner el papel ( tamano ) tenemos solo estas posibilidades
usamos harupdf
/* HPDF_PageSizes */
#define HPDF_PAGE_SIZE_LETTER 0
#define HPDF_PAGE_SIZE_LEGAL 1
#define HPDF_PAGE_SIZE_A3 2
#define HPDF_PAGE_SIZE_A4 3
#define HPDF_PAGE_SIZE_A5 4
#define HPDF_PAGE_SIZE_B4 5
#define HPDF_PAGE_SIZE_B5 6
#define HPDF_PAGE_SIZE_EXECUTIVE 7
#define HPDF_PAGE_SIZE_US4x6 8
#define HPDF_PAGE_SIZE_US4x8 9
#define HPDF_PAGE_SIZE_US5x7 10
#define HPDF_PAGE_SIZE_COMM10 11
#define HPDF_PAGE_SIZE_EOF 12
hemos probado casi todos y no da
alguien ha hecho eso es para una impresora termica bematech de rollo de papel de ancho 7.8 cm y largo infinito
gracias por su ayuda
Wilson |
harupdf tamaño del papel | No tiens un ejemplo mas completo para probas?
Saludos. |
harupdf tamaño del papel | [code=fw:20j3a8dp]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> InvoiceMask<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> j<br /> <span style="color: #00C800;">local</span> x := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> y := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> aSeries1 := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> aSeries2 := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> nCount := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nIva0SinDes := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nIva10SinDes := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nIva0ConDes := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nIva10ConDes := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nSubSinDesBonif := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nSubBonif := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nValSinDesBonif := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nValBonif := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nSubDescuento := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nValDescuento := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> oFp := tWg_FormasPagoDocus<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> nLineas <br /><br /><br /><span style="color: #00D7D7;">#define</span> ANCHO_FACTURA <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> COD_SERVICIO_TECNICO <span style="color: #ff0000;">'nnnn'</span><br /><br /><span style="color: #B900B9;">// #define HPDF_DEF_PAGE_WIDTH 595.276</span><br /><span style="color: #B900B9;">// #define HPDF_DEF_PAGE_HEIGHT 841.89</span><br /><br /><br /> oPdf:<span style="color: #000000;">nMargin</span> = <span style="color: #000000;">0</span><br /><br /><span style="color: #B900B9;">//* HPDF_PageSizes */</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_LETTER 0</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_LEGAL 1</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_A3 2</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_A4 3</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_A5 4</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_B4 5</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_B5 6</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_EXECUTIVE 7</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_US4x6 8</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_US4x8 9</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_US5x7 10</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_COMM10 11</span><br /><span style="color: #B900B9;">//#define HPDF_PAGE_SIZE_EOF 12</span><br /><br /><br /> oPdf:<span style="color: #000000;">nPageSize</span> = <span style="color: #000000;">1</span><br /><br /> oPdf:<span style="color: #000000;">PAGE_WIDTH</span> = <span style="color: #000000;">221.10</span><br /> oPdf:<span style="color: #000000;">PAGE_HEIGHT</span> = <span style="color: #000000;">1050.00</span> <span style="color: #B900B9;">//para 11 lineas es 1.4 por cada producto </span><br /> <span style="color: #B900B9;">// es decir es 15.4 para 11 </span><br /> <span style="color: #B900B9;">// debemos restar los 15.4 y luego aumentar</span><br /> <span style="color: #B900B9;">// 1.4 por cada fila </span><br /> nLineas = lineasDocu<span style="color: #000000;">(</span> factura->num_fact, <span style="color: #ff0000;">'factura'</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//oPdf:PAGE_HEIGHT = 700.00 - 15.4 + nLineas * 1.4</span><br /> <span style="color: #B900B9;">//oPdf:PAGE_HEIGHT = 700.00 - 30 + nLineas * 1.4</span><br /><br /> oPDF:<span style="color: #000000;">PageHeader</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//oPdf:DrawImage( 'ARCHIVO', FILA, COLUMNA, ANCHO, LARGO )</span><br /> oPdf:<span style="color: #000000;">DrawImage</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'logo.jpg'</span>, <span style="color: #000000;">09.5</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">10</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// oPDF:DrawRetangle( 0, 0, 41, 75 ) // cuadro total</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">2.0</span>, <span style="color: #000000;">0</span>, <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>setup->se_nomcom,<span style="color: #000000;">1</span>,<span style="color: #000000;">38</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">9.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">3.0</span>, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">'R U C : '</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">3.0</span>, <span style="color: #000000;">11</span>, setup->se_ruc, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">9.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><span style="color: #B900B9;">//*****************INCIO DATOS DE LA FACTURA*******************************************</span><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><br /> <span style="color: #B900B9;">//oPDF:DrawRetangle( Y, X, ANCHO, LARGO ) //cuadro datos factura</span><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> <span style="color: #000000;">9.3</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">39</span>, <span style="color: #000000;">19.2</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">//oPDF:DrawText(FILA, COLUMNA, 'TEXTO', 'FORMATO', TAMAÑO,'TIPO DE LETRA' , 0 )</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">1</span>, FACTURA->Num_Fact, <span style="color: #ff0000;">'9999999'</span>, <span style="color: #000000;">5.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">06</span>, <span style="color: #ff0000;">'Factura No. '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">8.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> empty<span style="color: #000000;">(</span> factura->num_num_fa <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">17</span>,strzero<span style="color: #000000;">(</span>cajas->num_local,<span style="color: #000000;">3</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">'-'</span>+strzero<span style="color: #000000;">(</span>cajas->num_establ,<span style="color: #000000;">3</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">'-'</span>+strzero<span style="color: #000000;">(</span>factura->num_fact,<span style="color: #000000;">9</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">9.5</span>, <span style="color: #ff0000;">'Courier'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">17</span>,strzero<span style="color: #000000;">(</span>cajas->num_local,<span style="color: #000000;">3</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">'-'</span>+strzero<span style="color: #000000;">(</span>cajas->num_establ,<span style="color: #000000;">3</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">'-'</span>+strzero<span style="color: #000000;">(</span>factura->num_num_fa,<span style="color: #000000;">9</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">9.5</span>, <span style="color: #ff0000;">'Courier'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> end<br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">10.7</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">' Fecha : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">10.7</span>, <span style="color: #000000;">14</span>, Factura->Fecha_Fa, <span style="color: #ff0000;">'99/99/9999!'</span>, <span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">11.4</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">' Ambiente : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">11.4</span>, <span style="color: #000000;">14</span>, <span style="color: #ff0000;">'PRODUCCION '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">12.1</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'Contribuyente : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">12.1</span>, <span style="color: #000000;">14</span>, <span style="color: #ff0000;">'OBLIGADO A LLEVAR CONTABILIDAD'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">12.1</span>, <span style="color: #000000;">38</span>, <span style="color: #ff0000;">'SI'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">7.0</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">12.8</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">' Dir. Matriz : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">13.5</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'CALLE S59 S/N Y CALLE E2 C CDLA. MATILDE DE '</span>, <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">14.2</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">' ALVAREZ - GUAMANI - QUITO'</span>, <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">14.9</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'Numero de Autorizacion SRI : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> #ifdef __FE_OFFLINE__<br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">15.6</span>, <span style="color: #000000;">2</span>, factura->sri_acceso, <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> #else<br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">15.6</span>, <span style="color: #000000;">2</span>, factura->sri_autori, <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> #endif<br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">16.3</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'Clave de Acceso SRI : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><span style="color: #B900B9;">//*****************INICIO CODIGO DE BARRAS*********************************************</span><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /> <span style="color: #00C800;">if</span> factura->anulada == .T.<br /> oPDF:<span style="color: #000000;">Drawtext</span><span style="color: #000000;">(</span> <span style="color: #000000;">17.0</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'>>>>FACTURA ANULADA<<<<'</span>, <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">12</span>, <span style="color: #ff0000;">'Courier'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">if</span> !empty<span style="color: #000000;">(</span> factura->sri_acceso <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//DrawBarcode( oPdf:oPage, y , ancho, "CODE128", alltrim( factura->sri_acceso ), , margen izq)</span><br /> DrawBarcode<span style="color: #000000;">(</span> oPdf:<span style="color: #000000;">oPage</span>, <span style="color: #000000;">197</span>, <span style="color: #000000;">0.61</span> , <span style="color: #ff0000;">"CODE128"</span>, alltrim<span style="color: #000000;">(</span> factura->sri_acceso <span style="color: #000000;">)</span>, , <span style="color: #000000;">13</span> <span style="color: #000000;">)</span><br /> end<br /> end<br /> <span style="color: #B900B9;">//FIN CODIGO DE BARRAS//</span><br /><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">21.0</span>, <span style="color: #000000;">2.5</span>, Factura->Sri_Acceso, <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">6.7</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">21.7</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'Nombres y Apellidos / Razon Social :'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">if</span> <span style="color: #ff0000;">'9999999999999'</span> $ clientes->ruc<br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">22.4</span>, <span style="color: #000000;">2</span>, factura->nombre , <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">22.4</span>, <span style="color: #000000;">2</span>, clientes->nomcli+clientes->nomcli2 , <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> end<br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">23.1</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'C.I. / R.U.C. : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> <span style="color: #ff0000;">'9999999999999'</span> $ clientes->ruc<br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">23.1</span>, <span style="color: #000000;">14</span> ,factura->cedula , <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">23.1</span>, <span style="color: #000000;">14</span> ,clientes->ruc , <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> end<br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">23.1</span>, <span style="color: #000000;">20</span>, <span style="color: #ff0000;">' Codigo :'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">23.1</span>, <span style="color: #000000;">35</span>, strzero<span style="color: #000000;">(</span>clientes->codcli,<span style="color: #000000;">5</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">23.8</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'Fecha y Hora de Emision : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">23.8</span>, <span style="color: #000000;">22</span>, <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>factura->sri_feauto,<span style="color: #000000;">1</span>,<span style="color: #000000;">10</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">23.8</span>, <span style="color: #000000;">32</span>, <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>factura->sri_feauto,<span style="color: #000000;">12</span>,<span style="color: #000000;">8</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">7.0</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><span style="color: #B900B9;">//**************INICIO lineas de las columnas del detalle de la factura***************</span><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> <span style="color: #000000;">24.5</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">39</span>, <span style="color: #000000;">1.4</span>,,<span style="color: #000000;">2</span>, <span style="color: #000000;">{</span><span style="color: #000000;">0.75</span>, <span style="color: #000000;">0.75</span>, <span style="color: #000000;">0.75</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//Sombra cuadro cabecera líneas</span><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> <span style="color: #000000;">24.5</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">39</span>, <span style="color: #000000;">1.4</span> <span style="color: #000000;">)</span><span style="color: #B900B9;">//cuadro cabecera líneas</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> <span style="color: #000000;">25.2</span>, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">' D E T A L L E % CANTIDAD P. UNIT P. TOTAL'</span>,<span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> x= <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">while</span> ventas->num_fact == factura->num_fact .and. !ventas-><span style="color: #000000;">(</span>eof<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> x + <span style="color: #000000;">25.9</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">39</span>, <span style="color: #000000;">0.1</span>, , <span style="color: #000000;">7</span>, <span style="color: #000000;">{</span><span style="color: #000000;">0.9</span>, <span style="color: #000000;">0.9</span>, <span style="color: #000000;">0.9</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// dibuja las lineas transparentes del cuerpo</span><br /><br /> producto-><span style="color: #000000;">(</span> dbseek<span style="color: #000000;">(</span> ventas->cod_prod <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">Drawtext</span><span style="color: #000000;">(</span> x + <span style="color: #000000;">25.0</span>, <span style="color: #000000;">2.0</span>, saycodigo<span style="color: #000000;">(</span> producto->CODBARRAS <span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>, <span style="color: #ff0000;">'Courier'</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cod barras líneas</span><br /> oPDF:<span style="color: #000000;">Drawtext</span><span style="color: #000000;">(</span> x + <span style="color: #000000;">25.0</span>, <span style="color: #000000;">22.0</span>, saycodigo<span style="color: #000000;">(</span> ventas->cod_prod <span style="color: #000000;">)</span> , <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>, <span style="color: #ff0000;">'Courier'</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//código línes</span><br /> oPDF:<span style="color: #000000;">Drawtext</span><span style="color: #000000;">(</span> x + <span style="color: #000000;">25.7</span>, <span style="color: #000000;">1.0</span>, <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>saycodigo<span style="color: #000000;">(</span> producto->descrip, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">16</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>, <span style="color: #ff0000;">'Courier'</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//producto líenas</span><br /> oPDF:<span style="color: #000000;">Drawtext</span><span style="color: #000000;">(</span> x + <span style="color: #000000;">25.7</span>, <span style="color: #000000;">13.0</span>, ventas->descuento, <span style="color: #ff0000;">'999.99'</span>, <span style="color: #000000;">6.5</span>, <span style="color: #ff0000;">'Courier'</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// descuento líneas</span><br /> oPDF:<span style="color: #000000;">Drawtext</span><span style="color: #000000;">(</span> x + <span style="color: #000000;">25.7</span>, <span style="color: #000000;">17.0</span>, ventas->cantidad , <span style="color: #ff0000;">'999,999.99'</span>, <span style="color: #000000;">6.5</span>, <span style="color: #ff0000;">'Courier'</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cantidad líneas</span><br /> oPDF:<span style="color: #000000;">Drawtext</span><span style="color: #000000;">(</span> x + <span style="color: #000000;">25.7</span>, <span style="color: #000000;">26.0</span>, ventas->precio, <span style="color: #ff0000;">'999.9999'</span>, <span style="color: #000000;">6.5</span>, <span style="color: #ff0000;">'Courier'</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// precio líneas</span><br /> oPDF:<span style="color: #000000;">Drawtext</span><span style="color: #000000;">(</span> x + <span style="color: #000000;">25.7</span>, <span style="color: #000000;">33.0</span>, ventas->sub_tot, <span style="color: #ff0000;">'999,999.99'</span>, <span style="color: #000000;">6.5</span>, <span style="color: #ff0000;">'Courier'</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// sub total línes</span><br /><br /> nIva0SinDes += <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Producto->Iva ><span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> , ventas->PRECIO * ventas->VENTA <span style="color: #000000;">)</span><br /> nIva10SinDes += <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Producto->Iva ><span style="color: #000000;">0</span>, ventas->PRECIO * ventas->VENTA , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> nIva0ConDes += <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Producto->Iva ><span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> ,ventas->Sub_Tot <span style="color: #000000;">)</span><br /> nIva10ConDes += <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> Producto->Iva ><span style="color: #000000;">0</span>, ventas->Sub_Tot, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> nSubSinDesBonif += ventas->Cantidad * ventas->Precio<br /> nSubBonif += ventas->Bonif * ventas->Precio<br /> nValSinDesBonif := ventas->Cantidad * ventas->Precio<br /> nValBonif := ventas->Bonif * ventas->Precio<br /> nSubDescuento += ventas->Venta * ventas->Precio * ventas->descuento/<span style="color: #000000;">100</span><br /> nValDescuento := ventas->Venta * ventas->Precio * ventas->descuento/<span style="color: #000000;">100</span><br /> x += <span style="color: #000000;">(</span><span style="color: #000000;">0.7</span>*<span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> nCount = <span style="color: #000000;">0</span><br /><br /> ventas-><span style="color: #000000;">(</span> dbskip<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> end<br /><br /> y=x<span style="color: #000000;">+25</span><br /><br /><span style="color: #B900B9;">// Fin detalle de la factura</span><br /><br /><br /><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><span style="color: #B900B9;">//**************Inicio Pie de FACTURA datos adicionales del cliente********************</span><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> y, <span style="color: #000000;">1</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">0.8</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cuadro datos cliente</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+0.5</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'DATOS ADICIONALES CLIENTES'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> y, <span style="color: #000000;">1</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">7.8</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cuadro datos cliente</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+1.4</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'Direccion : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+2.1</span>, <span style="color: #000000;">2</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'9999999999999'</span> $ clientes->ruc , <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>factura->direccion,<span style="color: #000000;">1</span>,<span style="color: #000000;">30</span><span style="color: #000000;">)</span> , <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>clientes->dirtrabaj+<span style="color: #0000ff;">left</span><span style="color: #000000;">(</span>clientes->direc1,<span style="color: #000000;">12</span><span style="color: #000000;">)</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">30</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+2.1</span>, <span style="color: #000000;">2</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'9999999999999'</span> $ clientes->ruc , <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>factura->direccion,<span style="color: #000000;">31</span>,<span style="color: #000000;">60</span><span style="color: #000000;">)</span> , <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>clientes->dirtrabaj+<span style="color: #0000ff;">left</span><span style="color: #000000;">(</span>clientes->direc1,<span style="color: #000000;">12</span><span style="color: #000000;">)</span>,<span style="color: #000000;">31</span>,<span style="color: #000000;">60</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+2.8</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'Telefono : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+2.8</span>, <span style="color: #000000;">14.5</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'9999999999999'</span> $ clientes->ruc , factura->telefono , clientes->teleftrab<span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+3.5</span>, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">'E-mail : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+4.2</span>, <span style="color: #000000;">2</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'9999999999999'</span> $ clientes->ruc ,<span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>factura->email,<span style="color: #000000;">1</span>,<span style="color: #000000;">30</span><span style="color: #000000;">)</span> , <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>clientes->email,<span style="color: #000000;">1</span>,<span style="color: #000000;">30</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+4.8</span>, <span style="color: #000000;">2</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'9999999999999'</span> $ clientes->ruc ,<span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>factura->email,<span style="color: #000000;">31</span>,<span style="color: #000000;">60</span><span style="color: #000000;">)</span> , <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>clientes->email,<span style="color: #000000;">31</span>,<span style="color: #000000;">60</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>, , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><span style="color: #B900B9;">//***********************Inicio Pie de FACTURA TOTALES ********************************</span><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> y, <span style="color: #000000;">22</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">7.8</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+0.8</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'S. Total '</span>+ str<span style="color: #000000;">(</span> GLB_Iva * <span style="color: #000000;">100</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">'% :'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.1</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+0.8</span>, <span style="color: #000000;">29.8</span>, nIva10ConDes, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.0</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+1.8</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'S. Total 0% :'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.1</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+1.8</span>, <span style="color: #000000;">29.8</span>, nIva0SinDes, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.0</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+2.8</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'S.Total sin Iva:'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.1</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+2.8</span>, <span style="color: #000000;">29.8</span>, factura->subtotal-factura->descuent, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.0</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+3.8</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'IVA '</span>+ str<span style="color: #000000;">(</span> GLB_Iva * <span style="color: #000000;">100</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">'% : '</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.1</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+3.8</span>, <span style="color: #000000;">29.8</span>, factura->iva, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.0</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+5.5</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'VALOR USD : '</span>, <span style="color: #ff0000;">'@!'</span>,<span style="color: #000000;">8.0</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+5.5</span>, <span style="color: #000000;">31.7</span>, factura->total, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">9.5</span>, <span style="color: #ff0000;">"Helvetica-Bold"</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><span style="color: #B900B9;">//***************************Inicio Pie DEDUCIBLES ************************************</span><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+6.5</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">0.8</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cuadro datos DEDUCIBLES PEQUEÑO</span><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+6.5</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">6.5</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cuadro datos DEDUCIBLES GRANDE</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y+ <span style="color: #000000;">7.0</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">' DEDUCIBLES '</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y+ <span style="color: #000000;">8.0</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'SORTEO : '</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y+ <span style="color: #000000;">8.0</span>, <span style="color: #000000;">11.0</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y+ <span style="color: #000000;">8.7</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'EDUCACION : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y+ <span style="color: #000000;">8.7</span>, <span style="color: #000000;">11.0</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y+ <span style="color: #000000;">9.4</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'QUIFATEX : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y+ <span style="color: #000000;">9.4</span>, <span style="color: #000000;">11.0</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+10.1</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'SALUD : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+10.1</span>, <span style="color: #000000;">11.0</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+10.8</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'VESTIMENTA : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+10.8</span>, <span style="color: #000000;">11.0</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><span style="color: #B900B9;">//*******************************Inicio AHORRO*****************************************</span><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+6.5</span>, <span style="color: #000000;">22</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">6.5</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cuadro datos cliente</span><br /><br /> <span style="color: #00C800;">if</span> nSubDescuento <> <span style="color: #000000;">0</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+8.5</span>, <span style="color: #000000;">22.0</span>, <span style="color: #ff0000;">' SU AHORRO 4X4 ES DE: '</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> nOtrosCar = factura->OtrosCar<br /> <br /> <span style="color: #00C800;">if</span> empty<span style="color: #000000;">(</span> factura->iva <span style="color: #000000;">)</span><br /> n10 := <span style="color: #000000;">0</span><br /> n0 := factura->subtotal - factura->descuent<br /> <span style="color: #00C800;">else</span><br /> n10 := factura->Iva / GLB_Iva<br /> n0 := factura->subtotal - factura->descuent + nOtrosCar - n10<br /> <span style="color: #00C800;">if</span> n0 >= <span style="color: #000000;">0.1</span><br /> <span style="color: #00C800;">else</span><br /> n0 := <span style="color: #000000;">0</span><br /> end<br /> <span style="color: #00C800;">if</span> empty<span style="color: #000000;">(</span> n0 <span style="color: #000000;">)</span><br /> n10 = factura->subtotal - factura->descuent<br /> end<br /> end<br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+10.3</span>, <span style="color: #000000;">31.0</span>, nSubDescuento, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">9.5</span>,<span style="color: #ff0000;">'Helvetica-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+10.3</span>, <span style="color: #000000;">23.8</span>, <span style="color: #ff0000;">'Usd '</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">9.5</span>,<span style="color: #ff0000;">'Helvetica-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">else</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+9.5</span>, <span style="color: #000000;">21.5</span>, <span style="color: #ff0000;">' GRACIAS POR SU VISITA'</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> end<br /><br /><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><span style="color: #B900B9;">//***************************Inicio FORMAS DE PAGO*************************************</span><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+11.9</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">0.8</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cuadro datos DEDUCIBLES PEQUEÑO</span><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+11.9</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">21</span>, <span style="color: #000000;">6.5</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cuadro datos DEDUCIBLES GRANDE</span><br /><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+12.4</span>, <span style="color: #000000;">1.5</span>,<span style="color: #ff0000;">' FORMAS DE PAGO '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+13.1</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'EF Efectivo: '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+13.1</span>, <span style="color: #000000;">11.0</span>, wg_formasdepago<span style="color: #000000;">(</span> factura->num_fact, <span style="color: #000000;">5</span>, <span style="color: #ff0000;">'EF'</span>, <span style="color: #ff0000;">'AB'</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+13.8</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'CHEQUES : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+13.8</span>, <span style="color: #000000;">11.0</span>, wg_formasdepago<span style="color: #000000;">(</span> factura->num_fact, <span style="color: #000000;">5</span>, <span style="color: #ff0000;">'CF,CD'</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+14.5</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'TARJETAS CR: '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+14.5</span>, <span style="color: #000000;">11.0</span>, wg_formasdepago<span style="color: #000000;">(</span> factura->num_fact, <span style="color: #000000;">5</span>, <span style="color: #ff0000;">'VC,VD,F2,F8,TC,TD'</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+15.2</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'OTROS '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+15.2</span>, <span style="color: #000000;">11.0</span>, wg_formasdepago<span style="color: #000000;">(</span> factura->num_fact, <span style="color: #000000;">5</span>, <span style="color: #ff0000;">'CR,VV'</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+15.9</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'R1 RET FTE : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+15.9</span>, <span style="color: #000000;">11.0</span>, wg_formasdepago<span style="color: #000000;">(</span> factura->num_fact, <span style="color: #000000;">5</span>, <span style="color: #ff0000;">'VV'</span> <span style="color: #000000;">)</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+16.6</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">'R2 RET IVA : '</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+16.6</span>, <span style="color: #000000;">11.0</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">7.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><span style="color: #B900B9;">//********************************Inicio PAGO*****************************************</span><br /><span style="color: #B900B9;">//*************************************************************************************</span><br /><br /> oPDF:<span style="color: #000000;">DrawRetangle</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+11.9</span>, <span style="color: #000000;">22</span>, <span style="color: #000000;">18</span>, <span style="color: #000000;">6.5</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//cuadro datos cliente</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+12.6</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'ENTREGA :'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+12.6</span>, <span style="color: #000000;">33.0</span>, factura->cobrado, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">8.0</span>, <span style="color: #ff0000;">"Helvetica-Bold"</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+13.6</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'CAMBIO :'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+13.6</span>, <span style="color: #000000;">33.0</span>, factura->vuelto, <span style="color: #ff0000;">'99,999,999.99'</span>, <span style="color: #000000;">8.0</span>, <span style="color: #ff0000;">"Helvetica-Bold"</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+14.6</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'CAJA :'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+14.6</span>, <span style="color: #000000;">33.0</span>, cajas->num_caja, <span style="color: #ff0000;">'999,999,999'</span>, <span style="color: #000000;">8.0</span>, <span style="color: #ff0000;">"Helvetica-Bold"</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+15.6</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'USUARIO :'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+15.6</span>, <span style="color: #000000;">30.0</span>, <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>Ejecutiv->E_nombre,<span style="color: #000000;">1</span>,<span style="color: #000000;">11</span><span style="color: #000000;">)</span>, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">8.0</span>, <span style="color: #ff0000;">"Helvetica-Bold"</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+16.6</span>, <span style="color: #000000;">22.6</span>, <span style="color: #ff0000;">'IMPRESO :'</span>, <span style="color: #ff0000;">'@'</span>, <span style="color: #000000;">6.5</span>,<span style="color: #ff0000;">'Courier-Bold'</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> oPDF:<span style="color: #000000;">DrawText</span><span style="color: #000000;">(</span> y<span style="color: #000000;">+16.6</span>, <span style="color: #000000;">33.0</span>, Factura->Hora, <span style="color: #ff0000;">'@!'</span>, <span style="color: #000000;">8.0</span>, <span style="color: #ff0000;">"Helvetica-Bold"</span>,<span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #B900B9;">//oPDF:DrawText( y+26.6, 39.4, " ", '@!', 8.0, "Helvetica-Bold",0 )</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span></div>[/code:20j3a8dp]
esta basado en la clase de Jose Quintas PDFClass()
en fin la idea es que COMO CONFIGURO LA IMPRESORA CEMATECH LR2000 ya que me sale escalado el papel ya probe todo lo que sale en internet y siempre me hace mas pequeña
[img:20j3a8dp]https://ibb.co/K24JWjd[/img:20j3a8dp]
gracias si me pueden ayudar
el preview se ve bien sale mal en la impresora |
harupdf tamaño del papel | <!-- m --><a class="postlink" href="https://ibb.co/K24JWjd">https://ibb.co/K24JWjd</a><!-- m --> |
harupdf tamaño del papel | Con esto es suficiente para definir el tamaño de la hoja sin importar la impresora:
HPDF_Page_SetWidth(page,819)
HPDF_Page_SetHeight(page,143) |
harupdf tamaño del papel | Manual:
[url:z37i24oe]http://libharu.sourceforge.net/page_handling.html[/url:z37i24oe]
Regards, saludos. |
harupdf tamaño del papel | buenos días
muchas gracias por su ayuda
efectivamente ya pude poner el tamaño del papel, al abrir el pdf se ve perfecto, PERO al momento de imprimir por razones que desconozco se ESCALA la impresión y se ve mal, lo tuve que abandonar por imposible , tuve que usar las funciones de impresión de windows con la clase win32prn():new() y obtuve algo mas o menos parecido por el momento así lo resolví
muchas gracias por todo
saludos |
hash | I must converte a xjson test into hash but i make error
[code=fw:1fshgp2c]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00D7D7;">#include</span><span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> HData<br /><span style="color: #00C800;">Local</span> ctext:= <span style="color: #ff0000;">' {"ok":true,"result":[{"update_id":54113084,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":40,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537475869,"text":"/join","entities":[{"offset":0,"length":5,"type":"bot_command"}]}},{"update_id":54113085, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":41,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537475936,"text":"test"}},{"update_id":54113086,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":42,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-237720378,"title":"testprovabotsilvio","type":"group","all_members_are_administrators":true},"date":1537476295,"left_chat_participant":{"id":651666627,"is_bot":true,"first_name":"sostituzionedocenti_bot","username":"sostituzionedocenti_bot"},"left_chat_member":{"id":651666627,"is_bot":true,"first_name":"sostituzionedocenti_bot","username":"sostituzionedocenti_bot"}}},{"update_id":54113087, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":43,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-237720378,"title":"testprovabotsilvio","type":"group","all_members_are_administrators":true},"date":1537476409,"new_chat_participant":{"id":651666627,"is_bot":true,"first_name":"sostituzionedocenti_bot","username":"sostituzionedocenti_bot"},"new_chat_member":{"id":651666627,"is_bot":true,"first_name":"sostituzionedocenti_bot","username":"sostituzionedocenti_bot"},"new_chat_members":[{"id":651666627,"is_bot":true,"first_name":"sostituzionedocenti_bot","username":"sostituzionedocenti_bot"}]}},{"update_id":54113088, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":44,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537476423,"text":"ciao"}},{"update_id":54113089,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":45,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537476435,"text":"cc"}},{"update_id":54113090, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":46,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it-IT"},"chat":{"id":-237720378,"title":"testprovabotsilvio","type":"group","all_members_are_administrators":true},"date":1537477153,"text":"/get_my_id@sostituzionedocenti_bot","entities":[{"offset":0,"length":34,"type":"bot_command"}]}},{"update_id":54113091, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":47,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it-IT"},"chat":{"id":-237720378,"title":"testprovabotsilvio","type":"group","all_members_are_administrators":true},"date":1537477156,"text":"/get_my_id@sostituzionedocenti_bot","entities":[{"offset":0,"length":34,"type":"bot_command"}]}},{"update_id":54113092, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":48,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-237720378,"title":"testprovabotsilvio","type":"group","all_members_are_administrators":true},"date":1537477896,"migrate_to_chat_id":-1001153142939}},{"update_id":54113093,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":1,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537477896,"migrate_from_chat_id":-237720378}},{"update_id":54113094,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":49,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537477991,"text":"/help","entities":[{"offset":0,"length":5,"type":"bot_command"}]}},{"update_id":54113095,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":50,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537478002,"text":"non funziona i comandi"}},{"update_id":54113096, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":51,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537478025,"text":"fammi vede che posso fare?"}},{"update_id":54113097, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":52,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537478028,"text":"!!!"}},{"update_id":54113098, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":53,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537478044,"text":"per inserire i comandi da botfather"}},{"update_id":54113101, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":54,"from":{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"},"chat":{"id":112607325,"first_name":"Varstahl","username":"Varstahl","type":"private"},"date":1537478429,"text":"/start","entities":[{"offset":0,"length":6,"type":"bot_command"}]}},{"update_id":54113102,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":55,"from":{"id":111707870,"is_bot":false,"first_name":"Diego [SkiD] IU6CRH","last_name":"Cioschi","username":"theSkiD","language_code":"it"},"chat":{"id":111707870,"first_name":"Diego [SkiD] IU6CRH","last_name":"Cioschi","username":"theSkiD","type":"private"},"date":1537481885,"text":"/stop","entities":[{"offset":0,"length":5,"type":"bot_command"}]}},{"update_id":54113103, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":2,"from":{"id":111707870,"is_bot":false,"first_name":"Diego [SkiD] IU6CRH","last_name":"Cioschi","username":"theSkiD","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537483045,"text":"/start","entities":[{"offset":0,"length":6,"type":"bot_command"}]}},{"update_id":54113104,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":3,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537483221,"text":"/start","entities":[{"offset":0,"length":6,"type":"bot_command"}]}},{"update_id":54113110,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":4,"from":{"id":111707870,"is_bot":false,"first_name":"Diego [SkiD] IU6CRH","last_name":"Cioschi","username":"theSkiD","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537483317,"new_chat_participant":{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"},"new_chat_member":{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"},"new_chat_members":[{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"}]}},{"update_id":54113112,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":6,"from":{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537483333,"text":"/get_my_id@sostituzionedocenti_bot","entities":[{"offset":0,"length":34,"type":"bot_command"}]}},{"update_id":54113113, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":7,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537483341,"text":"/get_my_id@sostituzionedocenti_bot","entities":[{"offset":0,"length":34,"type":"bot_command"}]}},{"update_id":54113114, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":8,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537483342,"text":"/get_my_id@sostituzionedocenti_bot","entities":[{"offset":0,"length":34,"type":"bot_command"}]}},{"update_id":54113115, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":9,"from":{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537483343,"text":"/start@sostituzionedocenti_bot","entities":[{"offset":0,"length":30,"type":"bot_command"}]}},{"update_id":54113116, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":10,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537483348,"text":"/start@sostituzionedocenti_bot","entities":[{"offset":0,"length":30,"type":"bot_command"}]}},{"update_id":54113117, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":56,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537483362,"text":"test"}},{"update_id":54113118,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":11,"from":{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537486945,"text":"/start@sostituzionedocenti_bot","entities":[{"offset":0,"length":30,"type":"bot_command"}]}},{"update_id":54113119, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":21,"from":{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537487781,"left_chat_participant":{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"},"left_chat_member":{"id":112607325,"is_bot":false,"first_name":"Varstahl","username":"Varstahl","language_code":"en-US"}}},{"update_id":54113120,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":25,"from":{"id":111707870,"is_bot":false,"first_name":"Diego [SkiD] IU6CRH","last_name":"Cioschi","username":"theSkiD","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537487816,"left_chat_participant":{"id":111707870,"is_bot":false,"first_name":"Diego [SkiD] IU6CRH","last_name":"Cioschi","username":"theSkiD","language_code":"it"},"left_chat_member":{"id":111707870,"is_bot":false,"first_name":"Diego [SkiD] IU6CRH","last_name":"Cioschi","username":"theSkiD","language_code":"it"}}},{"update_id":54113121,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":27,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537530900,"text":"/help@sostituzionedocenti_bot","entities":[{"offset":0,"length":29,"type":"bot_command"}]}},{"update_id":54113122,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":28,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537530903,"text":"/help@sostituzionedocenti_bot","entities":[{"offset":0,"length":29,"type":"bot_command"}]}},{"update_id":54113123, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":29,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":-1001153142939,"title":"testprovabotsilvio","type":"supergroup"},"date":1537530961,"text":"/help@sostituzionedocenti_bot","entities":[{"offset":0,"length":29,"type":"bot_command"}]}},{"update_id":54113124, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":59,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537545183,"text":"i comandi non funzionano perch<span style="color: #000000;">\u</span>00e8 lo so io ti spiego io creo una lista comandi"}},{"update_id":54113125, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":60,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537552433,"text":"test"}},{"update_id":54113126, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":61,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537559510,"text":"test"}},{"update_id":54113127, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":62,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537560259,"text":"CIAO DA TOPOLINO"}},{"update_id":54113128,'</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":63,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537561361,"text":"/START","entities":[{"offset":0,"length":6,"type":"bot_command"}]}},{"update_id":54113129, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":64,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537561370,"text":"/accetta","entities":[{"offset":0,"length":8,"type":"bot_command"}]}},{"update_id":54113130, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":65,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537561372,"text":"/accetta","entities":[{"offset":0,"length":8,"type":"bot_command"}]}},{"update_id":54113131, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":66,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537561378,"text":"/lista","entities":[{"offset":0,"length":6,"type":"bot_command"}]}},{"update_id":54113132, '</span>+;<br /><span style="color: #ff0000;">'"message":{"message_id":67,"from":{"id":612815965,"is_bot":false,"first_name":"Topolino","username":"ittopolino","language_code":"it"},"chat":{"id":612815965,"first_name":"Topolino","username":"ittopolino","type":"private"},"date":1537562107,"text":"/start","entities":[{"offset":0,"length":6,"type":"bot_command"}]}}]} '</span><br /><br /><br /><br />HData:= strtoHasharray<span style="color: #000000;">(</span>ctext<span style="color: #000000;">)</span><br /><br />xbrowser hdata<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> StrToHashArray<span style="color: #000000;">(</span> cStr <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> hHash, aHash<br /><br /> cStr := CharRepl<span style="color: #000000;">(</span> <span style="color: #ff0000;">"[]"</span>, RangeRem<span style="color: #000000;">(</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">31</span>, cStr <span style="color: #000000;">)</span>, <span style="color: #ff0000;">"{}"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> <span style="color: #ff0000;">'" :'</span> $ cStr<br /> StrTran<span style="color: #000000;">(</span> cStr, <span style="color: #ff0000;">'" :'</span>, <span style="color: #ff0000;">'":'</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">enddo</span><br /> cStr := <span style="color: #000000;">(</span>StrTran<span style="color: #000000;">(</span> cStr, <span style="color: #ff0000;">'":'</span>, <span style="color: #ff0000;">'"=>'</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> cStr := <span style="color: #000000;">(</span>StrTran<span style="color: #000000;">(</span> cStr, <span style="color: #ff0000;">'""'</span>, <span style="color: #ff0000;">'"'</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> cStr := <span style="color: #000000;">(</span>StrTran<span style="color: #000000;">(</span> cStr, <span style="color: #ff0000;">',"is_bot"=>false,'</span>, <span style="color: #ff0000;">','</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> cStr := <span style="color: #000000;">(</span>StrTran<span style="color: #000000;">(</span> cStr, <span style="color: #ff0000;">'false'</span>, <span style="color: #ff0000;">'.f.'</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> hHash := &cStr<br /> aHash := HGetValueAt<span style="color: #000000;">(</span> hHash, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> aHash</div>[/code:1fshgp2c]
where is the error ?
give me this error
[code=fw:1fshgp2c]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br /> Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">C</span>:\Work\Errori\hash\test.Exe <span style="color: #000000;">(</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">3</span>,<span style="color: #000000;">606</span>,<span style="color: #000000;">016</span> bytes<br /> Compiler version: <span style="color: #000000;">Harbour</span> <span style="color: #000000;">3.2</span>.0dev <span style="color: #000000;">(</span>r1703231115<span style="color: #000000;">)</span><br /> FiveWin version: <span style="color: #000000;">FWH</span> <span style="color: #000000;">17.12</span><br /> C compiler version: <span style="color: #000000;">Borland</span>/Embarcadero C++ <span style="color: #000000;">7.0</span> <span style="color: #000000;">(</span><span style="color: #000000;">32</span>-bit<span style="color: #000000;">)</span><br /> Windows version: <span style="color: #000000;">6.2</span>, Build <span style="color: #000000;">9200</span> <br /><br /> Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">0</span> secs <br /> Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">09</span>/<span style="color: #000000;">21</span>/<span style="color: #000000;">18</span>, <span style="color: #000000;">23</span>:<span style="color: #000000;">30</span>:<span style="color: #000000;">52</span><br /> Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1003</span> Variable does not exist: <span style="color: #00C800;">TRUE</span><br /><br />Stack Calls<br />===========<br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">test</span>.prg => STRTOHASHARRAY<span style="color: #000000;">(</span> <span style="color: #000000;">67</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">test</span>.prg => TEST<span style="color: #000000;">(</span> <span style="color: #000000;">50</span> <span style="color: #000000;">)</span></div>[/code:1fshgp2c] |
hash | Did you try
hb_jsonDecode( <jsonString>, @var, [<codePage>] ) -> length of decoded <jsonString>, var will contain the resulting Harbour value |
hash | Add
[code=fw:2kwjhyln]<div class="fw" id="{CB}" style="font-family: monospace;">cStr := <span style="color: #000000;">(</span>StrTran<span style="color: #000000;">(</span> cStr, <span style="color: #ff0000;">'true'</span>, <span style="color: #ff0000;">'.t.'</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span></div>[/code:2kwjhyln]
EMG |
hash | Enrico yes I saw but I have another error on hash
I try to save some data info from hash and sometimes make error because there may not be that informations I wish
and make error
[code=fw:1230i33g]<div class="fw" id="{CB}" style="font-family: monospace;"> Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">22</span><span style="color: #000000;">-09</span><span style="color: #000000;">-2018</span>, <span style="color: #000000;">11</span>:<span style="color: #000000;">05</span>:<span style="color: #000000;">43</span><br /> Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1132</span> Bound error: <span style="color: #000000;">array</span> access<br /> Args:<br /> <span style="color: #000000;">[</span> <span style="color: #000000;">1</span><span style="color: #000000;">]</span> = H <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /> <span style="color: #000000;">[</span> <span style="color: #000000;">2</span><span style="color: #000000;">]</span> = C last_name</div>[/code:1230i33g]
please see this picture
[img:1230i33g]https://i.postimg.cc/FHg8qSkw/hash.jpg[/img:1230i33g]
when I save the hash data I made
for each x in Hdata
....
first_name:=x["message"]["from"]["first_name"]
last_name :=x["message"]["from"]["last_name"]
username :=x["message"]["from"]["username"]
but I have only first_name and user_name
but last_name now there is not but it but it could be there
How I can to you the expression
IIF(! empty( ) , x["message"]["from"]["last_name"],)
what I insert on empty function ?
How I can control if there is a variable on hash data ? |
hash | FOUND
IF HHasKey( HaDATA, "lAST_NAME" ) |
hash for storing variables | Hello friends,
static h := {=>}
h['mycParts'] := {"date=1900-11-21", "time=16:00"}
// Correct loop syntax for iterating over the array in the hash
FOR EACH cTmp IN h['mycParts']
? cTmp
NEXT
But when I try to use
h["cTmp"] := ""
FOR EACH h["cTmp"]IN h['mycParts']
? h["cTmp"]
NEXT
I get a syntax error.
Is there a workaround?
Best regards,
Otto |
hash for storing variables | It does not make sense to me. What do you want to get? |
hash for storing variables | Enrico, I use a patcher and preprocessor for my programming.
<!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=3&t=42693&p=260562&hilit=hash&sid=fef71b12cde0ab87a1d9048f22a2ff63#p260562">viewtopic.php?f=3&t=42693&p=260562&hilit=hash&sid=fef71b12cde0ab87a1d9048f22a2ff63#p260562</a><!-- l -->
Best regards,
Otto
[quote:ir87pma1]
ADVANTAGES OF THE PATCHER AND PREPROCESSOR SYSTEM
The Patcher and Preprocessor system allows for the integration of components with simple instructions like
$-> DATEPICKER: id = dateInput.
This offers several benefits:
Clarity and Compactness:
The code remains clear and easy to read. Reusability: The same component can be reused in different parts of a project, simplifying maintenance. Centralized Updates: Changes to the DATEPICKER component need only be made in one place.
Separation of Structure and Logic:
The structure (HTML), style (CSS), and logic (JavaScript) of components can be edited independently. Consistency: Ensures consistent use of the date input component throughout the project.
Similarities with Object-Oriented Programming
The approach shares similarities with object-oriented programming (OOP), especially regarding modularity and encapsulation. However, it lacks classical OOP elements like inheritance and polymorphism. The use of multiple levels of patchers and preprocessors for composing components resembles the OOP principle of composition. This enhances reusability and maintainability and allows for a well-structured development of complex applications. However, it is not true OOP as the focus is more on reusing code snippets rather than creating and managing objects in the OOP sense.
Conclusion
In summary, this approach offers an efficient, modular, and component-based approach to web development. It shares many advantages of object-oriented programming, although it does not encompass all aspects of OOP. Centralizing style definitions and avoiding redundancies are important to minimize conflicts and maintenance issues.[/quote:ir87pma1] |
hash for storing variables | What is the point of using h["cTmp"] as the FOR EACH variable? |
hash for storing variables | Hello Enrico,
for e.g. my code looks like this.
All the moduls are this way independent.
Best regads,
Otto
[img:3jqj1w23]https://mybergland.com/fwforum/hab1.jpg[/img:3jqj1w23]
[img:3jqj1w23]https://mybergland.com/fwforum/tischplanner.jpg[/img:3jqj1w23] |
hash for storing variables | I do not understand, sorry. Anyway, it still does not make sense. |
hash for storing variables | Enrico, the advantage is that you have reusable blocks here and don't have to worry about passing the variables.
It's simply the productivity that is the advantage.
It's a method to make the source code more readable and secure.
Best regards,
Otto |
hash for storing variables | Hello friends,
Here is an example of a test program.
All these blocks are reusable in all my programs.
Best regards,
Otto
[img:1dpdfa57]https://mybergland.com/fwforum/tbldruck.jpg[/img:1dpdfa57]
[img:1dpdfa57]https://mybergland.com/fwforum/tbldrucktc.jpg[/img:1dpdfa57]
[img:1dpdfa57]https://mybergland.com/fwforum/abfrage.gif[/img:1dpdfa57] |
hash with (x)harbour - knowledge base | To all,
I would like to start a knowledge base about the use of hash with (x)harbour.
If someone has additional information please post it here. Thanks in advance.
----------------------------------------------
From a post of Mr. Rao:
In general Hash is a number derived from a large data value ( mostly character strings ) uniquely identifying it. Something like a checksum. Hash table is a table that stores such values and it gets easier to index and search on such tables.
But the Hashes we are talking about in (x)Harbour are different.
Hashes are like Arrays but with more flexibility. They are also called Associative Arrays.
For arrays, the index is always an integer from 1,...n.
For Hashes, the index can be a Character, Numeric, Date.
For example, hHash[ "One" ] := <somevalue>
We instantiate Arrays as aArray := {} or aArray := Array(n)
We instantiate Hashes as hHash := {=>} or Hash() ( xharbour )
We can add elements like
hDays[ "Jan" ] := 31
hDays[ "Feb" ] := 28, etc.
Later, hDays[ "Feb" ] --> 28
In xhabour both the above syntax works and also we can write hDays:Jan := 31 and hDays:Feb := 28
Here "Jan" and "Feb" are called Keys and 31 and 28 are called Values
There are many Hash functions to operate on Hashes.
ValType( hDays ) is 'H'
You can learn more from xharbour.chm help file.
Regards
Rao
----------------------------------------------
HSetCaseMatch( ::hStates, .f. ) // make it case insensitive
USE ("States " ) NEW SHARED READONLY
DbEval( { || ::hStates[States -> Code] := States ->name } )
// Alternative Syntax:
// DbEval( { || HSet( hStates, States ->Code, States->Name ) } )
CLOSE code
TRY
stateName := ::hStates[ (States)->Code ]
CATCH
END
How to use with xBrowse:
WITH OBJECT ::oBrw:AddCol()
:cHeader := " State Name "
:bEditValue := { || ::hStates[ (::cAlias)->Code ] }
END
----------------------------------------------
Hash is like Array. Only difference is for Arrays the index is an integer and for Hashes the index can be number, date or character value. If the index is out of range for arrays, it results in a runtime error. Same way if the index value of a Hash is not found, it results in a runtime error.
What we do for arrays if we are not sure if the index in within range?
We can write :
TRY
result := aData[ n ]
CATCH
result := 0
END
OR
result := If( n > 0 .and. n <= Len( aData ), aData[ n ], 0 )
Same way for Hashes also:
We can either write a TRY,CATCH,END block
OR
result := If( HHasKey( hData, cKey ), hData[ cKey ], <default> )
---------------------------------------------- |
hash with (x)harbour - knowledge base | Hash tables - What are they good for?
[url:2qtamktk]http://www.knowlexbase.com/en/software/downloads/yukon/HashTable.html[/url:2qtamktk] |
hash with (x)harbour - knowledge base | Hello Otto
I use Hash for manage the database
Function Scatter()
Local aVars := {=>}
LOcal nField := FCount()
LOcal nX := 1
FOR nX := 1 TO nField
aVars[FIELDNAME(nX)] := FieldGet(nX)
NEXT
Return aVars
Function Gather(aVars)
lOCAL Nx := 1
FOR Nx := 1 TO LEN(aVars)
FieldPut(nX,aVArs[FIELDNAME(nX)] )
NEXT
Return .T.
Regards MAurizio |
hash with (x)harbour - knowledge base | MAurizio,
I don't see where you are using a hash?
Did you know that the equivalent of scatter and gather is built into database objects. And instead of refering to aVars[1], you can refer to oCust:name. This makes the code much easier to write and read. There are lots of other good reasons to use database objects. See my articles on FW OOP programming.
[url:f3guhfuy]http://www.gointellitech.com/program.htm[/url:f3guhfuy]
James |
hash with (x)harbour - knowledge base | James ,
With hash you cann use the name of the fields to [code=fw:3vo2wiu1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />oCust := Scatter<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br />?<span style="color: #000000;">(</span> oCust:<span style="color: #0000ff;">name</span><span style="color: #000000;">)</span> <br /><br /><br /><span style="color: #00C800;">Function</span> Scatter<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Local</span> aVars := <span style="color: #000000;">{</span>=><span style="color: #000000;">}</span><br /><span style="color: #00C800;">LOcal</span> nField := FCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOcal</span> nX := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">FOR</span> nX := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nField<br />aVars<span style="color: #000000;">[</span>FIELDNAME<span style="color: #000000;">(</span>nX<span style="color: #000000;">)</span><span style="color: #000000;">]</span> := FieldGet<span style="color: #000000;">(</span>nX<span style="color: #000000;">)</span><br /><span style="color: #00C800;">NEXT</span><br /> </div>[/code:3vo2wiu1]
Regards Maurizio |
hash with (x)harbour - knowledge base | Maurizio,
I don't understand this syntax. Please explain.
Local aVars := {=>}
What is {=>} ?
Does that preprosses into something else?
James |
hash with (x)harbour - knowledge base | [quote="James Bott":11gznbff]Maurizio,
I don't understand this syntax. Please explain.
Local aVars := {=>}
What is {=>} ?
Does that preprosses into something else?
James[/quote:11gznbff]
No, it is the regular syntax required to initialize an empty hash (ie. similar to aVars := {} for arrays).
EMG |
hash with (x)harbour - knowledge base | [quote="James Bott":1w492h8a]Does the (x)Harbour hash function automatically handle collisions?[/quote:1w492h8a]
No, as far as I know. It is the programmer responsibility to assure the uniqueness of the key.
[quote="James Bott":1w492h8a]I don't think I would want to risk using a hash table without knowing the answer to how collisions are handled.[/quote:1w492h8a]
If the key is a fieldname there is no problem as the fieldname is already unique.
EMG |
hash with (x)harbour - knowledge base | Enrico,
[quote:3hlw4e8n]No, it is the regular syntax required to initialize an empty hash (ie. similar to aVars := {} for arrays).[/quote:3hlw4e8n]
So aVars := {=>} is an array of hashes?
And can you also explain this syntax?
aVars[FIELDNAME(nX)] := FieldGet(nX)
I am guessing that it is creating a hash for the fieldname and storing the fieldvalue related to that hash?
As you can tell, I know nothing about hashes.
Regards,
James |
hash with (x)harbour - knowledge base | [quote="James Bott":1zxcrrxh]So aVars := {=>} is an array of hashes?[/quote:1zxcrrxh]
No, it is a single hash, that is essentially an array indexed by strings instead of numeric values.
[quote="James Bott":1zxcrrxh]And can you also explain this syntax?
aVars[FIELDNAME(nX)] := FieldGet(nX)
I am guessing that it is creating a hash for the fieldname and storing the fieldvalue related to that hash?[/quote:1zxcrrxh]
No, it is creating an item in the hash indexed by the fieldname and storing the fieldvalue. Later you can access that value using the fieldname instead of the numeric index.
EMG |
hash with (x)harbour - knowledge base | Ok, I have done some research and reading on hash tables and I found this in Wikipedia:
[i:220vmzxx]Ideally, the hash function should map each possible key to a unique slot index, but this ideal is rarely achievable in practice (unless the hash keys are fixed; i.e. new entries are never added to the table after creation). Most hash table designs assume that hash collisions—the situation where different keys happen to have the same hash value—are normal occurrences and must be accommodated in some way.[/i:220vmzxx]
Does the (x)Harbour hash function automatically handle collisions? Has anyone tested it? I don't think I would want to risk using a hash table without knowing the answer to how collisions are handled.
Also, I found that syntax used by Marizio (aVars) confusing. This normally represents an array and yet here it is holding a hash table which I have also seen refered to as an object in the literature. Using a "o" prefix would also be confusing since it not the same as objects created from classes that we are used to using. And the "h" prefix is already used to signify a handle. Is there a standard Hungarian syntax for a hash table?
Regards,
James |
hash with (x)harbour - knowledge base | Enrico,
[quote:2zvubahv]If the key is a fieldname there is no problem as the fieldname is already unique.[/quote:2zvubahv]
The Wikipedia article states otherwise. They show two different names mapping to the same hash "bucket." See under the "Collision Resolution" section the example that "James Smith" and "Sandra Dee" both map to the same hash number.
[url:2zvubahv]http://en.wikipedia.org/wiki/Hash_table#Perfect_hash_function[/url:2zvubahv]
So I do think we run the risk of two fieldnames colliding (unless the (x)Harbour hash function automatically handles collisions). I am not sure how we can test this.
Regards,
James |
hash with (x)harbour - knowledge base | I don't know the internals of the [x]Harbour's hash implementation but I know for sure that two different keys have no collision (or the collision is internal managed).
EMG |
hash with (x)harbour - knowledge base | Both Harbour and xHarbour, same as Clipper did, use internal hashes to match the function to call when a message is sent to an object.
Basically they calculate a unique number from a string. The original algorithm that we used was developed by the Standford University (as far as I remember it). Just as a curiosity <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
hash with (x)harbour - knowledge base | Well, it all sounds good, but I am hesitant to use hashes for any critical application since a collision could be disasterous. For an accounting app it could cost millions, for a medical app it could be fatal. Perhaps I will try to devise a test for a large number of items to see about collisions. Is there a size limit?
James |
hash with (x)harbour - knowledge base | A Good example from using hashes is when tabels or dbf's must be totalisized.
See code
[code=fw:1vi81hix]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//# define NOHASH</span><br /><span style="color: #00C800;">FUNCTION</span> MAIN<br /><span style="color: #00C800;">LOCAL</span> aTabel := <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">"CL1"</span>,<span style="color: #000000;">10</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"CL1"</span>,<span style="color: #000000;">20</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"CL1"</span>,<span style="color: #000000;">30</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"CL1"</span>,<span style="color: #000000;">40</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"CL2"</span>,<span style="color: #000000;">10</span><span style="color: #000000;">}</span>,<span style="color: #000000;">{</span><span style="color: #ff0000;">"CL2"</span>,<span style="color: #000000;">20</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">LOCAL</span> el , i , ClNr<br /># ifdef NOHASH<br /><span style="color: #00C800;">LOCAL</span> aSum<span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span><br /><span style="color: #00C800;">FOR</span> EACH el IN aTabel<br /> ClNr := el<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /> i := ASCAN<span style="color: #000000;">(</span>aSum , <span style="color: #000000;">{</span>|x|x<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>==ClNr<span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> i == <span style="color: #000000;">0</span><br /> AADD<span style="color: #000000;">(</span>aSum,<span style="color: #000000;">{</span>ClNr,<span style="color: #000000;">0</span><span style="color: #000000;">}</span><span style="color: #000000;">)</span><br /> i := LEN<span style="color: #000000;">(</span>aSum<span style="color: #000000;">)</span><br /> END<br /> aSum<span style="color: #000000;">[</span>i,<span style="color: #000000;">2</span><span style="color: #000000;">]</span> += el<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /><span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">FOR</span> EACH el IN aSum<br /> ? el<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> , el<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /><span style="color: #00C800;">NEXT</span><br /># <span style="color: #00C800;">else</span><br /><span style="color: #00C800;">LOCAL</span> hSum := Hash<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">FOR</span> EACH el IN aTabel<br /> ClNr := el<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br /> <span style="color: #00C800;">IF</span> ! <span style="color: #000000;">(</span>ClNr IN hSum<span style="color: #000000;">)</span><br /> hSum<span style="color: #000000;">[</span>ClNr<span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br /> END<br /> hSum<span style="color: #000000;">[</span>ClNr<span style="color: #000000;">]</span> += el<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><br /><span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">FOR</span> EACH el In hGetKeys<span style="color: #000000;">(</span>hSum<span style="color: #000000;">)</span><br /> ? el , hSum<span style="color: #000000;">[</span>el<span style="color: #000000;">]</span><br /><span style="color: #00C800;">NEXT</span><br /># <span style="color: #00C800;">endif</span><br />WAIT<br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:1vi81hix] |
hash with (x)harbour - knowledge base | Hi all;
I use hashes a lot. Never had a problem.
The sample Maurizzio shows is a good one. In essence, with his scatter you can refer to an array entry using syntax like : ?aVar[ LASTNAME ] to show what's in the buffer for oCust:LASTNAME. Clearly using the aforementioned syntax is much better than ?aVar[ 32 ] or even ?aVar[ _LASTNAME ] where _LASTNAME is #defined as 32. And if you keep a hash as one of the properties (DATA) of your tdata class, you could refer to the buffer field as: oCust:aVar[ LASTNAME ] or even oCust:aVarLastName...
Here is a simpler use of hashes I use a lot to show descriptive information on a combobox:
[code=fw:qoc4mz2u]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">local</span> hRels := <span style="color: #000000;">{</span> <span style="color: #ff0000;">" "</span> =><span style="color: #ff0000;">" "</span>, <span style="color: #ff0000;">"Self"</span>=><span style="color: #ff0000;">"S "</span>, <span style="color: #ff0000;">"Spouse"</span>=><span style="color: #ff0000;">"01"</span>, <span style="color: #ff0000;">"Child"</span>=><span style="color: #ff0000;">"19"</span>, <span style="color: #ff0000;">"Other"</span>=><span style="color: #ff0000;">"G8"</span>, ;<br /> <span style="color: #ff0000;">"Organ Donor"</span> => <span style="color: #ff0000;">"39"</span>, <span style="color: #ff0000;">"Cadaver Donor"</span> => <span style="color: #ff0000;">"40"</span>, <span style="color: #ff0000;">"Life Partner"</span> => <span style="color: #ff0000;">"53"</span> <span style="color: #000000;">}</span> <br /><br />...<br /><br /><br /> ret := aScan<span style="color: #000000;">(</span> hGetKeys<span style="color: #000000;">(</span> hRels <span style="color: #000000;">)</span>, <span style="color: #000000;">{</span> |e| hRels<span style="color: #000000;">[</span> e <span style="color: #000000;">]</span> == odbf:<span style="color: #000000;">aVar</span><span style="color: #000000;">[</span>Relation<span style="color: #000000;">]</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> crel1 := hGetKeyAt<span style="color: #000000;">(</span> hRels, <span style="color: #0000ff;">max</span><span style="color: #000000;">(</span> ret, <span style="color: #000000;">1</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> agets<span style="color: #000000;">[</span> <span style="color: #000000;">21</span> <span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> crel1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">130</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">Items</span> hGetKeys<span style="color: #000000;">(</span> hRels <span style="color: #000000;">)</span> ;<br /> <span style="color: #0000ff;">Valid</span><span style="color: #000000;">(</span> odbf:<span style="color: #000000;">aVar</span><span style="color: #000000;">[</span>Relation<span style="color: #000000;">]</span> := hRels<span style="color: #000000;">[</span> crel1 <span style="color: #000000;">]</span>, .t. <span style="color: #000000;">)</span><br /><br /> </div>[/code:qoc4mz2u]
Here the dropdown list shows "Self", "Spouse", "Child", "Other"... but what's save to file is the code "01", "19", "G8"... In this case saving codes instead of description is important in order to comply with EDI rules.
I Hope that makes sense.
Reinaldo. |
hash with (x)harbour - knowledge base | How to create a 2-dimensional associative array? For example let's consider something similar to a spreadsheet where the columns are A to E, the rows are 1 to 6 [equivalent to array(5,6) matrix]
The few questions that I have are:
i. How to initialize it? [I mean its array(5,6) equivalent]
ii. Would this be the correct way to create [i:xwbbcwgb]and[/i:xwbbcwgb] initialize the hash table and its values?[code=fw:xwbbcwgb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oTable := hash<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"A"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"B"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"C"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"D"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"E"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"A"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"2"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br /> .<br /> .<br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"A"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"B"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"C"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"D"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"E"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span></div>[/code:xwbbcwgb]
iii. Does an associative array has something similar to asort()?
That's all for now. TIA |
hash with (x)harbour - knowledge base | [quote="hua":1lnkcoov]How to create a 2-dimensional associative array? For example let's consider something similar to a spreadsheet where the columns are A to E, the rows are 1 to 6 [equivalent to array(5,6) matrix]
The few questions that I have are:
i. How to initialize it? [I mean its array(5,6) equivalent]
ii. Would this be the correct way to create [i:1lnkcoov]and[/i:1lnkcoov] initialize the hash table and its values?
[code=fw:1lnkcoov]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oTable := hash<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"A"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"B"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"C"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"D"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"E"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"1"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"A"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"2"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br /> .<br /> .<br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"A"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"B"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"C"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"D"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span><br />oTable<span style="color: #000000;">[</span><span style="color: #ff0000;">"E"</span><span style="color: #000000;">]</span><span style="color: #000000;">[</span><span style="color: #ff0000;">"6"</span><span style="color: #000000;">]</span> := <span style="color: #000000;">0</span></div>[/code:1lnkcoov]
iii. Does an associative array has something similar to asort()?
That's all for now. TIA[/quote:1lnkcoov]
It Could be done as :
oTabel := Hash()
HsetAAcompability(oTable , .T.)
FOR i := 1 TO 6
//oTabel["A"] := Hash()
oTabel[CHR(64+i)] := Hash()
HsetAAcompability(oTabel[CHR(64+i)],.T.)
FOR j := 1 TO 6
c := LTRIM(STR(j))
oTabel[CHR(64+i),c] := 0
NEXT
NEXT
Elements can be retrieved as oTabel["A","1"] or as oTabel[1,1] or both mixed
A better aproach would be :
oTabel := Hash()
FOR i := 1 TO 6
oTabel[CHR(64+i)] := Array(6)
aFill(oTabel[CHR(64+i)],0)
//FOR j := 1 TO 6
// oTabel[CHR(64+i),j] := 0
//NEXT
NEXT
Elements can only be retrieved as oTabel["A",1]
Note that a hash() has only the properties from a associative array when is used
HsetAAcompability(<hHash>,<lToggle>) . In that case the creation order is respected and the elements can be retrieved with their numeric ordinal position (i.e. oTabel[1,"1"])
A hash is ordered on the key (in this example it makes no difference) , it can only be retrieved with the key (i.e. oTabel["A",1])
Frank |
hash with (x)harbour - knowledge base | Thank you for clearing up the picture a bit more Frank <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> |
hash with (x)harbour - knowledge base | Does xHarbour support hash functions?
Both Harbour and xHarbour support all these functions but with slightly different names.
hbcompat.ch provides cross translations.
[code=fw:7872flmi]<div class="fw" id="{CB}" style="font-family: monospace;"> #ifdef __XHARBOUR__<br /> <span style="color: #B900B9;">/* Hash item functions */</span><br /> #xtranslate hb_Hash<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => Hash<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HHasKey<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HHasKey<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HPos<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HGetPos<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HGet<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HGet<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HSet<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HSet<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HDel<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HDel<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HKeyAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HGetKeyAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HValueAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HGetValueAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HValueAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HSetValueAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HPairAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HGetPairAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HDelAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HDelAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HKeys<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HGetKeys<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HValues<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HGetValues<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HFill<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HFill<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HClone<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HClone<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HCopy<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HCopy<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HMerge<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HMerge<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HEval<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HEval<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HScan<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HScan<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HSetCaseMatch<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HSetCaseMatch<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HCaseMatch<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HGetCaseMatch<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HSetAutoAdd<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HSetAutoAdd<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HAutoAdd<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HGetAutoAdd<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HAllocate<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HAllocate<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate hb_HDefault<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => HDefault<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #else<br /> <span style="color: #B900B9;">/* Hash item functions */</span><br /> #xtranslate Hash<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_Hash<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HHasKey<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HHasKey<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGetPos<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HPos<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGet<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HGet<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HSet<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HSet<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HDel<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HDel<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGetKeyAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HKeyAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGetValueAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HValueAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HSetValueAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HValueAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGetPairAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HPairAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HDelAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HDelAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGetKeys<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HKeys<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGetValues<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HValues<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HFill<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HFill<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HClone<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HClone<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HCopy<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HCopy<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HMerge<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HMerge<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HEval<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HEval<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HScan<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HScan<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HSetCaseMatch<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HSetCaseMatch<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGetCaseMatch<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HCaseMatch<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HSetAutoAdd<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HSetAutoAdd<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGetAutoAdd<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HAutoAdd<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HAllocate<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HAllocate<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HDefault<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HDefault<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HSetPartition<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> =><br /><br /> <span style="color: #B900B9;">/* Associative hash array functions */</span><br /> #xtranslate haAGetKeyAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HKeyAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate haAGetValueAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HValueAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate haADelAt<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HDelAt<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate haAGetPos<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => hb_HPos<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate haAGetRealPos<span style="color: #000000;">(</span> <x>, <y> <span style="color: #000000;">)</span> => iif<span style="color: #000000;">(</span> HB_ISNUMERIC<span style="color: #000000;">(</span> <y> <span style="color: #000000;">)</span> .AND. <y> >= <span style="color: #000000;">1</span> .AND. ;<br /> Int<span style="color: #000000;">(</span> <y> <span style="color: #000000;">)</span> <= Len<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span>, Int<span style="color: #000000;">(</span> <y> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> #xtranslate HGetVaaPos<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span> => <span style="color: #000000;">{</span>| h | ;;<br /> <span style="color: #00C800;">LOCAL</span> a := Array<span style="color: #000000;">(</span> Len<span style="color: #000000;">(</span> h <span style="color: #000000;">)</span>, v ;;<br /> <span style="color: #00C800;">FOR</span> EACH v IN a ;;<br /> v := v:__enumIndex<span style="color: #000000;">(</span><span style="color: #000000;">)</span> ;;<br /> <span style="color: #00C800;">NEXT</span> ;;<br /> <span style="color: #00C800;">RETURN</span> a ; <span style="color: #000000;">}</span>:<span style="color: #000000;">eval</span><span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HGetAACompatibility<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span> => hb_HKeepOrder<span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /> #xtranslate HSetAACompatibility<span style="color: #000000;">(</span> <span style="color: #000000;">[</span><x,...><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> => <span style="color: #000000;">{</span>| h | ;;<br /> hb_HKeepOrder<span style="color: #000000;">(</span> h <span style="color: #000000;">)</span> ;;<br /> <span style="color: #00C800;">RETURN</span> .T. ; <span style="color: #000000;">}</span>:<span style="color: #000000;">eval</span><span style="color: #000000;">(</span> <x> <span style="color: #000000;">)</span><br /><br /> #endif</div>[/code:7872flmi] |
hasp4 bajo harbour | Hola:
¿Es posible usar las mochilas Hasp4 de Aladdin bajo Harbour?. ¿Cómo?. Muchas gracias.
Salu2,
Eduardo |
hasp4 under harbour | Hi,
I would like to know if it´s possible to use hasp4 dongles under harbour?. Thank you.
Regards,
Eduardo |
hasp4 under harbour | We developed a full API for xHarbour for the Sentinel SuperPro dongles.
This api wraps all the functions availalbe for the Surper Pro into a single easy to use function library.
You can ask your Sentinel provider to give you the full Api (.C, .PRG is available) |
hay forma de arreglar upper(""descripción"" ) == &qu | Estimados,
[code:fyw8ac21]local cTexto:= "descripción" // fijarse que es la o acentuada
if upper( cTexto ) = "DESCRIPCIÓN" // o acentuada pero en mayusculas
? "paso sin problemas"
else
? "no paso"
endif[/code:fyw8ac21]
Este fragmento de codigo jamas es verdadero ya que al hacer upper de una palabra con vocal acentuada da error o sea al convertir "ó" sigue siendo "ó" y no "Ó"
Hay manera de solucionarlo a nivel codigo y no app?
Gracias |
hay forma de arreglar upper(""descripción"" ) == &qu | [quote="goosfancito":7c9im3i4]Estimados,
[code:7c9im3i4]local cTexto:= "descripción" // fijarse que es la o acentuada
if upper( cTexto ) = "DESCRIPCIÓN" // o acentuada pero en mayusculas
? "paso sin problemas"
else
? "no paso"
endif[/code:7c9im3i4]
Este fragmento de codigo jamas es verdadero ya que al hacer upper de una palabra con vocal acentuada da error o sea al convertir "ó" sigue siendo "ó" y no "Ó"
Hay manera de solucionarlo a nivel codigo y no app?
Gracias[/quote:7c9im3i4]
Hola amigo, tendrias que crear una pequeña rutina, con todas las palabras que llevan acento en mayusculas, declarando la variable local, etc etc etc seria algo asi :
LOCAL EXCEPCION:={'Ó'}
cNomb1 := "descripción"
MSGINFO(UPPER(cNomb1))
FOR I = 1 TO LEN(cNomb1)
IF SUBSTR(RFCf,I,1) = "ó"
cCaracter := "Ó"
ENDIF
NEXT
bla bla bla, no esta completo la rutina, pero ahi te doy mas o menos la idea amigo, espero que te sirva la idea
IF UPPER(cNomb1) = ALLTRIM("DESCRIPCIÓN")
MsgInfo("Ok")
ELSE
MsgInfo("No paso 1")
ENDIF
Saludos
Adriano C. C. |
hay forma de arreglar upper(""descripción"" ) == &qu | AnsiUpper( ) funciona bien con caracteres acentuados (pero com xHarbour.com me da un error de GPF)
Salu2 de Brasil
Maurilio |
hay forma de arreglar upper(""descripción"" ) == &qu | Goos, yo utilizo este comando de preprocesador de mi cocehca y me va bien:
#TRANSLATE TRANSNOM( <cVar> ) => UPPER( STRTRAN( STRTRAN( STRTRAN( ;
STRTRAN( STRTRAN( STRTRAN( STRTRAN( ;
STRTRAN( STRTRAN( STRTRAN( STRTRAN( ;
ALLTRIM( <cVar> ),"Ú","U"), ;
"Ó","O"), ;
"Í","I"), ;
"É","E"), ;
"Á","A"), ;
"ú","U"), ;
"ó","O"), ;
"í","I"), ;
"é","E"), ;
"á","A"), ;
"-"," ") )
(copia y pega, no te compliques la vida)
[u:2ahskwag]Por ejemplo:[/u:2ahskwag]ç
IF [b:2ahskwag]TRANSNOM[/b:2ahskwag]( cNom1 ) == "DESCIRPCION" ....
Espero que te sirva |
hbIde | Buenas noches/Good night,
una nueva versión/ a new version
[url:ayjvj0sw]http://sourceforge.net/projects/qtcontribs/postdownload?source=dlp[/url:ayjvj0sw]
Saludos/Regards |
hb_CDPSELECT() crash ? | hi
i found another Mystery in DualGrid
in CONFIG.INI i use
[quote:k8whf4pe][COUNTRY]
LangCode=DE
Codepage=DEWIN
[/quote:k8whf4pe]
which are used for
[code=fw:k8whf4pe]<div class="fw" id="{CB}" style="font-family: monospace;"> hb_LangSelect<span style="color: #000000;">(</span> cLangCode <span style="color: #000000;">)</span><br /> hb_CDPSELECT<span style="color: #000000;">(</span> cCodepage <span style="color: #000000;">)</span></div>[/code:k8whf4pe]
i can change
[quote:k8whf4pe]LangCode=EN[/quote:k8whf4pe]
to check FWstring() Setting
but when set
[quote:k8whf4pe]Codepage=EN[/quote:k8whf4pe]
it crash at Start with hb_out.log <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
[quote:k8whf4pe]Called from GDIP_IMAGEFROMFILE(0)
Called from FW_READIMAGE(1459) in .\source\function\IMGTXTIO.PRG
Called from (b)TWINDOW(602) in .\source\classes\WINDOW.PRG
Called from TDIALOG:READIMAGE(0) in .\source\classes\WINDOW.PRG
Called from TGRID:CLEARANDFILLDIR(1133) in .\TGRID.PRG
Called from TEXPLORER:FILLGRID(5183) in .\DUALGRID.PRG
Called from NOWBUILDGRID(1836) in .\DUALGRID.PRG
Called from (b)DOSPLASH(1777) in .\DUALGRID.PRG
Called from TWINDOW:ACTIVATE(1100) in .\source\classes\WINDOW.PRG
Called from DOSPLASH(1777) in .\DUALGRID.PRG
Called from (b)MAIN(903) in .\DUALGRID.PRG
Called from TWINDOW:ACTIVATE(1100) in .\source\classes\WINDOW.PRG
Called from MAIN(903) in .\DUALGRID.PRG[/quote:k8whf4pe]
i don´t understand what hb_CDPSELECT() have to do with it as nothing of that CODE use Codepage, or <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
hb_CDPSELECT() crash ? | the first parameter of this function is a string.
string conversions depend on codepage.
invalid codepage may create problems at any point. |
hb_CDPSELECT() crash ? | Dear Jimmy,
What code do you have here ?
Called from TGRID:CLEARANDFILLDIR(1133) in .\TGRID.PRG |
hb_CDPSELECT() crash ? | [code=fw:3ckzd1z6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br />REQUEST HB_CODEPAGE_HU852<br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> cTxt := Chr<span style="color: #000000;">(</span> <span style="color: #000000;">71</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" > "</span> + Chr<span style="color: #000000;">(</span> <span style="color: #000000;">144</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">" is"</span><br /><br /> ? hb_cdpSelect<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// EN</span><br /><br /> ? cTxt, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">71</span> <span style="color: #000000;">)</span> > Chr<span style="color: #000000;">(</span> <span style="color: #000000;">144</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// G > É is .F.</span><br /><br /> ? hb_cdpSelect<span style="color: #000000;">(</span> <span style="color: #ff0000;">"HU852"</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// EN</span><br /><br /> ? cTxt, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">71</span> <span style="color: #000000;">)</span> > Chr<span style="color: #000000;">(</span> <span style="color: #000000;">144</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// G > É is .T.</span><br /><br /> ? hb_cdpSelect<span style="color: #000000;">(</span> <span style="color: #ff0000;">"EN"</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// HU852</span><br /><br /> ? cTxt, Chr<span style="color: #000000;">(</span> <span style="color: #000000;">71</span> <span style="color: #000000;">)</span> > Chr<span style="color: #000000;">(</span> <span style="color: #000000;">144</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// G > É is .F.</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*<br />REQUEST HB_CODEPAGE_DE<br />REQUEST HB_CODEPAGE_DEWIN<br /><br />FUNCTION Main()<br /><br /> LOCAL cTxt := "A" + Chr( 142 ) + "BC"<br /><br /> ? "German CP-850 text:", cTxt<br /><br /> ? "German Windows-1252 text:", hb_Translate( cTxt, "DE", "DEWIN" )<br /><br />RETURN NIL<br />*/</span><br /><br /><span style="color: #B900B9;">/*<br />REQUEST HB_LANG_PT<br />REQUEST HB_LANG_RO<br />REQUEST HB_LANG_ES<br /><br />FUNCTION Main()<br /><br /> HB_LANGSELECT( "pt" ) // Default language is now Portuguese<br /><br /> ? CDOW( Date() ) // Segunda-feira<br /><br /> ? "Old language id selected is ", HB_LANGSELECT() // PT<br /><br /> HB_LANGSELECT( "ro" ) // Default language is now Romanian<br /><br /> ? CMONTH( Date() ) // Mai<br /><br /> ? "Old language id selected is ", HB_LANGSELECT() // RO<br /><br /> HB_LANGSELECT( "es" ) // Default language is now Spanish<br /><br /> ? CMONTH( Date() ) // Mayo<br /><br /> ? CDOW( Date() ) // Lunes<br /><br />RETURN NIL<br />*/</span><br /><br /><span style="color: #B900B9;">/*<br />REQUEST HB_LANG_EN<br />REQUEST HB_CODEPAGE_EN<br /><br />REQUEST HB_LANG_PT<br />REQUEST HB_CODEPAGE_PT850<br /><br />FUNCTION Main()<br /><br /> Local xAux<br /> Local aLang := { 'EN', 'PT850' }<br /><br /> xAux := hb_langSelect( hb_UserLang(), aLang[ 1 ] )<br /> xAux := hb_cdpSelect( aLang[ 1 ] )<br /><br /> ALERT( CHR( 157 ) + ';;' + aLang[ 1 ], , 'GR+/N' )<br /><br /> xAux := hb_langSelect( hb_UserLang(), aLang[ 2 ] ) // .OR. HB_LANGSELECT( 'pt-BR', "PT850" )<br /> xAux := hb_cdpSelect( aLang[ 2 ] )<br /><br /> ALERT( CHR( 157 ) + ';;' + aLang[ 2 ], , 'GR+/N' )<br /><br />RETURN NIL<br />*/</span><br /> </div>[/code:3ckzd1z6]
Regards, saludos. |
hb_CDPSELECT() crash ? | hi Antonio,
it happens in my DUALGRID App where i try to use FWstring()
the Error "seems" when use DIRECTORY() and try to find Icon of File
as i say it crash with hb_out.LOG so i don´t know "where" it crash
---
i have use Codepage only for DBF which i can change "on-fly"
when use FWstring() i can change Language-ID but why not Codepage-ID <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Jimmy
p.s. i have send Source of DUALGRID to Mr.Rao to show DELETED "Problem"
it should also show hb_cdpSelect() "Problem" |
hb_CDPSELECT() crash ? | [quote:1clos18w]p.s. i have send Source of DUALGRID to Mr.Rao to show DELETED "Problem"
it should also show hb_cdpSelect() "Problem"
[/quote:1clos18w]
I did not receive.
Please send to
nageswaragunupudi[at]gmail[dot]com |
hb_CDPSELECT() crash ? | [quote:32en8vo7]p.s. i have send Source of DUALGRID to Mr.Rao to show DELETED "Problem"
it should also show hb_cdpSelect() "Problem"
[/quote:32en8vo7]
I did not receive.
Please send to
nageswaragunupudi[at]gmail[dot]com |
hb_CDPSELECT() crash ? | Can you copy and paste here the name of the file you got the problem? |
hb_CDPSELECT() crash ? | hi,
[quote="nageswaragunupudi":fepv9rye]Can you copy and paste here the name of the file you got the problem?[/quote:fepv9rye]
did you receive DG_RAO.ZIP <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
Files are "read" with DIRECTORY() so i can´t specify which Files make Problem.
btw. i always try NOT to use German "Umlaute" which may make Problem |
hb_GetEnv( ""PRGPATH"" ) | Hola.
Si eso pongo en mi primera linea del MAIN deberia de devolverme que?
porque en mi caso no devuelve nada. |
hb_GetEnv( ""PRGPATH"" ) | Gustavo,
Esa llamada es sólo para mod_harbour (web), te pido disculpas por no haberlo quitado
Para una aplicación desktop con FWH solo tienes que proporcionar el path y nombre del fichero completo a subir al FTP |
hb_GetEnv( ""PRGPATH"" ) | Gracias |
hb_HrbRun() | Hi,
This question is for Harbour expert . But usually I'm directing to Fwh forum , because Harbour mailing list forum is terrible ... <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> . So, I'll thankfull for your help ... I'm using succesfully this harbour scripts technique with hb_HrbRun() . After some tracks I noticed , that scripts are consumming PC memory and after job the scripts are in memoty . I'm thinking so , because after job memory size of applications isn't restoring to old size ...
Here is the code for prg as scripts :
[code=fw:3s09zzww]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> Run_prg<span style="color: #000000;">(</span> cPrg <span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> oRun<br /><span style="color: #00C800;">local</span> lRet := .t.<br /><span style="color: #00C800;">local</span> lCompile := .f.<br /><span style="color: #00C800;">local</span> dPrdDate, dHrbDate<br /><span style="color: #00C800;">local</span> cPrgTime, cHrbTime<br /><span style="color: #00C800;">local</span> cTxtFile, cLine, nFrom := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">local</span> cLog := cProgr_logai + <span style="color: #ff0000;">"<span style="color: #000000;">\h</span>cmp"</span> + alltrim<span style="color: #000000;">(</span> cVart_id <span style="color: #000000;">)</span> + <span style="color: #ff0000;">".log"</span><br /><br /><span style="color: #00C800;">if</span> !jungtis_serveris<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span><span style="color: #000000;">(</span> .f. <span style="color: #000000;">)</span><br /><span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">if</span> file<span style="color: #000000;">(</span> cProgr_kelias + cPrg + <span style="color: #ff0000;">".prg"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">TRY</span><br /> <span style="color: #00C800;">if</span> File<span style="color: #000000;">(</span> cLog <span style="color: #000000;">)</span><br /> ferase<span style="color: #000000;">(</span> cLog <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> FReOpen_Stderr<span style="color: #000000;">(</span> cLog, <span style="color: #ff0000;">"w"</span> <span style="color: #000000;">)</span><br /> oRun := HB_compilebuf<span style="color: #000000;">(</span> HB_ARGV<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, cProgr_kelias + cPrg + <span style="color: #ff0000;">".prg"</span>, <span style="color: #ff0000;">"-n"</span>, <span style="color: #ff0000;">"-i"</span> + cPagr_kelias + <span style="color: #ff0000;">"fwh_incl;"</span> + cPagr_kelias + <span style="color: #ff0000;">"hrb_incl"</span> <span style="color: #000000;">)</span><br /> cTxtFile := MemoRead<span style="color: #000000;">(</span> cLog <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> empty<span style="color: #000000;">(</span> cTxtFile <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">(</span> oRun <span style="color: #000000;">)</span><br /> BEGIN SEQUENCE<br /> bOldError = ErrorBlock<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> | o | DoBreak<span style="color: #000000;">(</span> o <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> hb_HrbRun<span style="color: #000000;">(</span> oRun <span style="color: #000000;">)</span><br /> END SEQUENCE<br /> ErrorBlock<span style="color: #000000;">(</span> bOldError <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> MsgInf<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Can't to generate file ... :-( "</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">else</span><br /> WinExec<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Notepad "</span> + cLog <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> CATCH e<br /> lRet := .f.<br /> END<br /> <span style="color: #00C800;">else</span><br /> MsgInf<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Can't to find file - "</span> + cProgr_kelias + cPrg + <span style="color: #ff0000;">".prg ..."</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">)</span><br /> lRet := .f.<br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">if</span> !empty<span style="color: #000000;">(</span> oRun <span style="color: #000000;">)</span><br /> oRun := <span style="color: #00C800;">NIL</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span><span style="color: #000000;">(</span> lRet <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DoBreak<span style="color: #000000;">(</span> oError <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cInfo := oError:<span style="color: #000000;">operation</span>, n<br /> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> oError:<span style="color: #000000;">Args</span> <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"A"</span><br /> cInfo += <span style="color: #ff0000;">" Args:"</span> + CRLF<br /> <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">(</span> oError:<span style="color: #000000;">Args</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> oError:<span style="color: #000000;">Args</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span><br /> cInfo += <span style="color: #ff0000;">"["</span> + Str<span style="color: #000000;">(</span> n, <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"] = "</span> + ValType<span style="color: #000000;">(</span> oError:<span style="color: #000000;">Args</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #ff0000;">" "</span> + cValToChar<span style="color: #000000;">(</span> oError:<span style="color: #000000;">Args</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> + CRLF<br /> <span style="color: #00C800;">next</span><br /> <span style="color: #00C800;">endif</span><br /> MsgStop<span style="color: #000000;">(</span> oError:<span style="color: #000000;">Description</span> + CRLF + cInfo,;<br /> <span style="color: #ff0000;">"Script error at line: "</span> + Str<span style="color: #000000;">(</span> ProcLine<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">BREAK</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:3s09zzww]
Maybe it missing something here ? Or growing memory consumption with scripts is normal ? I'm doing like that :
if !empty( oRun )
oRun := NIL
endif
But this isn't releasing memory of script ? Memory leak problem ?
Thanks in advance ! With best regards ! |
hb_HrbRun() | Rimantas,
Try this (before oRun := nil):
HB_HRBUNLOAD( oRun )
oRun = nil |
hb_UnZipFile con Harbour | Amigos:
Un ejemplo de hb_UnZipFile con Harbour?, por favor!
[code=fw:1gbuwyab]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">IF</span> ! hb_UnZipFile<span style="color: #000000;">(</span> cPathFile,,<span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span>,,cDirGlb,aFilInZip<span style="color: #000000;">)</span><br /> MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">"Falló la descompresión, posiblemente el archivo ZIP está dañado !"</span>,cAppName<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> </div>[/code:1gbuwyab]
No me tira error pero el array cDirClb y aFilInZip me los devuelve vacios
Uso Harbour
Saludos |
hb_UnZipFile con Harbour | Hola Armando,
No sé si has mirado esto: <!-- l --><a class="postlink-local" href="https://forums.fivetechsupport.com/viewtopic.php?f=6&t=43427&hilit=unzipfile">viewtopic.php?f=6&t=43427&hilit=unzipfile</a><!-- l -->
El mismo código me funciona también con harbour. |
hb_UnZipFile con Harbour | Mi estimado
[code=fw:3jvfa016]<div class="fw" id="{CB}" style="font-family: monospace;"><br />*cFile archivo zip <br />*cPass password si lo tiene el zip<br />cFTem := GetEnv<span style="color: #000000;">(</span><span style="color: #ff0000;">"TMP"</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\"</span> ***ruta donde se desziperan los archivos<br />aFile := HB_GETFILESINZIP( cFile ) ***array con los archivos zipeados<br />If !HB_UNZIPFILE( cFile, , .t., cPass, cFTem, aFile)<br />Return(.f.)<br />EndIf<br />Return(.t.)</span></div>[/code:3jvfa016] |
hb_UnZipFile con Harbour | Amigos:
Manuel ya había visto tu post, de ahi tome el ejemplo
Willi, gracias por tu código
Gracias a ambos por sus respuestas las he mirado pero tal vez tengo ceguera de taller
pues no logro el objetivo, pongo mi código que no me funciona por si encuentran mi error.
[code=fw:xcjsf4z9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #B900B9;">// Determinamos cuantos y cuales archivos hay en el ZIP</span><br /> aFilInZip := hb_GetFilesInZip<span style="color: #000000;">(</span>cPathFile,<span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> ? aFilInZip <== Aquí me muestra un valor de <span style="color: #000000;">1801</span><br /> <span style="color: #B900B9;">// Descomprimimos el archivo ZIP</span><br /> <span style="color: #00C800;">IF</span> ! hb_UnZipFile<span style="color: #000000;">(</span> cPathFile,,<span style="color: #000000;">(</span>.F.<span style="color: #000000;">)</span>,,cDirGlb,aFilInZip,<span style="color: #000000;">)</span> <== cPathFile es correcto y cDirGlb existe<br /> MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">"Falló la descompresión, posiblemente el archivo ZIP está dañado !"</span>,cAppName<span style="color: #000000;">)</span> <== Este mensaje no aparece<br /> <span style="color: #B900B9;">// Borramos el directorio</span><br /> lRmDir<span style="color: #000000;">(</span>cDirGlb<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> aFilInDir := Directory<span style="color: #000000;">(</span>cDirGlb + <span style="color: #ff0000;">"*.Xml"</span> <span style="color: #000000;">)</span><br /> ? Len<span style="color: #000000;">(</span>aFilInDir<span style="color: #000000;">)</span> <== Aquí me muestra <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">ENDIF</span><br /> </div>[/code:xcjsf4z9]
Muchas gracias por su tiempo |
hb_UnZipFile con Harbour | Estimado Armando,
Prueba con:
Directory(cDirGlb + "\*.Xml" ) |
hb_UnZipFile con Harbour | Master Antonio:
Gracias por tu respuesta
? cDirGlb <==== C:\AppXmls\092023\
Como ves, ya incluye la última diagonal inversa.
Saludos |
hb_UnZipFile con Harbour | Armando, muestre:
[code=fw:3b9mvzs5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> cDirGlb<br /> </div>[/code:3b9mvzs5]
ó la FUNCTION completa, porfa.
[url:3b9mvzs5]https://forums.fivetechsupport.com/viewtopic.php?f=3&t=33637&start=0[/url:3b9mvzs5]
PBACKUP para HARBOUR:
[url:3b9mvzs5]https://mega.nz/file/II9GTBLZ#h4aAe8VgDqbICFsLRu8lXI5xLH-YbTq3Z3ekImYvOFg[/url:3b9mvzs5]
Armando: Compila perfecto con HARBOUR para BCC7.60.
Regards, saludos. |
hb_UnZipFile con Harbour | Amigos:
Encontré el problema, el código es correcto, el problema radica en que los ficheros
a extraer están en una carpeta y la carpeta dentro del ZIP y el código espera que los
ficheros formen el ZIP, espero haberme explicado.
FICHERO.ZIP
|
|-----> 092023 <===== esta es la carpeta (NO SIEMPRE ES EL MISMO NOMBRE)
|
|------> Fichero1.xml
|------> Fichero2.xml
|------> etc. etc.
Ahora como especifico que busque los ficheros dentro de la carpeta???
Gracias por su tiempo y paciencia
Saludos |
hb_UnZipFile con Harbour | Armando, mira se ayuda:
[code=fw:312xgoct]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// C:\FWH..\SAMPLES\UNZIP2.PRG simples teste. <!-- e --><a href="mailto:kapiabafwh@gmail.com">kapiabafwh@gmail.com</a><!-- e --></span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"Directry.ch"</span><br /><br /><span style="color: #00D7D7;">#Define</span> CLR_PINK nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">128</span>, <span style="color: #000000;">128</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//-> Rosa. uiiii. kkkkkk</span><br /><span style="color: #00D7D7;">#Define</span> CLR_NBLUE nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">128</span>, <span style="color: #000000;">128</span>, <span style="color: #000000;">192</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#Define</span> CLR_MSPURPLE nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">120</span>, <span style="color: #000000;">215</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">//-> Purpura.</span><br /><span style="color: #00D7D7;">#Define</span> CLR_MSRED nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">232</span>, <span style="color: #000000;">17</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#Define</span> CLR_MSGRAY nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">229</span>, <span style="color: #000000;">229</span>, <span style="color: #000000;">229</span> <span style="color: #000000;">)</span><br /><span style="color: #00D7D7;">#Define</span> CLR_LGRAY nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">230</span>, <span style="color: #000000;">230</span>, <span style="color: #000000;">230</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> MEMVAR cPRGPATH, cFILEPATH<br /><br /> cPRGPATH := cFILEPATH<span style="color: #000000;">(</span>GETMODULEFILENAME<span style="color: #000000;">(</span>GETINSTANCE<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> cPRGPATH := cShortName<span style="color: #000000;">(</span>cPRGPATH<span style="color: #000000;">)</span> <span style="color: #B900B9;">//-> Modified / Modificado al final</span><br /><br /> XBACKUP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> lCHDIR<span style="color: #000000;">(</span>cPRGPATH<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> XBACKUP<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oFont, cDest, cArqZip, aDir1, vPasta, X, nTotal<br /> <span style="color: #00C800;">LOCAL</span> cTipo := <span style="color: #ff0000;">"1"</span><br /> <span style="color: #B900B9;">// LOCAL cDestino := LEFT("C:\"+CurDir()+SPACE(100),100)</span><br /> <span style="color: #00C800;">LOCAL</span> cDestino<br /> <span style="color: #B900B9;">// archivos de Origen:</span><br /> <span style="color: #B900B9;">// LOCAL cOrigem := LEFT("C:\"+CurDir()+"\*.PRG"+SPACE(100),100)</span><br /> <span style="color: #00C800;">LOCAL</span> cOrigem<br /> <span style="color: #00C800;">LOCAL</span> cSenha := SPACE<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oBtn, oBtn2, oSaida, aGrad, oBrush1, oBrush2, aArq := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">LOCAL</span> c_ExtArq:=<span style="color: #ff0000;">"zip"</span> <span style="color: #B900B9;">//extensao do arquivo que sera criado</span><br /> <span style="color: #00C800;">LOCAL</span> oCursorBtn := TCursor<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span>, <span style="color: #ff0000;">'HAND'</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #B900B9;">// De onde pegar os arquivos:</span><br /> cOrigem := Curdrive<span style="color: #000000;">(</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">":<span style="color: #000000;">\f</span>wh1905<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\*</span>.PRG"</span><br /> cDestino := Curdrive<span style="color: #000000;">(</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">":<span style="color: #000000;">\b</span>ackup<span style="color: #000000;">\"</span> // "</span>C:\BACKUP<span style="color: #ff0000;">"<br /><br /> // ? cDestino // "</span>C:\BACKUP<span style="color: #ff0000;">" // donde guardar la copia<br /><br /> IF .NOT. lIsdir( cDestino )<br /> LMkdir( cDestino )<br /> ENDIF<br /><br /> SetBalloon( .T. )<br /><br /> aGrad := { { 0.30, CLR_MSGRAY, CLR_MSPURPLE },{ 0.50, CLR_MSPURPLE, CLR_MSGRAY }, .F. }<br /><br /> DEFINE BRUSH oBrush1 COLOR nRGB( 250, 213, 174 ) STYLE HORIZONTAL<br /> DEFINE BRUSH oBrush2 COLOR nRGB( 192, 192, 192 ) STYLE HORIZONTAL<br /><br /> DEFINE FONT oFont NAME "</span>Ms Sans Serif<span style="color: #ff0000;">" SIZE 00, -35 BOLD<br /> <br /> DEFINE DIALOG oDlg TITLE "</span>FIVEWIN:- BACKUP - RESTORE -<span style="color: #ff0000;">" SIZE 350, 350 ;<br /> PIXEL TRUEPIXEL RESIZABLE GRADIENT aGrad<br /><br /> @ 050, 75 BTNBMP oBtn OF oDlg SIZE 200, 70 NOBORDER ADJUST TRANSPARENT ;<br /> FILE "</span>..\<span style="color: #0000ff;">bitmaps</span>\butt1upD.bmp<span style="color: #ff0000;">", "</span>..\<span style="color: #0000ff;">bitmaps</span>\butt1do.bmp<span style="color: #ff0000;">",nil, ;<br /> "</span>..\<span style="color: #0000ff;">bitmaps</span>\butt1upL.bmp<span style="color: #ff0000;">" ;<br /> FONT oFont COLOR CLR_PINK, CLR_BLACK PROMPT "</span>&BACKUP<span style="color: #ff0000;">" CENTER ;<br /> ACTION ( cTipo := "</span>BACKUP<span style="color: #ff0000;">", oDlg:End() ) ;<br /> TOOLTIP "</span>Backup<span style="color: #ff0000;">"<br /><br /> oBtn:bClrGrad = {| lInvert | If( ! lInvert, ;<br /> { { 0.25, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) }, ;<br /> { 0.75, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) } }, ;<br /> { { 0.25, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) }, ;<br /> { 0.75, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) } } ) }<br /><br /> oBtn:nClrBorder := iif( oBtn:lMOver, RGB( 219, 230, 244 ), RGB( 219, 230, 244 ) )<br /> oBtn:oCursor := oCursorBtn<br /><br /> @ 150, 75 BTNBMP oBtn2 OF oDlg SIZE 200, 70 NOBORDER ADJUST TRANSPARENT ;<br /> FILE "</span>..\<span style="color: #0000ff;">bitmaps</span>\butt1upD.bmp<span style="color: #ff0000;">", "</span>..\<span style="color: #0000ff;">bitmaps</span>\butt1do.bmp<span style="color: #ff0000;">",nil, ;<br /> "</span>..\<span style="color: #0000ff;">bitmaps</span>\butt1upL.bmp<span style="color: #ff0000;">" ;<br /> FONT oFont COLOR CLR_PINK, CLR_BLACK PROMPT "</span>&RESTORE<span style="color: #ff0000;">" CENTER ;<br /> ACTION ( cTipo := "</span>RESTORE<span style="color: #ff0000;">", oDlg:End() ) ;<br /> TOOLTIP "</span>Restore<span style="color: #ff0000;">"<br /><br /> oBtn2:bClrGrad = {| lInvert | If( ! lInvert, ;<br /> { { 0.25, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) }, ;<br /> { 0.75, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) } }, ;<br /> { { 0.25, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) }, ;<br /> { 0.75, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) } } ) }<br /><br /> oBtn2:nClrBorder := iif( oBtn2:lMOver, RGB( 219, 230, 244 ), RGB( 219, 230, 244 ) )<br /> oBtn2:oCursor := oCursorBtn<br /><br /> @ 250, 75 BTNBMP oSaida OF oDlg SIZE 200, 70 NOBORDER ADJUST TRANSPARENT ;<br /> FILE "</span>..\<span style="color: #0000ff;">bitmaps</span>\butt1upD.bmp<span style="color: #ff0000;">", "</span>..\<span style="color: #0000ff;">bitmaps</span>\butt1do.bmp<span style="color: #ff0000;">",nil, ;<br /> "</span>..\<span style="color: #0000ff;">bitmaps</span>\butt1upL.bmp<span style="color: #ff0000;">" ;<br /> FONT oFont COLOR CLR_PINK, CLR_BLACK PROMPT "</span>&EXIT<span style="color: #ff0000;">" CENTER ;<br /> ACTION ( cTipo := "</span>SAIDA<span style="color: #ff0000;">", oDlg:End() ) ;<br /> TOOLTIP "</span>Exit/Salida<span style="color: #ff0000;">"<br /><br /> oSaida:bClrGrad = {| lInvert | If( ! lInvert, ;<br /> { { 0.25, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) }, ;<br /> { 0.75, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) } }, ;<br /> { { 0.25, RGB( 250, 250, 245 ), RGB( 245, 245, 235 ) }, ;<br /> { 0.75, RGB( 245, 245, 235 ), RGB( 250, 250, 245 ) } } ) }<br /><br /> oSaida:nClrBorder := iif( oSaida:lMOver, RGB( 219, 230, 244 ), RGB( 219, 230, 244 ) )<br /> oSaida:oCursor := oCursorBtn<br /><br /> oSaida:lCancel := .T.<br /><br /> ACTIVATE DIALOG oDlg CENTERED<br /><br /> IF cTipo != "</span>SAIDA<span style="color: #ff0000;">"<br /><br /> ? "</span>Tipo: <span style="color: #ff0000;">", cTipo, cDestino, cOrigem<br /><br /> ENDIF<br /><br /> IF cTipo = "</span>RESTORE<span style="color: #ff0000;">"<br /><br /> cOrigem := Curdrive()+"</span>:\backup\BACKUP.ZIP<span style="color: #ff0000;">"<br /><br /> ENDIF<br /><br /> IF .NOT. FILE( AllTrim( cOrigem ) )<br /><br /> Alert( "</span>Arquivo: <span style="color: #ff0000;">" + AllTrim( cOrigem ) + "</span>; Nao encontrado<span style="color: #000000;">(</span>bakcup.zip<span style="color: #000000;">)</span>!<span style="color: #ff0000;">" )<br /><br /> RETURN NIL<br /><br /> ENDIF<br /><br /> IF Right( AllTrim( cDestino ), 1 ) != "</span>\<span style="color: #ff0000;">"<br /><br /> cDest := AllTrim( cDestino ) + "</span>\NUL<span style="color: #ff0000;">"<br /><br /> cArqZip := AllTrim( cDestino ) + "</span>\backup.<span style="color: #ff0000;">" + c_ExtArq<br /><br /> ELSE<br /><br /> cDest := AllTrim( cDestino ) + "</span>NUL<span style="color: #ff0000;">"<br /><br /> cArqZip := AllTrim( cDestino ) + "</span>backup.<span style="color: #ff0000;">" + c_ExtArq<br /><br /> ENDIF<br /><br /> IF .NOT. FILE( cDest )<br /><br /> Alert( "</span>O Drive: <span style="color: #ff0000;">" + AllTrim( cDestino ) + "</span>; Nao encontrado!<span style="color: #ff0000;">" )<br /><br /> RETURN NIL<br /><br /> ENDIF<br /><br /> IF cTipo = "</span>BACKUP<span style="color: #ff0000;">" // BACKUP<br /><br /> aArq := {}<br /><br /> IF "</span>*<span style="color: #ff0000;">" $ cOrigem<br /><br /> aDir1 := Directory( AllTrim( cOrigem ) )<br /><br /> vPasta := LEFT( cOrigem, RAt( "</span>\<span style="color: #ff0000;">", cOrigem ) )<br /><br /> FOR x = 1 TO Len( aDir1 )<br /><br /> AAdd( aArq, vPasta + aDir1[ x, 1 ] )<br /><br /> NEXT<br /><br /> ELSE<br /><br /> AAdd( aArq, AllTrim( cOrigem ) )<br /><br /> ENDIF<br /><br /> nTotal := Len( aArq )<br /><br /> hb_zipfile( cArqZip, aArq, 9, {| cFile, nPos | eProgresso( cFile, nPos, nTotal ) }, .T., , , .F., .F., )<br /><br /> ? "</span>Backup Listo<span style="color: #ff0000;">"<br /><br /> ELSE // RESTORE<br /><br /> cDest := AllTrim( cDestino )<br /><br /> IF Right( AllTrim( cDestino ), 1 ) != "</span>\<span style="color: #ff0000;">"<br /><br /> cDest += "</span>\<span style="color: #ff0000;">"<br /><br /> ENDIF<br /><br /> aArq := hb_GetFilesInZip( AllTrim( cOrigem ) )<br /><br /> nTotal := Len( aArq )<br /><br /> hb_UnzipFile( AllTrim( cOrigem ), {| cFile, nPos | eProgresso( cFile, nPos, nTotal ) },,, cDest, aArq )<br /><br /> ? "</span>Restore Listo<span style="color: #ff0000;">"<br /><br /> ENDIF<br /><br />RETURN NIL<br /><br />FUNCTION eProgresso(vtxt,xPerc,wTot)<br /><br /> Local nPre:=(xPerc*100)/wTot, nBar:=(nPre*74)/100<br /><br /> // Completar aqui depois...<br /><br />RETURN NIL<br /><br />/*<br /> * SPN.PRG<br /> *<br /> * cShortName() - FilePath Long to Short (GetShortPathNameA())<br /> *<br /> * Soporte a Funciones del Api de Windows<br /> *<br /> * Andrade A. Daniel - 2002<br /> * Rosario, Argentina<br /> *<br /> * Libre Distribución<br /> */<br /><br />/*<br /> * cShortName()<br /> */<br /><br />FUNCTION cShortName( cLong )<br /><br /> Local cShort := Space(164) + Chr(0)<br /> Local nBuffer := 164<br /> Local nLen<br /><br /> nLen := GetSPName( cLong, @cShort, nBuffer )<br /><br /> cShort := Left( cShort, nLen )<br /><br />RETURN( cShort )<br /><br />// Windows Api<br />DLL32 STATIC FUNCTION GetSPName( lpszLongPath AS STRING, lpszShortPath AS STRING, lBuffer AS LONG ) ;<br /> AS LONG PASCAL FROM "</span>GetShortPathNameA<span style="color: #ff0000;">" LIB "</span>kernel32<span style="color: #ff0000;">"<br /><br />// FIN / END<br /></span></div>[/code:312xgoct]
Regards, saludos. |
hb_UnZipFile con Harbour | Estimado Armando,
Esto te da las subcarpetas:
aFilInDir := Directory( cDirGlb + "*.*", "D" )
? Len( aFilInDir ) // dinos que cantidad te aparece aqui
Ahora usa el segundo nombre, que debe ser la carpeta, como path:
aFilInDir := Directory( cDirGlb + aFilInDir[ 2 ] + "\", *.Xml" )
? Len( aFilInDir ) |
hb_UnZipFile con Harbour | Master Antonio:
Hecho, muchas gracias.
Saludos |
hb_UnZipFile() date/time question | Hello,
I'm using hb_UnZipFile() to unzip files.
Now I just notice that if extract files, that the date and time of those files are the time from extraction, and not the original from the zip-file.
Is this because I'm using an old version of xHarbour, or is it still the same in the new release? |
hb_UnZipFile() date/time question | Marc,
works fine here (keeps original date/time) using latest xHarbour from SVN.
EMG |
hb_VmDo | Estoy compilando una aplicacion y me marca este erro al ejecutar alguien le ha pasado, uso xharbour 99.66 y fwh27.
gracias.
fernando sandoval ruiz |
hb_VmDo | Fernando,
Que error es ? Puedes indicar el error completo ? gracias |
hb_ZipFile tiene un limite en cuanto al tamaño? | Hola Foro,
Originalmente usaba hb_ZipFile para respaldar solo archivos DBF y FPT, ahora respaldo en el mismo archivo también archivos de fotografías y videos sin ningún problema pero tengo un cliente que tiene muchas fotos y video y crea un archivo ZIP de mas de 4GB y es ahí cuando
hb_ZipFile(NomZip,ArchAR1,9,{|cFile,nPos|oText:SetText(cFile),Avance:=nPos/TotArch*100,oMeter:Set(Avance)},.T.,,.T.,.F.,)
me regresa .F. lo que significa que algo salió mal. Se debe a algún limite que puede tener el archivo ZIP?
'chas gracias de antemano. |
hb_ZipFile tiene un limite en cuanto al tamaño? | Hola,
Los 4Gb, probablemente, son un límite del S.O., que no permite crear archivos mayores a ese tamaño.
Para ese S.O. habría que crear varios archivos por compresión, si es que tiene esa caracteristica hb_zipfile()
Una pregunta, el hb_zipfile, ¿ comprime bien los archivos compartidos, es decir, abiertos en el momento de la compresión ?
Salu2 |
hb_ZipFile tiene un limite en cuanto al tamaño? | Gracias hmpaquito, tu razonamiento suena lógico y por lo mismo lo tomaré como válido.
No se si puede comprimir bien archivos abiertos ya que mi sistema cierra todos los archivos antes de hacer el respaldo y no he hecho la prueba sin hacer eso.
Salu2 |
hb_ZipFile tiene un limite en cuanto al tamaño? | Si el disco donde estas guardando el archivo es una particion fat, o fat32 tendras ese problema.
(de echo la mayoria de las usb o discos externos inicialmente viene usa ese tipo de particion)
para evitarlo, debes usar ntfs (para caso de hd externos) y/o fat_extended. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.