topic
stringlengths
1
63
text
stringlengths
1
577k
Antonio una ayuda POR FAVOR
Luiz,Te sugiero que uses un control RichEdit en vez del control que estas usando, ya que obtendrás el formato RTF correcto, directamente.Por favor, revisa FWH\samples\TestRtf.prg y TestRich.prg
Antonio una ayuda POR FAVOR
Gracias por contestar Antonio, voy a revisalo.Saludos desde Brasil.
Antonio unas preguntas acerca del RichEdit
Master - Como puedo deshabilitar que seleccionen texto y lo puedan copiar usando CTRL-C - Es posible "iluminar" toda la linea del cursor, como si fuera un listbox ? - Casi siempre aunque el tamano del texto a mostrar sea mayor al area del control, no me muestra el scroll vertical y si lo tengo definido en el recurso, hay veces que al hacer un refresco al volver leer el archivo de texto si veo la barra pero se vuelve perder. Gracias de antemano y Saludos
Antonio unas preguntas acerca del RichEdit
Raymundo, > - Como puedo deshabilitar que seleccionen texto y lo puedan copiar usando CTRL-C > La única opción que se me ocurre es deshabilitanto el control, oRichEdit:Disable() > - Es posible "iluminar" toda la linea del cursor, como si fuera un listbox ? Podrías cambiar dinamicamente el fondo de la línea en la que estés situado. Revisa el método SelColor(). habría que modificarlo para que cambie el color del fondo de la línea seleccionada. > - Casi siempre aunque el tamano del texto a mostrar sea mayor al area del control, no me muestra el scroll vertical y si lo tengo definido en el recurso, hay veces que al hacer un refresco al volver leer el archivo de texto si veo la barra pero se vuelve perder. > Intenta proporcionarme un ejemplo en PRG. Puedes reproducirlo con fwh/samples/TestRtf.prg ?
Antonio unreleased objects?
21.06.2012 13:01:26: BRUSH,-1794112426,TCOMBOBOX:SETCOLOR(2513)->TCOMBOBOX:REDEFINE(306)->PERS_STAMM(0)->(b)MAIN(0)->TRBTN:CLICK(676)->TRBTN:LBUTTONUP(854)->TCONTROL:HANDLEEVENT(1690)->TRBTN:HANDLEEVENT(1520)->_FWH(3153)->WINRUN(0)->TWINDOW:ACTIVATE(980)->MAIN(0) 21.06.2012 13:01:26: CUR,65567,XBROWSENEW(11867)->PERS_STAMM(0)->(b)MAIN(0)->TRBTN:CLICK(676)->TRBTN:LBUTTONUP(854)->TCONTROL:HANDLEEVENT(1690)->TRBTN:HANDLEEVENT(1520)->_FWH(3153)->WINRUN(0)->TWINDOW:ACTIVATE(980)->MAIN(0)
Antonio unreleased objects?
Günther, Please provide a small example to reproduce it, thanks <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Antonio unreleased objects?
When leaving a dialog: When i use the clausula COLOR on "redefine combobox", the brush from background-color are not released. And when i use a xbrowse, a cursor are not released.
Antonio ¡estoy inquieto!
Antonio, Veo con cierta inquietud que nuestro barco se está decantando de manera muy clara por Harbour, y esto no sería malo si no fuera porque implicitamente está abandonando xHarbour. Espero estar equivocado, porque mi problema, y supongo que no soy el unico que lo tiene, es que algunos de mis programas mas veteranos y por tanto con un desarrollo mas complejo, con funciones muy especificas desarrolladas a lo largo de años (20 en algún caso) y que están funcionando muy bien bajo xHarbour 1.2.3 no es posible cambiarlos a Harbour, secillamente porque no compilan o lo hacen con muchos errores, lo que hace imposible el proceso de paso. la diferencia ahora mismo entre Harbour y xHarbour es notable y en mi caso concreto insalvable porque no se puede reescribir una aplicación del tipo expuesto sin hacer pasar a los clientes por un nuevo proceso de pruebas superado ya hace mucho tiempo, y que para mas inri resulta que suelen ser los clientes mas importantes <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> Iniciar con Harbour 32/64 bits los nuevos programas está muy bien porque el mercado y las tendencias cambian, pero ¿que hacemos con los casos como el que acabo de exponer?, acaso ¿no habrá nuevas actualizaciones del compilador xHarbour?, ¿Como se le dice a determinados clientes que la aplicación que usan como centro de su sistema ya no va a cambiar al ritmo esperado? <!-- s:| --><img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral" /><!-- s:| --> Pues lo dicho, necesitaba exponer este pensamiento, asi que... ¡sigo inquieto! <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> Saludos <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
Antonio ¡estoy inquieto!
José Mi pequeña experiencia hizo que pasar de xHarbour a Harbour no sea nada. Literalmente nada o casi, sólo un par de lineas pero nada más. Me costó configurar el xEdit ( con el cual programo y compilo ) Una Vez hecho esto, fue sólo presionar un botón Entiendo que mis programas no son complejos, pero tienen sus 10 años de desarrollo al menos y una vez compilado ningún error en funcionamiento. Tal vez si nos pasas tus errores entre todos salga la solución y tu paz para no estar tan inquieto. Abrazo
Antonio ¡estoy inquieto!
José Vicente, No tienes por qué preocuparte, acabo de revisar el repositorio de xHarbour y sigue activo: [url:t2vajhv0]http&#58;//sourceforge&#46;net/p/xharbour/code/HEAD/tree/trunk/xharbour/ChangeLog[/url:t2vajhv0] Asi que si necesitas, por el motivo que sea, seguir trabajando con xHarbour puedes estar tranquilo. Y aqui, por supuesto, seguiremos dando soporte técnico siempre a xHarbour, porque nuestros usuarios son lo primero y jamás dejaríamos a nadie "tirado" <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Lo que si está claro es que Harbour ha superado ya con creces a xHarbour y de ahí que recomendemos a todos que migreis a Harbour. Pero lo dicho, tienes todo nuestro soporte como siempre y a todos los usuarios que tengan que seguir con xHarbour <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Antonio ¡estoy inquieto!
Maestro Antonio, una pregunta: Se tengo FWH64 Bits, y recompilo las librerias de FiveWin 64 con el compilador de xHarbour 32 Bits, funciona normal ó no? Gracias, saludos.
Antonio ¡estoy inquieto!
João, xHarbour no funciona en 64 bits que yo sepa, asi que lo que planteas no es posible <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> Y además de eso, muchas funciones internas de xHarbour no tienen equivalencia en Harbour
Antonio ¡estoy inquieto!
Está claro que el futuro, en estos momentos pasa por Harbour, pero os aseguro que el problema para mi es serio porque hablo de aplicaciones que interactuan con módulos escritos en delphi, Java, incluso VB en algún caso. (solo pensar en un traspaso a Harbour, se me baja la tensión), por cierto que gran parte de la integración con aplicaciones desarrolladas en delphi es gracias a los (tan denostados) indices NTX, solo quería dejar constancia de ello, y leer de Antonio lo que acabo de leer <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> , lo cual me apacigua la 'inquietud' de alguna forma <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Gracias <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
Antonio ¡estoy inquieto!
Jose Vicente, Recientemente he pasado una aplicación importante desde xHarbour a Harbour. Logicamente, cualquier cambio trae complicaciones, en mi caso ha sido el tema de los Codepage. Pero una vez solucionado esto, el cambio de Harbour a xHarbour no ha sido demasiado complicado. Yo sigo trabajando con xHarbour, pero he hecho pequeñas modificaciones en los módulos para hacerlos compatibles y compilo en xHarbour para los clientes y en Harbour para mi, para ir probando. Eso me va a permitir, por ejemplo, cuando los clientes exijan 64 bit, poder compatibilizar 32 bit y 64 bit sin mucho jaleo. Soy receloso para los cambios, cuando la cosa funciona. Tarde tiempo en pasar de Clipper a FiveWin y de FW a FWH. Esta vez prefiero estar preparado.
Antonio ¡estoy inquieto!
Hola Manuel, Gracias por compartir tu experiencia, algo parecido he intentado yo, pero por el momento he sido derrotado en toda regla, de ahí "mi bajón", de todas formas tus palabras me animan a seguir intentando el "paso". Saludos <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
Antonio ¡estoy inquieto!
Foro, Creo que algun dia llegare a migrar y ya lo he pensado, mi problema principal y que me preocupa, radica en que uso tmysql y veo que no esta en harbour. Me diran que use tdolphin, se que no es mala la idea y si la usaria en nuevos desarrollos. Pero, alguien ha podido adaptar tmysql de xHarbour para Harbour ? Saludos
Antonio ¡estoy inquieto!
Paco, Tienes el código fuente de la Clase TMySQL ? De ser asi, por favor publícalo aqui y te ayudamos a compilarlo con Harbour <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Antonio ¡estoy inquieto!
Antonio, Aqui la subo [code=fw:jm431e4k]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;<span style="color: #B900B9;">/*<br />&nbsp;* $Id: tmysql.prg 9279 2011-02-14 18:06:32Z druzus $<br />&nbsp;*/</span><br /><br />&nbsp;<span style="color: #B900B9;">/*<br />&nbsp;* Harbour Project source code:<br />&nbsp;* MySQL DBMS classes.<br />&nbsp;* These classes try to emulate clipper dbXXXX functions on a SQL query<br />&nbsp;*<br />&nbsp;* Copyright 2000 Maurilio Longo <maurilio.longo@libero.it><br />&nbsp;* www - <!-- m --><a class="postlink" href="http://www.harbour-project.org">http://www.harbour-project.org</a><!-- m --><br />&nbsp;*<br />&nbsp;* This program is free software; you can redistribute it and/or modify<br />&nbsp;* it under the terms of the GNU General Public License as published by<br />&nbsp;* the Free Software Foundation; either version 2, or (at your option)<br />&nbsp;* any later version.<br />&nbsp;*<br />&nbsp;* This program is distributed in the hope that it will be useful,<br />&nbsp;* but WITHOUT ANY WARRANTY; without even the implied warranty of<br />&nbsp;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the<br />&nbsp;* GNU General Public License for more details.<br />&nbsp;*<br />&nbsp;* You should have received a copy of the GNU General Public License<br />&nbsp;* along with this software; see the file COPYING. &nbsp;If not, write to<br />&nbsp;* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,<br />&nbsp;* Boston, MA 02111-1307 USA (or visit the web site <!-- m --><a class="postlink" href="http://www.gnu.org/">http://www.gnu.org/</a><!-- m -->).<br />&nbsp;*<br />&nbsp;* As a special exception, the Harbour Project gives permission for<br />&nbsp;* additional uses of the text contained in its release of Harbour.<br />&nbsp;*<br />&nbsp;* The exception is that, if you link the Harbour libraries with other<br />&nbsp;* files to produce an executable, this does not by itself cause the<br />&nbsp;* resulting executable to be covered by the GNU General Public License.<br />&nbsp;* Your use of that executable is in no way restricted on account of<br />&nbsp;* linking the Harbour library code into it.<br />&nbsp;*<br />&nbsp;* This exception does not however invalidate any other reasons why<br />&nbsp;* the executable file might be covered by the GNU General Public License.<br />&nbsp;*<br />&nbsp;* This exception applies only to the code released by the Harbour<br />&nbsp;* Project under the name Harbour. &nbsp;If you copy code from other<br />&nbsp;* Harbour Project or Free Software Foundation releases into a copy of<br />&nbsp;* Harbour, as the General Public License permits, the exception does<br />&nbsp;* not apply to the code that you add in this way. &nbsp;To avoid misleading<br />&nbsp;* anyone as to the status of such modified files, you must delete<br />&nbsp;* this exception notice from them.<br />&nbsp;*<br />&nbsp;* If you write modifications of your own for Harbour, it is your choice<br />&nbsp;* whether to permit this exception to apply to your modifications.<br />&nbsp;* If you do not wish that, delete this exception notice.<br />&nbsp;*<br />&nbsp;*/</span><br /><br />&nbsp;<span style="color: #B900B9;">/*<br />&nbsp;2002-01-28 21:30 UTC+0100 Patrick Mast <email@patrickmast.com><br />&nbsp; &nbsp;* contrib/mysql/tmysql<br />&nbsp; &nbsp; &nbsp;+ Added DateTime field<br />&nbsp; &nbsp; &nbsp;* Added more info on Alert message for Unknown type<br />&nbsp; &nbsp; &nbsp;* Modified ClipValue2SQL() to process empty strings<br />&nbsp;*/</span><br /><br />&nbsp;<span style="color: #B900B9;">/*<br />&nbsp;2002-02-18 07:30 UTC+0100 Srdjan Dragojlovic <digikv@yahoo.com><br />&nbsp; &nbsp;* contrib/mysql/tmysql<br />&nbsp; &nbsp; &nbsp;+ Bug in GOTO Method<br />&nbsp;*/</span><br /><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbclass.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"common.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dbstruct.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"mysql.ch"</span><br /><br /><br /><br /><span style="color: #B900B9;">// Every single row of an answer</span><br /><span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;aRow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// a single row of answer</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;aDirty &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// array of booleans set to .T. if corresponding field of aRow has been changed</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;aOldValue &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// If aDirty[n] is .T. aOldValue[n] keeps a copy of changed value if aRow[n] is part of a primary key</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;aFieldStruct &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// type of each field</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;cTable &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Name of table containing this row, empty if TMySQLQuery returned this row</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> aRow, aFStruct, cTableName <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; <span style="color: #B900B9;">// Create a new Row object</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldGet<span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Same as clipper ones, but FieldGet() and FieldPut() accept a string as</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldPut<span style="color: #000000;">&#40;</span> cnField, Value <span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #B900B9;">// field identifier, not only a number</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldName<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldPos<span style="color: #000000;">&#40;</span> cFieldName <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldLen<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Length of field N</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldDec<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// How many decimals in field N</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldType<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Clipper type of field N</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; MakePrimaryKeyWhere<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// returns a WHERE x=y statement which uses primary key (if available)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> aRow, aFStruct, cTableName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">default</span> cTableName <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;<span style="color: #00C800;">default</span> aFStruct <span style="color: #0000ff;">to</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">aRow</span> &nbsp; &nbsp; &nbsp; &nbsp; := aRow<br />&nbsp; &nbsp;::<span style="color: #000000;">aFieldStruct</span> := aFStruct<br />&nbsp; &nbsp;::<span style="color: #000000;">cTable</span> &nbsp; &nbsp; &nbsp; := cTableName<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">aDirty</span> &nbsp; &nbsp; &nbsp; := Array<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">aOldValue</span> &nbsp; &nbsp;:= Array<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;AFill<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aDirty</span>, .F. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> FieldGet<span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nNum<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; nNum := ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; nNum := cnField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum > <span style="color: #000000;">0</span> .AND. nNum <= Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Char fields are padded with spaces since a real .dbf field would be</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> PadR<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span>, ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> FieldPut<span style="color: #000000;">&#40;</span> cnField, Value <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nNum<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; nNum := ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; nNum := cnField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum > <span style="color: #000000;">0</span> .AND. nNum <= Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span> == Valtype<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> .OR. ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span> == <span style="color: #00C800;">NIL</span> &nbsp;<span style="color: #B900B9;">// .OR. Empty(::aRow[nNum])</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// if it is a char field remove trailing spaces</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Value := RTrim<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Save starting value for this field</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> !::<span style="color: #000000;">aDirty</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">aOldValue</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span> := ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">aDirty</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span> &nbsp; &nbsp;:= .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span> := Value<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> Value<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #B900B9;">// Given a field name returns it's position</span><br /><span style="color: #00C800;">METHOD</span> FieldPos<span style="color: #000000;">&#40;</span> cFieldName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cUpperName, nPos<br /><br />&nbsp; &nbsp;cUpperName := Upper<span style="color: #000000;">&#40;</span> cFieldName <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;nPos := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span>, <span style="color: #000000;">&#123;</span>| aItem | Upper<span style="color: #000000;">&#40;</span> aItem<span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == cUpperName <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> nPos<br /><br /><br /><span style="color: #B900B9;">// Returns name of field N</span><br /><span style="color: #00C800;">METHOD</span> FieldName<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum >= <span style="color: #000000;">1</span> .AND. nNum <= Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">""</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> FieldLen<span style="color: #000000;">&#40;</span>nNum<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum >= <span style="color: #000000;">1</span> .AND. nNum <= Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> FieldDec<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum >= <span style="color: #000000;">1</span> .AND. nNum <= Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_DECIMALS <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> FieldType<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum >= <span style="color: #000000;">1</span> .AND. nNum <= Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Return</span> SQL2ClipType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_TYPE <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">"U"</span><br /><br /><br /><span style="color: #B900B9;">// returns a WHERE x=y statement which uses primary key (if available)</span><br /><span style="color: #00C800;">METHOD</span> MakePrimaryKeyWhere<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cWhere := <span style="color: #ff0000;">" WHERE "</span>, aField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each aField in ::<span style="color: #000000;">aFieldStruct</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// search for fields part of a primary key</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> sqlAND<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> MYSQL_FS_FLAGS <span style="color: #000000;">&#93;</span>, PRI_KEY_FLAG <span style="color: #000000;">&#41;</span> == PRI_KEY_FLAG <span style="color: #000000;">&#41;</span> .OR.;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> sqlAND<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> MYSQL_FS_FLAGS <span style="color: #000000;">&#93;</span>, MULTIPLE_KEY_FLAG <span style="color: #000000;">&#41;</span> == MULTIPLE_KEY_FLAG <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cWhere += aField<span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">"="</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// if a part of a primary key has been changed, use original value</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">aDirty</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cWhere += ClipValue2SQL<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aOldValue</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span>, SQL2ClipType<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span> MYSQL_FS_TYPE <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cWhere += ClipValue2SQL<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span>, SQL2ClipType<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span> MYSQL_FS_TYPE <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cWhere += <span style="color: #ff0000;">" AND "</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// remove last " AND "</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cWhere != <span style="color: #ff0000;">" WHERE "</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// remove last " AND "</span><br />&nbsp; &nbsp; &nbsp; cWhere := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cWhere, Len<span style="color: #000000;">&#40;</span> cWhere <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// sk</span><br />&nbsp; &nbsp; &nbsp; cWhere = <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #00C800;">return</span> cWhere<br /><br /><span style="color: #B900B9;">/* ----------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #B900B9;">// Every single query submitted to MySQL server</span><br /><span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nSocket &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// connection handle to MySQL server</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nResultHandle &nbsp; &nbsp; <span style="color: #B900B9;">// result handle received from MySQL</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;cQuery &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// copy of query that generated this object</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nNumRows &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// number of rows available on answer NOTE MySQL is 0 based</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nCurRow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// I'm currently over row number</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nNumFields &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// how many fields per row</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;aFieldStruct &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// type of each field, a copy is here a copy inside each row</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;aRow<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;lError &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// .T. if last operation failed</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;loRow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// If return oRow in GetRow(),</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nSocket, cQuery, loRow <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// New query object</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Destroy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #00C800;">INLINE</span> sqlFreeR<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">Self</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Free result handle and associated resources</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; End<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">Destroy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; <span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// ReExecutes the query (cQuery) so that changes to table are visible</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; GetRow<span style="color: #000000;">&#40;</span> nRow, loRow, lSkip <span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #B900B9;">// return Row n of answer</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Skip<span style="color: #000000;">&#40;</span> nRows <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Same as clipper ones</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Bof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">lBof</span> &nbsp;<span style="color: #B900B9;">// ::nCurRow == 1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">lEof</span> &nbsp;<span style="color: #B900B9;">// ::nCurRow == ::nNumRows</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">nCurRow</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; LastRec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">nNumRows</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; GoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">GetRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; GoBottom<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">GetRow</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nNumRows</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//-1 )</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; GoTo<span style="color: #000000;">&#40;</span> nRow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">GetRow</span><span style="color: #000000;">&#40;</span> nRow <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">nNumFields</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; NetErr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">lError</span> &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Returns .T. if something went wrong</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Error<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">lError</span> := .F., sqlGetErr<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nSocket</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Returns textual description of last error and clears ::lError</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; ErrorNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">lError</span> := .F., sqlGetErrNo<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nSocket</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Returns number of last error and clears ::lError</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldName<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldPos<span style="color: #000000;">&#40;</span> cFieldName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldGet<span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldLen<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Length of field N</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldDec<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// How many decimals in field N</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldType<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Clipper type of field N</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Locate<span style="color: #000000;">&#40;</span> cFieldName, Value, bPartialKey, bSoftSeek <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">nNumRows</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">PROTECTED</span>:<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> lEof<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> lBof<br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nSocket, cQuery, loRow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> &nbsp;aField, rc, bBlock<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Default</span> loRow <span style="color: #0000ff;">to</span> .t.<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">nSocket</span> &nbsp; &nbsp; &nbsp; := nSocket<br />&nbsp; &nbsp;::<span style="color: #000000;">cQuery</span> &nbsp; &nbsp; &nbsp; &nbsp;:= cQuery<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lError</span> &nbsp; &nbsp; &nbsp; &nbsp;:= .F.<br />&nbsp; &nbsp;::<span style="color: #000000;">aFieldStruct</span> &nbsp;:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">1</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nResultHandle</span> := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nNumFields</span> &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp;::<span style="color: #000000;">nNumRows</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp;::<span style="color: #000000;">loRow</span> &nbsp; &nbsp; &nbsp; &nbsp; := loRow<br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> rc := sqlQuery<span style="color: #000000;">&#40;</span> nSocket, cQuery <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// save result set</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> := sqlStoreR<span style="color: #000000;">&#40;</span> nSocket <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nNumRows</span> &nbsp; &nbsp; := sqlNRows<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nNumFields</span> &nbsp; := sqlNumFi<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aFieldStruct</span> := Array<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nNumFields</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aRow</span> &nbsp; &nbsp; &nbsp; &nbsp; := Array<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nNumFields</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nNumRows</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lEof</span> &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lBof</span> &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lEof</span> &nbsp; &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lBof</span> &nbsp; &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> each aField in ::<span style="color: #000000;">aFieldStruct</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aField := sqlFetchF<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bBlock := ArrayBlock<span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; __objAddInline<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span>, &nbsp; &nbsp; aField<span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span>, bBlock <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; __objAddInline<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span>, <span style="color: #ff0000;">"_"</span>+aField<span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span>, bBlock <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">getRow</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nCurRow</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Should query have returned rows? (Was it a SELECT like query?)</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nNumFields</span> := sqlNumFi<span style="color: #000000;">&#40;</span> nSocket <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Was not a SELECT so reset ResultHandle changed by previous sqlStoreR()</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nResultHandle</span> := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lEof</span> &nbsp; := .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lBof</span> &nbsp; := .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .T.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .T.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> rc<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// free present result handle</span><br />&nbsp; &nbsp;sqlFreeR<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> rc := sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, ::<span style="color: #000000;">cQuery</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// save result set</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nResultHandle</span> := sqlStoreR<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nNumRows</span> := sqlNRows<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// NOTE: I presume that number of fields doesn't change (that is nobody alters this table) between</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// successive refreshes of the same</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// But row number could very well change</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nCurRow</span> > ::<span style="color: #000000;">nNumRows</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> := ::<span style="color: #000000;">nNumRows</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">getRow</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nCurRow</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .T.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> !::<span style="color: #000000;">lError</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> Skip<span style="color: #000000;">&#40;</span> nRows <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><span style="color: #00C800;">Local</span> nOldrow := ::<span style="color: #000000;">nCurRow</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// NOTE: MySQL row count starts from 0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">default</span> nRows <span style="color: #0000ff;">to</span> <span style="color: #000000;">1</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nNumRows</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lBof</span> := .f.<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lEof</span> := .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lBof</span> := .t.<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lEof</span> := .t.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nRows == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// No move</span><br /><br />&nbsp; &nbsp;elseif nRows < <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Negative movement</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nCurRow</span> += nRows<span style="color: #000000;">&#41;</span> < <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lBof</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// positive movement</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nCurRow</span> += nRows<span style="color: #000000;">&#41;</span> > ::<span style="color: #000000;">nNumRows</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> := ::<span style="color: #000000;">nNumRows</span> + <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lEof</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">getRow</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nCurRow</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> ::<span style="color: #000000;">nCurRow</span> - nOldRow<br /><br /><br /><span style="color: #B900B9;">// Get row n of a query and return it as a TMySQLRow object</span><br /><span style="color: #00C800;">METHOD</span> GetRow<span style="color: #000000;">&#40;</span> nRow, loRow, lSkip <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cType, xField<br /><span style="color: #B900B9;">// &nbsp; local cDateFormat := Lower( Set( 4 ) )</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">default</span> loRow <span style="color: #0000ff;">to</span> ::<span style="color: #000000;">loRow</span><br />&nbsp; &nbsp;<span style="color: #00C800;">default</span> nRow &nbsp;<span style="color: #0000ff;">to</span> ::<span style="color: #000000;">nCurRow</span><br />&nbsp; &nbsp;<span style="color: #00C800;">default</span> lSkip <span style="color: #0000ff;">to</span> .f.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nResultHandle</span> <> <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> lSkip<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nRow := ::<span style="color: #000000;">nCurRow</span> + <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> ::<span style="color: #000000;">nNumRows</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lBof</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lEof</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> nRow < <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lBof</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lEof</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> := ::<span style="color: #000000;">nNumRows</span> + <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> nRow > <span style="color: #000000;">0</span> .and. nRow <= ::<span style="color: #000000;">nNumRows</span> <span style="color: #B900B9;">//- 1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lBof</span> &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lEof</span> &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> := nRow<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> nRow > ::<span style="color: #000000;">nNumRows</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lBof</span> &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lEof</span> &nbsp; &nbsp;:= .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> := ::<span style="color: #000000;">nNumRows</span> + <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endcase</span><br />&nbsp; &nbsp; &nbsp; nRow := ::<span style="color: #000000;">nCurRow</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nRow > <span style="color: #000000;">0</span> .AND. nRow <= ::<span style="color: #000000;">nNumRows</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// NOTE: row count starts from 0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sqlDataS<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span>, nRow - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> := nRow<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aRow</span> := sqlFetchR<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; elseif nRow == ::<span style="color: #000000;">nNumRows</span> + <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aRow</span> := Array<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Afill<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aRow</span> := <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">aRow</span> <> <span style="color: #00C800;">NIL</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Convert answer from text field to correct clipper types</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> each xField in ::<span style="color: #000000;">aRow</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cType := SQL2ClipType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_TYPE <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">switch</span> cType<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> <span style="color: #ff0000;">"L"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xField := !<span style="color: #000000;">&#40;</span> Val<span style="color: #000000;">&#40;</span> xField <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> <span style="color: #ff0000;">"N"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> <span style="color: #ff0000;">"I"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> <span style="color: #ff0000;">"T"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xField := Val<span style="color: #000000;">&#40;</span> xField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> <span style="color: #ff0000;">"D"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span>xField<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField := CToD<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">/*<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat = 'mm-dd-yyyy' // USA<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField := ctod(substr(xField,6,2)+"-"+right(xField,2,0)+ "-" + Left(xField, 4))<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif &nbsp;cDateFormat = 'dd/mm/yyyy' .or. cDateFormat = 'dd/mm/yy' // BRITISH ou FRENCH<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField := &nbsp;ctod(right(xField,2,0)+ "/"+ substr(xField,6,2)+"/"+ Left(xField, 4))<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat = 'yyyy.mm.dd' // ANSI<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField := ctod(Left(xField, 4)+ "."+substr(xField,6,2)+"."+right(xField,2,0))<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat = 'dd.mm.yyyy' //GERMAN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField :=ctod(right(xField,2,0)+ "."+ substr(xField,6,2)+"."+ Left(xField, 4 ))<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat = 'dd-mm-yyyy' &nbsp;//ITALIAN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField :=ctod(right(xField,2,0)+ "-"+ substr(xField,6,2)+"-"+ Left(xField, 4))<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat = 'yyyy/mm/dd' //JAPAN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField := &nbsp;ctod(Left(xField, 4)+ "/"+substr(xField,6,2)+"/"+right(xField,2,0))<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat = 'mm/dd/yyyy' // AMERICAN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField := &nbsp;ctod(substr(xField,6,2)+"/"+right(xField,2,0)+ "/" + Left(xField, 4))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField := "''"<br />*/</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// MySQL Date format YYYY-MM-DD</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xField := SToD<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> xField, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> + <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span> xField, <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #0000ff;">right</span><span style="color: #000000;">&#40;</span> xField, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xField := PadR<span style="color: #000000;">&#40;</span> xField , ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> <span style="color: #ff0000;">"M"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> <span style="color: #ff0000;">"B"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Character or Memo field</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">default</span><br /><br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Alert("Unknown type from SQL Server Field: " + LTrim(Str(i))+" is type "+LTrim(Str(nType)))</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br /><br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__objsetValuelist(Self,{{::aFieldStruct[i][MYSQL_FS_NAME],xField}})</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> loRow<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">Return</span> TMySQLRow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span>, ::<span style="color: #000000;">aFieldStruct</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #B900B9;">// Given a field name returns it's position</span><br /><span style="color: #00C800;">METHOD</span> FieldPos<span style="color: #000000;">&#40;</span> cFieldName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cUpperName, nPos := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;cUpperName := Upper<span style="color: #000000;">&#40;</span> cFieldName <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;nPos := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span>, <span style="color: #000000;">&#123;</span>| aItem | Upper<span style="color: #000000;">&#40;</span> aItem<span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> == cUpperName <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> nPos<br /><br /><br /><span style="color: #B900B9;">// Returns name of field N</span><br /><span style="color: #00C800;">METHOD</span> FieldName<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum >= <span style="color: #000000;">1</span> .AND. nNum <= Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">""</span><br /><br /><span style="color: #00C800;">METHOD</span> FieldGet<span style="color: #000000;">&#40;</span>cnField<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nNum, Value<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; nNum := ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; nNum := cnField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum > <span style="color: #000000;">0</span> .AND. nNum <= ::<span style="color: #000000;">nNumfields</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; Value := &nbsp;__objsendmsg(Self,::aFieldStruct[nNum][MYSQL_FS_NAME])</span><br />&nbsp; &nbsp; &nbsp; Value := ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Char fields are padded with spaces since a real .dbf field would be</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> PadR<span style="color: #000000;">&#40;</span> Value, ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> Value<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> FieldLen<span style="color: #000000;">&#40;</span>nNum<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum > <span style="color: #000000;">0</span> .AND. nNum <= ::<span style="color: #000000;">nNumFields</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> FieldDec<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum > <span style="color: #000000;">0</span> .AND. nNum <= ::<span style="color: #000000;">nNumFields</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_DECIMALS <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> FieldType<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cType := <span style="color: #ff0000;">"U"</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum >= <span style="color: #000000;">1</span> .AND. nNum <= ::<span style="color: #000000;">nNumFields</span><br /><br />&nbsp; &nbsp; &nbsp; cType := SQL2ClipType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_TYPE <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cType<br /><br /><br /><span style="color: #00C800;">METHOD</span> Locate<span style="color: #000000;">&#40;</span> cFieldName, Value, bPartialKey, bSoftSeek <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLQuery<br /><span style="color: #00C800;">local</span> nRecPrec := ::<span style="color: #000000;">recno</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, bFound := .F.<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//bSoftSeek cause the record pointer to be moved to the next record</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> bSoftSeek &nbsp; == <span style="color: #00C800;">NIL</span> ; bSoftSeek := .F. ; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> bPartialKey == <span style="color: #00C800;">NIL</span> ; bPartialKey := .T. ; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">while</span> ! ::<span style="color: #000000;">eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;bFound := <span style="color: #000000;">&#40;</span>::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span>cFieldName<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> == Value<span style="color: #000000;">&#41;</span> .or. <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span>cFieldName<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> = Value<span style="color: #000000;">&#41;</span> .and. bPartialKey<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> !bFound .and. <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span>cFieldName<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> > Value<span style="color: #000000;">&#41;</span> .and. bSoftSeek<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;bFound := .T.<br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> bFound<br />&nbsp; &nbsp; &nbsp; &nbsp;exit<br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp;::<span style="color: #000000;">skip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">enddo</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> !bFound<br />&nbsp; &nbsp; &nbsp;::<span style="color: #000000;">goto</span><span style="color: #000000;">&#40;</span>nRecPrec<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> bFound<br /><br /><br /><br /><span style="color: #B900B9;">/* ----------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #B900B9;">// A Table is a query without joins; this way I can Insert() e Delete() rows.</span><br /><span style="color: #B900B9;">// NOTE: it's always a SELECT result, so it will contain a full table only if</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; SELECT * FROM ... was issued</span><br /><span style="color: #00C800;">CLASS</span> TMySQLTable <span style="color: #0000ff;">FROM</span> TMySQLQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;cTable &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// name of table</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;aOldValue &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// &nbsp;keeps a copy of old value</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nSocket, cQuery, cTableName, loRow <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; GetRow<span style="color: #000000;">&#40;</span> nRow, loRow, lSkip <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Skip<span style="color: #000000;">&#40;</span> nRow <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; <span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span> oRow <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Gets an oRow and updates changed fields</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Save<span style="color: #000000;">&#40;</span> oRow <span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #00C800;">INLINE</span> ::<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span> oRow <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Delete<span style="color: #000000;">&#40;</span> oRow <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Deletes passed row from table</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Append<span style="color: #000000;">&#40;</span> oRow <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Inserts passed row into table</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; GetBlankRow<span style="color: #000000;">&#40;</span> loRow <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Returns an empty row with all available fields empty</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Blank<span style="color: #000000;">&#40;</span> loRow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">GetBlankRow</span><span style="color: #000000;">&#40;</span> loRow <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; FieldPut<span style="color: #000000;">&#40;</span> cnField, Value <span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #B900B9;">// field identifier, not only a number</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; <span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; MakePrimaryKeyWhere<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// returns a WHERE x=y statement which uses primary key (if available)</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>nSocket, cQuery, cTableName, loRow<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTable<br /><br /><span style="color: #00C800;">Local</span> xValue<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>nSocket, AllTrim<span style="color: #000000;">&#40;</span>cQuery<span style="color: #000000;">&#41;</span>, loRow<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">cTable</span> &nbsp; &nbsp;:= Lower<span style="color: #000000;">&#40;</span>cTableName<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">aOldValue</span> := Array<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nNumFields</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aOldValue</span><br />&nbsp; &nbsp; &nbsp; xValue := ::<span style="color: #000000;">fieldget</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> GetRow<span style="color: #000000;">&#40;</span> nRow, loRow, lSkip <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTable<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oRow := <span style="color: #00C800;">super</span>:<span style="color: #000000;">GetRow</span><span style="color: #000000;">&#40;</span> nRow, loRow, lSkip <span style="color: #000000;">&#41;</span>, xValue<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oRow <> <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp; &nbsp; oRow:<span style="color: #000000;">cTable</span> := ::<span style="color: #000000;">cTable</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">aOldvalue</span> := Array<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nNumFields</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aOldValue</span><br />&nbsp; &nbsp; &nbsp; xValue := ::<span style="color: #000000;">fieldget</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> oRow<br /><br /><br /><span style="color: #00C800;">METHOD</span> Skip<span style="color: #000000;">&#40;</span>nRow<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTable<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> xValue, nSkipRows<br /><br />&nbsp; &nbsp; &nbsp;nSkipRows := <span style="color: #00C800;">super</span>:<span style="color: #000000;">skip</span><span style="color: #000000;">&#40;</span>nRow<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aOldValue</span><br />&nbsp; &nbsp; &nbsp; &nbsp; xValue := ::<span style="color: #000000;">fieldget</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><span style="color: #00C800;">return</span> nSkipRows<br /><br /><br /><span style="color: #B900B9;">/* Creates an update query for changed fields and submits it to server */</span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span> oRow,cWhere <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTable<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cUpdateQuery := <span style="color: #ff0000;">"UPDATE "</span> + ::<span style="color: #000000;">cTable</span> + <span style="color: #ff0000;">" SET "</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> xValue<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .F.<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// default Current row</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oRow == <span style="color: #00C800;">nil</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aOldValue</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> xValue == <span style="color: #00C800;">NIL</span> .or. xValue <> ::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cUpdateQuery += ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>MYSQL_FS_NAME<span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">"="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,::<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// no Change</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #0000ff;">right</span><span style="color: #000000;">&#40;</span>cUpdateQuery,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span>==<span style="color: #ff0000;">"SET "</span>; <span style="color: #00C800;">return</span> !::<span style="color: #000000;">lError</span>; end<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// remove last comma</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cUpdateQuery := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span>cUpdateQuery, Len<span style="color: #000000;">&#40;</span>cUpdateQuery<span style="color: #000000;">&#41;</span> <span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cWhere != <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cUpdateQuery += <span style="color: #ff0000;">" WHERE "</span> + cWhere<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cUpdateQuery += ::<span style="color: #000000;">MakePrimaryKeyWhere</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><br /><span style="color: #B900B9;">// alert( cUpdateQuery )</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cUpdateQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aOldValue</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xValue := ::<span style="color: #000000;">fieldget</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .T.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; WITH OBJECT oRow<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> :<span style="color: #000000;">cTable</span> == ::<span style="color: #000000;">cTable</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each xValue in :<span style="color: #000000;">aRow</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> :<span style="color: #000000;">aDirty</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cUpdateQuery += :<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">"="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> :<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span>, :<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// remove last comma</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cUpdateQuery := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cUpdateQuery, Len<span style="color: #000000;">&#40;</span>cUpdateQuery <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cUpdateQuery += :<span style="color: #000000;">MakePrimaryKeyWhere</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// alert( cUpdateQuery )</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cUpdateQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// All values are commited</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Afill<span style="color: #000000;">&#40;</span> :<span style="color: #000000;">aDirty</span> &nbsp; , .F. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Afill<span style="color: #000000;">&#40;</span> :<span style="color: #000000;">aOldValue</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .T.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; END &nbsp;<span style="color: #B900B9;">// WITH</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> !::<span style="color: #000000;">lError</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> Delete<span style="color: #000000;">&#40;</span> oRow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTable<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDeleteQuery := <span style="color: #ff0000;">"DELETE FROM "</span> + ::<span style="color: #000000;">cTable</span>, xValue<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// is this a row of this table ?</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oRow == <span style="color: #00C800;">nil</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cDeleteQuery += ::<span style="color: #000000;">MakePrimaryKeyWhere</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cDeleteQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// ::nCurRow--</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aOldValue</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xValue := ::<span style="color: #000000;">fieldget</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .T.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; WITH OBJECT oRow<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> :<span style="color: #000000;">cTable</span> == ::<span style="color: #000000;">cTable</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cDeleteQuery += :<span style="color: #000000;">MakePrimaryKeyWhere</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cDeleteQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .F.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .T.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; END &nbsp;<span style="color: #B900B9;">// WITH</span><br />&nbsp; <span style="color: #00C800;">Endif</span><br /><br /><span style="color: #00C800;">return</span> !::<span style="color: #000000;">lError</span><br /><br /><br /><span style="color: #B900B9;">// Adds a row with values passed into oRow</span><br /><span style="color: #00C800;">METHOD</span> Append<span style="color: #000000;">&#40;</span> oRow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTable<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cInsertQuery := <span style="color: #ff0000;">"INSERT INTO "</span> + ::<span style="color: #000000;">cTable</span> + <span style="color: #ff0000;">" ("</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> xValue, lResult:= .F.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// default Current row</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oRow == <span style="color: #00C800;">nil</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// field names</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aFieldStruct</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> xValue<span style="color: #000000;">&#91;</span> MYSQL_FS_FLAGS <span style="color: #000000;">&#93;</span> <> AUTO_INCREMENT_FLAG<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cInsertQuery += xValue<span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// remove last comma from list</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cInsertQuery := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cInsertQuery, Len<span style="color: #000000;">&#40;</span> cInsertQuery <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">") VALUES ("</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// field values</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aFieldStruct</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> xValue<span style="color: #000000;">&#91;</span> MYSQL_FS_FLAGS <span style="color: #000000;">&#93;</span> <> AUTO_INCREMENT_FLAG<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cInsertQuery += ClipValue2SQL<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">FieldGet</span><span style="color: #000000;">&#40;</span>HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span>HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// remove last comma from list of values and add closing parenthesis</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cInsertQuery := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cInsertQuery, Len<span style="color: #000000;">&#40;</span>cInsertQuery<span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span><br /><br /><span style="color: #B900B9;">// alert( cInsertQuery )</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cInsertQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aOldValue</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xValue := ::<span style="color: #000000;">fieldget</span><span style="color: #000000;">&#40;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lResult:= .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; WITH OBJECT oRow<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> :<span style="color: #000000;">cTable</span> == ::<span style="color: #000000;">cTable</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// field names</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each xValue in :<span style="color: #000000;">aFieldStruct</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> xValue<span style="color: #000000;">&#91;</span> MYSQL_FS_FLAGS <span style="color: #000000;">&#93;</span> <> AUTO_INCREMENT_FLAG<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cInsertQuery += xValue<span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// remove last comma from list</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cInsertQuery := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cInsertQuery, Len<span style="color: #000000;">&#40;</span> cInsertQuery <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">") VALUES ("</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// field values</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each xValue in :<span style="color: #000000;">aRow</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> :<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_FLAGS <span style="color: #000000;">&#93;</span> <> AUTO_INCREMENT_FLAG<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cInsertQuery += ClipValue2SQL<span style="color: #000000;">&#40;</span> xValue, :<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span>HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// remove last comma from list of values and add closing parenthesis</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cInsertQuery := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cInsertQuery, Len<span style="color: #000000;">&#40;</span> cInsertQuery <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span><br /><br /><span style="color: #B900B9;">// alert( cInsertQuery )</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cInsertQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lResult:= .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; END &nbsp;<span style="color: #B900B9;">// WITH</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><span style="color: #00C800;">return</span> lResult<br /><br /><br /><span style="color: #00C800;">METHOD</span> GetBlankRow<span style="color: #000000;">&#40;</span> loRow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTable<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cType<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> xValue<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Default</span> loRow <span style="color: #0000ff;">to</span> ::<span style="color: #000000;">loRow</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each xValue in ::<span style="color: #000000;">aRow</span><br /><br />&nbsp; &nbsp; &nbsp; cType := SQL2ClipType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_TYPE <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">switch</span> cType<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aOldValue</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> := xValue := SPACE<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">aFieldStruct</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"M"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"B"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aOldValue</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> := xValue := <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"N"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"I"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aOldValue</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> := xValue := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"L"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aOldValue</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> := xValue := .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"D"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aOldValue</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> := xValue := CToD<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">default</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aOldValue</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span> := xValue := <span style="color: #00C800;">nil</span><br /><br />&nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> loRow<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> TMySQLRow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span>, ::<span style="color: #000000;">aFieldStruct</span>, ::<span style="color: #000000;">cTable</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> FieldPut<span style="color: #000000;">&#40;</span> cnField, Value <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTable<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nNum<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; nNum := ::<span style="color: #000000;">FieldPos</span><span style="color: #000000;">&#40;</span> cnField <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; nNum := cnField<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNum > <span style="color: #000000;">0</span> .AND. nNum <= ::<span style="color: #000000;">nNumFields</span><br /><br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp;if Valtype( Value ) == Valtype( ::FieldGet( nNum ) ) .OR. ::Fieldget( nNum ) == NIL )</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span> == Valtype<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> .OR. ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span> == <span style="color: #00C800;">NIL</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// if it is a char field remove trailing spaces</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Value := RTrim<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span> := Value<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> Value<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTABLE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> rc<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// free present result handle</span><br />&nbsp; &nbsp;sqlFreeR<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> rc := sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, ::<span style="color: #000000;">cQuery</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// save result set</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nResultHandle</span> := sqlStoreR<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nNumRows</span> &nbsp; &nbsp; &nbsp;:= sqlNRows<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nResultHandle</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// NOTE: I presume that number of fields doesn't change (that is nobody alters this table) between</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// successive refreshes of the same</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// But row number could very well change</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">nCurRow</span> > ::<span style="color: #000000;">nNumRows</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nCurRow</span> := ::<span style="color: #000000;">nNumRows</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">getRow</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nCurRow</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .T.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> !::<span style="color: #000000;">lError</span><br /><br /><br /><span style="color: #B900B9;">// returns a WHERE x=y statement which uses primary key (if available)</span><br /><span style="color: #00C800;">METHOD</span> MakePrimaryKeyWhere<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLTable<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> &nbsp;cWhere := <span style="color: #ff0000;">" WHERE "</span>, aField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each aField in ::<span style="color: #000000;">aFieldStruct</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// search for fields part of a primary key</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> sqlAND<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> MYSQL_FS_FLAGS <span style="color: #000000;">&#93;</span>, PRI_KEY_FLAG <span style="color: #000000;">&#41;</span> == PRI_KEY_FLAG <span style="color: #000000;">&#41;</span> .OR.;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> sqlAND<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> MYSQL_FS_FLAGS <span style="color: #000000;">&#93;</span>, MULTIPLE_KEY_FLAG <span style="color: #000000;">&#41;</span> == MULTIPLE_KEY_FLAG <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cWhere += aField<span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">"="</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// if a part of a primary key has been changed, use original value</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cWhere += ClipValue2SQL<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aOldValue</span><span style="color: #000000;">&#91;</span> HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#93;</span>, ::<span style="color: #000000;">FieldType</span><span style="color: #000000;">&#40;</span>HB_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cWhere += <span style="color: #ff0000;">" AND "</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// remove last " AND "</span><br />&nbsp; &nbsp;cWhere := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cWhere, Len<span style="color: #000000;">&#40;</span> cWhere <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> cWhere<br /><br /><br /><br /><span style="color: #B900B9;">/* ----------------------------------------------------------------------------------------*/</span><br /><br /><span style="color: #B900B9;">// Every available MySQL server</span><br /><span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nSocket &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// connection handle to server (currently pointer to a MYSQL structure)</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;cServer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// server name</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;cDBName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Selected DB</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;cUser &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// user accessing db</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;cPassword &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// his/her password</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;lError &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// .T. if occurred an error</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nPort<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;nFlags<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> &nbsp;cCreateQuery<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cServer, cUser, cPassword, nPort, nFlags <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Opens connection to a server, returns a server object</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Destroy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> sqlClose<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span> <span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">Self</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Closes connection to server</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; SelectDB<span style="color: #000000;">&#40;</span> cDBName <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Which data base I will use for subsequent queries</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; CreateDatabase<span style="color: #000000;">&#40;</span> cDataBase <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Create an New Mysql Database</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; ListDBs<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> sqlListDB<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nSocket</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// returns an array with list of data bases available</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; DBExist<span style="color: #000000;">&#40;</span> cDB <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">&#40;</span> cDB IN ::<span style="color: #000000;">ListDBs</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// return .T. if cTable exist in the database</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; CreateTable<span style="color: #000000;">&#40;</span> cTable, aStruct, cPrimaryKey, cUniqueKey, cAuto<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Create new table using the same syntax of dbCreate()</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; DeleteTable<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// delete table</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; TableExist<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> <span style="color: #000000;">&#40;</span> cTable IN ::<span style="color: #000000;">ListTables</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// return .T. if cTable exist in the database</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; ListTables<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">INLINE</span> sqlListTbl<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nSocket</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// returns an array with list of available tables in current database</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; TableStruct<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// returns a structure array compatible with clipper's dbStruct() ones</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; CreateIndex<span style="color: #000000;">&#40;</span> cName, cTable, aFNames, lUnique <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Create an index (unique) on field name(s) passed as an array of strings aFNames</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; DeleteIndex<span style="color: #000000;">&#40;</span> cName, cTable <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; <span style="color: #B900B9;">// Delete index cName from cTable</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Query<span style="color: #000000;">&#40;</span> cQuery, loRow <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Gets a textual query and returns a TMySQLQuery or TMySQLTable object</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; NetErr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">lError</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Returns .T. if something went wrong</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; Error<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Returns textual description of last error</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> &nbsp; RenameTable<span style="color: #000000;">&#40;</span> old_cTable, new_cTable <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// rename table</span><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cServer, cUser, cPassword, nPort, nFlags <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">cServer</span> &nbsp; := cServer<br />&nbsp; &nbsp;::<span style="color: #000000;">cUser</span> &nbsp; &nbsp; := cUser<br />&nbsp; &nbsp;::<span style="color: #000000;">cPassword</span> := cPassword<br />&nbsp; &nbsp;::<span style="color: #000000;">nPort</span> &nbsp; &nbsp; := nPort<br />&nbsp; &nbsp;::<span style="color: #000000;">nFlags</span> &nbsp; &nbsp;:= nFlags<br />&nbsp; &nbsp;::<span style="color: #000000;">nSocket</span> &nbsp; := sqlConnect<span style="color: #000000;">&#40;</span>cServer, cUser, cPassword, nPort, nFlags <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">lError</span> &nbsp; &nbsp;:= .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">nSocket</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> SelectDB<span style="color: #000000;">&#40;</span> cDBName <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> sqlSelectD<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cDBName <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span> &nbsp; <span style="color: #B900B9;">// table not exist</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cDBName</span> :=<span style="color: #ff0000;">""</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> &nbsp;:= .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// table exist</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cDBName</span> := cDBName<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> &nbsp;:= .F.<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> .F.<br /><br /><br /><br /><span style="color: #00C800;">METHOD</span> CreateDatabase <span style="color: #000000;">&#40;</span> cDataBase <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cCreateQuery := <span style="color: #ff0000;">"CREATE DATABASE "</span>+ lower<span style="color: #000000;">&#40;</span> cDatabase <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cCreateQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> .F.<br /><br /><br /><span style="color: #B900B9;">// NOTE: OS/2 port of MySQL is picky about table names, that is if you create a table with</span><br /><span style="color: #B900B9;">// an upper case name you cannot alter it (for example) using a lower case name, this violates</span><br /><span style="color: #B900B9;">// OS/2 case insensibility about names</span><br /><span style="color: #00C800;">METHOD</span> CreateTable<span style="color: #000000;">&#40;</span> cTable, aStruct, cPrimaryKey, cUniqueKey, cAuto <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* NOTE: all table names are created with lower case */</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aField<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// returns NOT NULL if extended structure has DBS_NOTNULL field to true</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cNN := <span style="color: #000000;">&#123;</span>| aArr | iif<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> aArr <span style="color: #000000;">&#41;</span> > DBS_DEC, iif<span style="color: #000000;">&#40;</span> aArr<span style="color: #000000;">&#91;</span> DBS_NOTNULL <span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">" NOT NULL "</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />&nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> := <span style="color: #ff0000;">"CREATE TABLE "</span> + Lower<span style="color: #000000;">&#40;</span>cTable<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" ("</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each aField in aStruct<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">switch</span> aField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" char("</span> + AllTrim<span style="color: #000000;">&#40;</span>Str<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span>DBS_LEN<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span> + Eval<span style="color: #000000;">&#40;</span>cNN, aField<span style="color: #000000;">&#41;</span>+ <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span>DBS_NAME<span style="color: #000000;">&#93;</span>==cPrimaryKey,<span style="color: #ff0000;">" NOT NULL "</span>,<span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span>+ <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"M"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" text"</span> + Eval<span style="color: #000000;">&#40;</span>cNN, aField<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"N"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> aField<span style="color: #000000;">&#91;</span> DBS_DEC <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">0</span> .and. aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <= <span style="color: #000000;">18</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <= <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" smallint("</span> &nbsp;+ AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <= <span style="color: #000000;">6</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" mediumint("</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <= <span style="color: #000000;">9</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" int("</span> &nbsp; &nbsp; &nbsp; + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">otherwise</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" bigint("</span> &nbsp; &nbsp;+ AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endcase</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cCreateQuery</span> += Eval<span style="color: #000000;">&#40;</span> cNN, aField <span style="color: #000000;">&#41;</span> + <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> == cPrimaryKey, <span style="color: #ff0000;">" NOT NULL "</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> + <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> == cAuto, <span style="color: #ff0000;">" auto_increment "</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" real("</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> DBS_DEC <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span> + Eval<span style="color: #000000;">&#40;</span> cNN, aField <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"D"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" date "</span> + Eval<span style="color: #000000;">&#40;</span> cNN, aField <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"L"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" tinyint "</span> + Eval<span style="color: #000000;">&#40;</span> cNN, aField <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"B"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" mediumblob "</span> + Eval<span style="color: #000000;">&#40;</span> cNN, aField <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"I"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" mediumint "</span> + Eval<span style="color: #000000;">&#40;</span> cNN, aField <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"T"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" timestamp("</span> + AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span> + Eval<span style="color: #000000;">&#40;</span> cNN, aField <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">default</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> += aField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">" char("</span> + AllTrim<span style="color: #000000;">&#40;</span>Str<span style="color: #000000;">&#40;</span>aField<span style="color: #000000;">&#91;</span>DBS_LEN<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span> + Eval<span style="color: #000000;">&#40;</span> cNN, aField <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">","</span><br /><br />&nbsp; &nbsp; &nbsp; end<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> cPrimarykey != <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cCreateQuery</span> += <span style="color: #ff0000;">' PRIMARY KEY ('</span> + cPrimaryKey + <span style="color: #ff0000;">'),'</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> cUniquekey != <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cCreateQuery</span> += <span style="color: #ff0000;">' UNIQUE '</span> + cUniquekey + <span style="color: #ff0000;">' ('</span> + cUniqueKey + <span style="color: #ff0000;">'),'</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// remove last comma from list</span><br />&nbsp; &nbsp;::<span style="color: #000000;">cCreateQuery</span> := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCreateQuery</span>, Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCreateQuery</span> <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">");"</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, ::<span style="color: #000000;">cCreateQuery</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> .F.<br /><br /><br /><span style="color: #00C800;">METHOD</span> CreateIndex<span style="color: #000000;">&#40;</span> cName, cTable, aFNames, lUnique <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cCreateQuery := <span style="color: #ff0000;">"CREATE "</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cField<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">default</span> lUnique <span style="color: #0000ff;">to</span> .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lUnique<br />&nbsp; &nbsp; &nbsp; cCreateQuery += <span style="color: #ff0000;">"UNIQUE INDEX "</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; cCreateQuery += <span style="color: #ff0000;">"INDEX "</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;cCreateQuery += cName + <span style="color: #ff0000;">" ON "</span> + Lower<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" ("</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> each cField in aFNames<br />&nbsp; &nbsp; &nbsp; cCreateQuery += cField + <span style="color: #ff0000;">","</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// remove last comma from list</span><br />&nbsp; &nbsp;cCreateQuery := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cCreateQuery, Len<span style="color: #000000;">&#40;</span> cCreateQuery <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">")"</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cCreateQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> .F.<br /><br /><br /><span style="color: #00C800;">METHOD</span> DeleteIndex<span style="color: #000000;">&#40;</span> cName, cTable <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDropQuery := <span style="color: #ff0000;">"DROP INDEX "</span> + cName + <span style="color: #ff0000;">" FROM "</span> + Lower<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cDropQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> .F.<br /><br /><br /><span style="color: #00C800;">METHOD</span> DeleteTable<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDropQuery := <span style="color: #ff0000;">"DROP TABLE "</span> + Lower<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cDropQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> .T.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> .F.<br /><br /><br /><span style="color: #00C800;">METHOD</span> Query<span style="color: #000000;">&#40;</span> cQuery, loRow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oQuery, cTableName, i, cUpperQuery, nNumTables, cToken<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">default</span> cQuery <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">""</span><br /><br /><br />&nbsp; &nbsp;cUpperQuery := Upper<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> cQuery <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">1</span><br />&nbsp; &nbsp;nNumTables &nbsp;:= <span style="color: #000000;">1</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">while</span> <span style="color: #000000;">&#40;</span>cToken := __StrToken<span style="color: #000000;">&#40;</span> cUpperQuery, i++, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <> <span style="color: #ff0000;">"FROM"</span> .AND. !Empty<span style="color: #000000;">&#40;</span> cToken <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">enddo</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// first token after "FROM" is a table name</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// NOTE: SubSelects ?</span><br />&nbsp; &nbsp;cTableName := __StrToken<span style="color: #000000;">&#40;</span> cUpperQuery, i++, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">while</span> <span style="color: #000000;">&#40;</span> cToken := __StrToken<span style="color: #000000;">&#40;</span> cUpperQuery, i++, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <> <span style="color: #ff0000;">"WHERE"</span> .AND. !Empty<span style="color: #000000;">&#40;</span> cToken <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// do we have more than one table referenced ?</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> cToken == <span style="color: #ff0000;">","</span> .OR. cToken == <span style="color: #ff0000;">"JOIN"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nNumTables++<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">enddo</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nNumTables == <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; oQuery := TMySQLTable<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cQuery, cTableName, loRow <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; oQuery := TMySQLQuery<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nSocket</span>, cQuery, loRow <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oQuery:<span style="color: #000000;">NetErr</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">lError</span> := .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> oQuery<br /><br /><br /><span style="color: #00C800;">METHOD</span> Error<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;::<span style="color: #000000;">lError</span> := .F.<br /><br /><span style="color: #00C800;">return</span> iif<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nSocket</span> > <span style="color: #000000;">0</span>, sqlGetErr<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">nSocket</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"No connection to server"</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">METHOD</span> RenameTable<span style="color: #000000;">&#40;</span> old_cTable, new_cTable <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cDropQuery := <span style="color: #ff0000;">"ALTER TABLE "</span> + Lower<span style="color: #000000;">&#40;</span> old_cTable<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" RENAME "</span>+ Lower<span style="color: #000000;">&#40;</span> new_cTable<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> sqlQuery<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cDropQuery <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> .F.<br /><br /><span style="color: #B900B9;">/* TOFIX: Conversion creates a .dbf with fields of wrong dimension (often) */</span><br /><span style="color: #00C800;">METHOD</span> TableStruct<span style="color: #000000;">&#40;</span> cTable <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TMySQLServer<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nRes, aField, aStruct, aSField, i<br /><br /><br />&nbsp; &nbsp;aStruct := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* TODO: rewrite for MySQL */</span><br />&nbsp; &nbsp;nRes := sqlListF<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nSocket</span>, cTable <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nRes > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> sqlNumFi<span style="color: #000000;">&#40;</span> nRes <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aField &nbsp;:= sqlFetchF<span style="color: #000000;">&#40;</span> nRes <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField := Array<span style="color: #000000;">&#40;</span> DBS_DEC <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// don't count indexes as real fields</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; &nbsp; if aField[ MYSQL_FS_TYPE ] <= MYSQL_LAST_REAL_TYPE</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aSField<span style="color: #000000;">&#91;</span> DBS_NAME <span style="color: #000000;">&#93;</span> := <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> MYSQL_FS_NAME <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aSField<span style="color: #000000;">&#91;</span> DBS_DEC &nbsp;<span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; asField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := &nbsp;SQL2ClipType<span style="color: #000000;">&#40;</span> aField<span style="color: #000000;">&#91;</span> MYSQL_FS_TYPE <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">switch</span> aField<span style="color: #000000;">&#91;</span> MYSQL_FS_TYPE <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_TINY_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"L"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_SHORT_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"N"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> &nbsp;:= <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">6</span>, aField<span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_INT24_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"N"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> &nbsp;:= <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">8</span>, aField<span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_LONG_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"N"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> &nbsp;:= <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">11</span>, aField<span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_LONGLONG_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"N"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> &nbsp;:= <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span>, aField<span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_FLOAT_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_DOUBLE_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_DECIMAL_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_TYPE_NEWDECIMAL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"N"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> := aField<span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSFIeld<span style="color: #000000;">&#91;</span> DBS_DEC <span style="color: #000000;">&#93;</span> := aField<span style="color: #000000;">&#91;</span> MYSQL_FS_DECIMALS <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br /><span style="color: #B900B9;">/* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case FIELD_TYPE_INT24<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField[ DBS_TYPE ] := "I"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField[ DBS_LEN ] := aField[ MYSQL_FS_LENGTH ]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSFIeld[ DBS_DEC ] := aField[ MYSQL_FS_DECIMALS ]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit &nbsp;*/</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_STRING_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_VAR_STRING_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_DATETIME_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_TIME_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> := aField<span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_DATE_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"D"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_MEDIUM_BLOB_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"B"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> := aField<span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_BLOB_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"M"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_TIMESTAMP_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"N"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> &nbsp;:= aField<span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">default</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_TYPE <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aSField<span style="color: #000000;">&#91;</span> DBS_LEN <span style="color: #000000;">&#93;</span> := aField<span style="color: #000000;">&#91;</span> MYSQL_FS_LENGTH <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aStruct, aSField <span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">// &nbsp; &nbsp; &nbsp; &nbsp; endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; sqlFreeR<span style="color: #000000;">&#40;</span> nRes <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> aStruct<br /><br /><br /><span style="color: #B900B9;">// Returns an SQL string with clipper value converted ie. Date() -> "'YYYY-MM-DD'"</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ClipValue2SQL<span style="color: #000000;">&#40;</span>Value, cType<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cValue := <span style="color: #ff0000;">""</span><br /><span style="color: #B900B9;">// &nbsp; local cDateFormat := Lower( Set( 4 ) )</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">Default</span> cType <span style="color: #0000ff;">to</span> ValType<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">switch</span> cType<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"N"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"I"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"D"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// MySQL dates are like YYYY-MM-DD or YYYYMMDD</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cValue := <span style="color: #ff0000;">"'"</span> + Transform<span style="color: #000000;">&#40;</span> Dtos<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"@R 9999-99-99"</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"'"</span><br /><span style="color: #B900B9;">/*<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if cDateFormat == 'mm-dd-yyyy' // USA<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := "'"+PadL(Month(Value), 2, "0") + '-'+ PadL(Day(Value), 2, "0") + "-" + Str(Year(Value), 4) + "'"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif &nbsp;cDateFormat == 'dd/mm/yyyy' // BRITISH ou FRENCH<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//cValue := "'"+PadL(Day(Value), 2, "0") + "/" + PadL(Month(Value), 2, "0") + "/" + Str(Year(Value), 4) + "'"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := "'"+Str(Year(Value), 4) + "-" + PadL(Month(Value), 2, "0") + "-" + PadL(Day(Value), 2, "0") + "'"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat == 'yyyy.mm.dd' // ANSI<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := "'"+Str(Year(Value), 4) &nbsp;+ "." + PadL(Month(Value), 2, "0") + "." + PadL(Day(Value), 2, "0") + "'"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat == 'dd.mm.yyyy' //GERMAN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := "'"+PadL(Day(Value), 2, "0") + "." + PadL(Month(Value), 2, "0") + "." + Str(Year(Value), 4) + &nbsp;"'"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat == 'dd-mm-yyyy' &nbsp;//ITALIAN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := "'"+PadL(Day(Value), 2, "0") + "-" + PadL(Month(Value), 2, "0") + "-" + Str(Year(Value), 4) &nbsp;+ "'"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat == 'yyyy/mm/dd' //JAPAN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := "'"+Str(Year(Value), 4) &nbsp;+ "/" + PadL(Month(Value), 2, "0") + "/" + PadL(Day(Value), 2, "0") + "'"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif cDateFormat == 'mm/dd/yyyy' // AMERICAN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := "'"+Str(Year(Value), 4) &nbsp; &nbsp; + "/" + PadL(Month(Value), 2, "0") + "/" + PadL(Day(Value), 2, "0") + "'"<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; endif<br />*/</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cValue := <span style="color: #ff0000;">"NULL"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"C"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"M"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"B"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> Value<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cValue := <span style="color: #ff0000;">"''"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cValue := <span style="color: #ff0000;">"'"</span> + DATATOSQL<span style="color: #000000;">&#40;</span> value <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"'"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"L"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> iif<span style="color: #000000;">&#40;</span>Value, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> <span style="color: #ff0000;">"T"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := iif<span style="color: #000000;">&#40;</span> Value < <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"NULL"</span>, Alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> Value <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">default</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cValue := <span style="color: #ff0000;">"''"</span> &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// NOTE: Here we lose values we cannot convert</span><br /><br />&nbsp; &nbsp;end<br /><br /><span style="color: #00C800;">return</span> cValue<br /><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SQL2ClipType<span style="color: #000000;">&#40;</span> nType <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">switch</span> nType<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_TINY_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #ff0000;">"L"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_SHORT_TYPE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_LONG_TYPE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_LONGLONG_TYPE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_FLOAT_TYPE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_DOUBLE_TYPE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_DECIMAL_TYPE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_TYPE_NEWDECIMAL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #ff0000;">"N"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_DATE_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #ff0000;">"D"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_BLOB_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #ff0000;">"M"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_VAR_STRING_TYPE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_STRING_TYPE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_DATETIME_TYPE<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_TIME_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #ff0000;">"C"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_INT24_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #ff0000;">"I"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_MEDIUM_BLOB_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #ff0000;">"B"</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> MYSQL_TIMESTAMP_TYPE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">Return</span> <span style="color: #ff0000;">"T"</span><br /><br />&nbsp; &nbsp;end<br /><br /><span style="color: #00C800;">Return</span> <span style="color: #ff0000;">"U"</span><br /><br /><br /><span style="color: #B900B9;">/* Given a three letter month name gives back month number as two char string (ie. Apr -> 04) */</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> NMonth<span style="color: #000000;">&#40;</span>cMonthValue<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">static</span> cMonths := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Jan"</span>, <span style="color: #ff0000;">"Feb"</span>, <span style="color: #ff0000;">"Mar"</span>, <span style="color: #ff0000;">"Apr"</span>, <span style="color: #ff0000;">"May"</span>, <span style="color: #ff0000;">"Jun"</span>, <span style="color: #ff0000;">"Jul"</span>, <span style="color: #ff0000;">"Ago"</span>, <span style="color: #ff0000;">"Sep"</span>, <span style="color: #ff0000;">"Oct"</span>, <span style="color: #ff0000;">"Nov"</span>, <span style="color: #ff0000;">"Dec"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nMonth<br /><br />&nbsp; &nbsp;nMonth := AScan<span style="color: #000000;">&#40;</span>cMonths, cMonthValue<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> PadL<span style="color: #000000;">&#40;</span>nMonth, <span style="color: #000000;">2</span>, <span style="color: #ff0000;">"0"</span><span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ARRAYBLOCK<span style="color: #000000;">&#40;</span> nIndex <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> bBlock<br /><br />&nbsp; &nbsp;bBlock := <span style="color: #000000;">&#123;</span>|Self, x | iif<span style="color: #000000;">&#40;</span> PCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span>, ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span>, ::<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> nIndex <span style="color: #000000;">&#93;</span> := x <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">return</span> bBlock<br /><br />&nbsp;</div>[/code:jm431e4k] Gracias Saludos
Antonio ¡estoy inquieto!
Paco, Has intentado compilarlo con Harbour ? Añade ese PRG como uno más de tu aplicación
Antonio ¡estoy inquieto!
Antonio Voy a probarlo y comento Saludos
Antonio ¡estoy inquieto!
Pues retomando el tema despues de un rato, estoy tratando de crear la lib de la clase tmysql que uso en xharbour para usarla con harbour, pero me tira estos errores, y pues la verdad no entiendo de .c y veo que es los wrappers de mysql.c alguien que me pueda ayudar? adjunto los errores y el codigo de mysql.c Error E2451 mysql.c 160: Undefined symbol 'HB_ITEM' in function HB_FUN_SQLFETCHR Error E2379 mysql.c 160: Statement missing ; in function HB_FUN_SQLFETCHR Error E2451 mysql.c 161: Undefined symbol 'itRow' in function HB_FUN_SQLFETCHR Error E2451 mysql.c 162: Undefined symbol 'itTemp' in function HB_FUN_SQLFETCHR Error E2451 mysql.c 205: Undefined symbol 'HB_ITEM' in function HB_FUN_SQLFETCHF Error E2379 mysql.c 205: Statement missing ; in function HB_FUN_SQLFETCHF Error E2451 mysql.c 207: Undefined symbol 'itField' in function HB_FUN_SQLFETCHF Error E2451 mysql.c 208: Undefined symbol 'itTemp' in function HB_FUN_SQLFETCHF Error E2451 mysql.c 269: Undefined symbol 'HB_ITEM' in function HB_FUN_SQLLISTDB Error E2379 mysql.c 269: Statement missing ; in function HB_FUN_SQLLISTDB Error E2451 mysql.c 275: Undefined symbol 'itDBs' in function HB_FUN_SQLLISTDB Error E2451 mysql.c 280: Undefined symbol 'itTemp' in function HB_FUN_SQLLISTDB Error E2451 mysql.c 294: Undefined symbol 'HB_ITEM' in function HB_FUN_SQLLISTTBL Error E2379 mysql.c 294: Statement missing ; in function HB_FUN_SQLLISTTBL Error E2451 mysql.c 299: Undefined symbol 'itTables' in function HB_FUN_SQLLISTTBL Error E2451 mysql.c 304: Undefined symbol 'itTemp' in function HB_FUN_SQLLISTTBL Warning W8065 mysql.c 362: Call to function 'hb_retclenAdopt' with no prototype in function HB_FUN_DATATOSQL Warning W8065 mysql.c 406: Call to function 'hb_retclenAdopt' with no prototype in function HB_FUN_FILETOSQLBINARY [code=fw:2xs66kr5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/*<br />&nbsp;* $Id: mysql.c 9328 2011-02-27 17:07:05Z lculik $<br />&nbsp;*/</span><br /><br /><span style="color: #B900B9;">/*<br />&nbsp;* Harbour Project source code:<br />&nbsp;* MySQL DBMS low level (client api) interface code.<br />&nbsp;*<br />&nbsp;* Copyright 2000 Maurilio Longo <maurilio.longo@libero.it><br />&nbsp;* www - <!-- m --><a class="postlink" href="http://www.harbour-project.org">http://www.harbour-project.org</a><!-- m --><br />&nbsp;*<br />&nbsp;* This program is free software; you can redistribute it and/or modify<br />&nbsp;* it under the terms of the GNU General Public License as published by<br />&nbsp;* the Free Software Foundation; either version 2, or (at your option)<br />&nbsp;* any later version.<br />&nbsp;*<br />&nbsp;* This program is distributed in the hope that it will be useful,<br />&nbsp;* but WITHOUT ANY WARRANTY; without even the implied warranty of<br />&nbsp;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the<br />&nbsp;* GNU General Public License for more details.<br />&nbsp;*<br />&nbsp;* You should have received a copy of the GNU General Public License<br />&nbsp;* along with this software; see the file COPYING. &nbsp;If not, write to<br />&nbsp;* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,<br />&nbsp;* Boston, MA 02111-1307 USA (or visit the web site <!-- m --><a class="postlink" href="http://www.gnu.org/">http://www.gnu.org/</a><!-- m -->).<br />&nbsp;*<br />&nbsp;* As a special exception, the Harbour Project gives permission for<br />&nbsp;* additional uses of the text contained in its release of Harbour.<br />&nbsp;*<br />&nbsp;* The exception is that, if you link the Harbour libraries with other<br />&nbsp;* files to produce an executable, this does not by itself cause the<br />&nbsp;* resulting executable to be covered by the GNU General Public License.<br />&nbsp;* Your use of that executable is in no way restricted on account of<br />&nbsp;* linking the Harbour library code into it.<br />&nbsp;*<br />&nbsp;* This exception does not however invalidate any other reasons why<br />&nbsp;* the executable file might be covered by the GNU General Public License.<br />&nbsp;*<br />&nbsp;* This exception applies only to the code released by the Harbour<br />&nbsp;* Project under the name Harbour. &nbsp;If you copy code from other<br />&nbsp;* Harbour Project or Free Software Foundation releases into a copy of<br />&nbsp;* Harbour, as the General Public License permits, the exception does<br />&nbsp;* not apply to the code that you add in this way. &nbsp;To avoid misleading<br />&nbsp;* anyone as to the status of such modified files, you must delete<br />&nbsp;* this exception notice from them.<br />&nbsp;*<br />&nbsp;* If you write modifications of your own for Harbour, it is your choice<br />&nbsp;* whether to permit this exception to apply to your modifications.<br />&nbsp;* If you do not wish that, delete this exception notice.<br />&nbsp;*<br />&nbsp;*/</span><br /><br /><span style="color: #B900B9;">/*<br />&nbsp;* The following parts are Copyright of the individual authors.<br />&nbsp;* www - <!-- m --><a class="postlink" href="http://www.harbour-project.org">http://www.harbour-project.org</a><!-- m --><br />&nbsp;*<br />&nbsp;* Copyright 2001 Luiz Rafael Culik <culik@sl.conex.net><br />&nbsp;* &nbsp; &nbsp;DATATOSQL(),FILETOSQLBINARY()<br />&nbsp;*<br />&nbsp;* See doc/license.txt for licensing terms.<br />&nbsp;*<br />&nbsp;*/</span><br /><br /><br /><span style="color: #B900B9;">/* NOTE: we need this to prevent base types redefinition */</span><br /><span style="color: #00D7D7;">#define</span> _CLIPDEFS_H<br />#if defined<span style="color: #000000;">&#40;</span>HB_OS_WIN_USED<span style="color: #000000;">&#41;</span> || defined<span style="color: #000000;">&#40;</span>HB_OS_WIN_32_USED<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00D7D7;">#include</span> <windows.h><br />#endif<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapifs.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"extend.api"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"item.api"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"mysql.h"</span><br /><span style="color: #00D7D7;">#include</span> <stdio.h><br /><span style="color: #00D7D7;">#include</span> <hb_io.h><br /><span style="color: #00D7D7;">#include</span> <fcntl.h><br /><br /><br /><span style="color: #B900B9;">/* NOTE: OS/2 EMX port of MySQL needs libmysqlclient.a from 3.21.33b build which has st and mt<br />&nbsp; &nbsp;versions of client library. I'm using ST version since harbour is single threaded. You need<br />&nbsp; &nbsp;also .h files from same distribution<br />*/</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLCONNECT<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MYSQL *mysql_real_connect(MYSQL*, char * host, char * user, char * password, char * db, uint port, char *, uint flags)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;MYSQL * mysql;<br />&nbsp; &nbsp;const char *szHost=hb_parcx<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;const char *szUser=hb_parcx<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;const char *szPass=hb_parcx<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;unsigned int port &nbsp;= ISNUM<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> ? <span style="color: #000000;">&#40;</span> unsigned int <span style="color: #000000;">&#41;</span> hb_parni<span style="color: #000000;">&#40;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span> : &nbsp;<span style="color: #000000;">MYSQL_PORT</span>;<br />&nbsp; &nbsp;unsigned int flags = ISNUM<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> ? <span style="color: #000000;">&#40;</span> unsigned int <span style="color: #000000;">&#41;</span> hb_parni<span style="color: #000000;">&#40;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span> : &nbsp;<span style="color: #000000;">0</span>;<br />#if MYSQL_VERSION_ID > <span style="color: #000000;">32200</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* from 3.22.x of MySQL there is a new parameter in mysql_real_connect() call, that is char * db<br />&nbsp; &nbsp; &nbsp; which is not used here */</span><br />&nbsp; &nbsp;mysql = mysql_init<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL*<span style="color: #000000;">&#41;</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; ;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> mysql != <span style="color: #00C800;">NULL</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> mysql_real_connect<span style="color: #000000;">&#40;</span> mysql, szHost, szUser, szPass, <span style="color: #000000;">0</span>, port, <span style="color: #00C800;">NULL</span>, flags<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; hb_retnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>long<span style="color: #000000;">&#41;</span> mysql<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;mysql_close<span style="color: #000000;">&#40;</span> mysql <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />#else<br />&nbsp; &nbsp;mysql = mysql_real_connect<span style="color: #000000;">&#40;</span><span style="color: #00C800;">NULL</span>, _parc<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, _parc<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>, _parc<span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span>, <span style="color: #00C800;">NULL</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>long<span style="color: #000000;">&#41;</span> mysql<span style="color: #000000;">&#41;</span>;<br />#endif<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLCLOSE<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// void mysql_close(MYSQL *mysql)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;mysql_close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_ret<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLSELECTD<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// int mysql_select_db(MYSQL *, char *)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;const &nbsp; char *db=hb_parcx<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>long<span style="color: #000000;">&#41;</span> mysql_select_db<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, db<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLQUERY<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// int mysql_query(MYSQL *, char *)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>long<span style="color: #000000;">&#41;</span> mysql_query<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, _parc<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLSTORER<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MYSQL_RES *mysql_store_result(MYSQL *)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>long<span style="color: #000000;">&#41;</span> mysql_store_result<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLFREER<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// void mysql_free_result(MYSQL_RES *)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;mysql_free_result<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL_RES *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_ret<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLFETCHR<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MYSQL_ROW *mysql_fetch_row(MYSQL_RES *)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;MYSQL_RES *mresult = <span style="color: #000000;">&#40;</span>MYSQL_RES *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;UINT ui, uiNumFields = mysql_num_fields<span style="color: #000000;">&#40;</span>mresult<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;ULONG *pulFieldLengths ;<br />&nbsp; &nbsp;MYSQL_ROW mrow;<br />&nbsp; &nbsp;HB_ITEM itRow, itTemp;<br />&nbsp; &nbsp;itRow.type = HB_IT_NIL ;<br />&nbsp; &nbsp;itTemp.type = HB_IT_NIL ;<br /><br />&nbsp; &nbsp;hb_arrayNew<span style="color: #000000;">&#40;</span> &itRow, uiNumFields <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;mrow = mysql_fetch_row<span style="color: #000000;">&#40;</span>mresult<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;pulFieldLengths = mysql_fetch_lengths<span style="color: #000000;">&#40;</span> mresult <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> mrow &nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> <span style="color: #000000;">&#40;</span>ui = <span style="color: #000000;">0</span>; ui < uiNumFields; ui++<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> mrow<span style="color: #000000;">&#91;</span> ui <span style="color: #000000;">&#93;</span> == <span style="color: #00C800;">NULL</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_itemPutC<span style="color: #000000;">&#40;</span> &itTemp , <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>; &nbsp;<span style="color: #B900B9;">// if field is NULL</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span> &nbsp;<span style="color: #B900B9;">// Put the actual data in</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_itemPutCL<span style="color: #000000;">&#40;</span> &itTemp, mrow<span style="color: #000000;">&#91;</span> ui <span style="color: #000000;">&#93;</span>, pulFieldLengths<span style="color: #000000;">&#91;</span> ui <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;hb_arraySetForward<span style="color: #000000;">&#40;</span> &itRow, ui<span style="color: #000000;">+1</span>, &itTemp <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;hb_itemReturn<span style="color: #000000;">&#40;</span>&itRow<span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLDATAS<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// void mysql_data_seek(MYSQL_RES *, unsigned int)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;mysql_data_seek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL_RES *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>unsigned int<span style="color: #000000;">&#41;</span>_parni<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_ret<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLNROWS<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// my_ulongulong &nbsp;mysql_num_rows(MYSQL_RES *)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* NOTE: I receive a my_ulongulong which I convert to a long, so I could lose precision */</span><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>long<span style="color: #000000;">&#41;</span>mysql_num_rows<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL_RES *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLFETCHF<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MYSQL_FIELD *mysql_fetch_field(MYSQL_RES *)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">/* NOTE: field structure of MySQL has 8 members as of MySQL 3.22.x */</span><br />&nbsp; &nbsp;MYSQL_FIELD *mfield;<br />&nbsp; &nbsp;HB_ITEM itField, itTemp;<br /><br />&nbsp; &nbsp;itField.type = HB_IT_NIL ;<br />&nbsp; &nbsp;itTemp.type = HB_IT_NIL ;<br /><br />&nbsp; &nbsp;mfield = mysql_fetch_field<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL_RES *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_arrayNew<span style="color: #000000;">&#40;</span> &itField, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span>!<span style="color: #000000;">&#40;</span>mfield == <span style="color: #00C800;">NULL</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; hb_arraySetForward<span style="color: #000000;">&#40;</span>&itField, <span style="color: #000000;">1</span>, hb_itemPutC<span style="color: #000000;">&#40;</span>&itTemp, mfield->name<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_arraySetForward<span style="color: #000000;">&#40;</span>&itField, <span style="color: #000000;">2</span>, hb_itemPutC<span style="color: #000000;">&#40;</span>&itTemp, mfield->table<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_arraySetForward<span style="color: #000000;">&#40;</span>&itField, <span style="color: #000000;">3</span>, hb_itemPutC<span style="color: #000000;">&#40;</span>&itTemp, mfield->def<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_arraySetForward<span style="color: #000000;">&#40;</span>&itField, <span style="color: #000000;">4</span>, hb_itemPutNL<span style="color: #000000;">&#40;</span>&itTemp, <span style="color: #000000;">&#40;</span>long<span style="color: #000000;">&#41;</span>mfield->type<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_arraySetForward<span style="color: #000000;">&#40;</span>&itField, <span style="color: #000000;">5</span>, hb_itemPutNL<span style="color: #000000;">&#40;</span>&itTemp, mfield->length<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_arraySetForward<span style="color: #000000;">&#40;</span>&itField, <span style="color: #000000;">6</span>, hb_itemPutNL<span style="color: #000000;">&#40;</span>&itTemp, mfield->max_length<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_arraySetForward<span style="color: #000000;">&#40;</span>&itField, <span style="color: #000000;">7</span>, hb_itemPutNL<span style="color: #000000;">&#40;</span>&itTemp, mfield->flags<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_arraySetForward<span style="color: #000000;">&#40;</span>&itField, <span style="color: #000000;">8</span>, hb_itemPutNL<span style="color: #000000;">&#40;</span>&itTemp, mfield->decimals<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;hb_itemReturn<span style="color: #000000;">&#40;</span>&itField<span style="color: #000000;">&#41;</span>;<br /><br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLFSEEK<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES *, MYSQL_FIELD_OFFSET)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;mysql_field_seek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL_RES *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>MYSQL_FIELD_OFFSET<span style="color: #000000;">&#41;</span>_parni<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_ret<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLNUMFI<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// unsigned int mysql_num_fields(MYSQL_RES *)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span>mysql_num_fields<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL_RES *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br />#if MYSQL_VERSION_ID > <span style="color: #000000;">32200</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLFICOU<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// unsigned int mysql_num_fields(MYSQL_RES *)</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span>mysql_field_count<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br />#endif<br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLLISTF<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MYSQL_RES *mysql_list_fields(MYSQL *, char *);</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>long<span style="color: #000000;">&#41;</span> mysql_list_fields<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, _parc<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">NULL</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLGETERR<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// char *mysql_error(MYSQL *);</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retc<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>char *<span style="color: #000000;">&#41;</span>mysql_error<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLGETERRNO<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span>mysql_errno<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLLISTDB<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MYSQL_RES * mysql_list_dbs(MYSQL *, char * wild);</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;MYSQL * mysql = <span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>hb_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;MYSQL_RES * mresult;<br />&nbsp; &nbsp;MYSQL_ROW mrow;<br />&nbsp; &nbsp;long nr, i;<br />&nbsp; &nbsp;HB_ITEM itDBs = HB_ITEM_NIL, itTemp= HB_ITEM_NIL ;<br /><br />&nbsp; &nbsp;mresult = mysql_list_dbs<span style="color: #000000;">&#40;</span>mysql, <span style="color: #00C800;">NULL</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;nr = <span style="color: #000000;">&#40;</span>LONG<span style="color: #000000;">&#41;</span> mysql_num_rows<span style="color: #000000;">&#40;</span>mresult<span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;hb_arrayNew<span style="color: #000000;">&#40;</span> &itDBs, nr<span style="color: #000000;">&#41;</span> ;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> <span style="color: #000000;">&#40;</span>i = <span style="color: #000000;">0</span>; i < nr; i++<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; mrow = mysql_fetch_row<span style="color: #000000;">&#40;</span>mresult<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_itemPutC<span style="color: #000000;">&#40;</span>&itTemp, mrow<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; hb_arraySetForward<span style="color: #000000;">&#40;</span> &itDBs, i<span style="color: #000000;">+1</span>, &itTemp <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;mysql_free_result<span style="color: #000000;">&#40;</span>mresult<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_itemReturn<span style="color: #000000;">&#40;</span>&itDBs<span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLLISTTBL<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MYSQL_RES * mysql_list_tables(MYSQL *, char * wild);</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;MYSQL * mysql = <span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>hb_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;MYSQL_RES * mresult;<br />&nbsp; &nbsp;MYSQL_ROW mrow;<br />&nbsp; &nbsp;long nr, i;<br />&nbsp; &nbsp;HB_ITEM itTables= HB_ITEM_NIL, itTemp= HB_ITEM_NIL;<br /><br />&nbsp; &nbsp;mresult = mysql_list_tables<span style="color: #000000;">&#40;</span>mysql, <span style="color: #00C800;">NULL</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;nr = <span style="color: #000000;">&#40;</span>LONG<span style="color: #000000;">&#41;</span> mysql_num_rows<span style="color: #000000;">&#40;</span>mresult<span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;hb_arrayNew<span style="color: #000000;">&#40;</span>&itTables,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> <span style="color: #000000;">&#40;</span>i = <span style="color: #000000;">0</span>; i < nr; i++<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; mrow = mysql_fetch_row<span style="color: #000000;">&#40;</span>mresult<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; hb_arrayAddForward<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>PHB_ITEM<span style="color: #000000;">&#41;</span> &itTables , hb_itemPutC<span style="color: #000000;">&#40;</span>&itTemp, mrow<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;mysql_free_result<span style="color: #000000;">&#40;</span>mresult<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;hb_itemReturn<span style="color: #000000;">&#40;</span>&itTables<span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">// returns bitwise and of first parameter with second</span><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLAND<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> & _parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLAFFROWS<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>LONG<span style="color: #000000;">&#41;</span> mysql_affected_rows<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLHOSTINFO<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retc<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>char *<span style="color: #000000;">&#41;</span> mysql_get_host_info<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>SQLSRVINFO<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;hb_retc<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>char *<span style="color: #000000;">&#41;</span> mysql_get_server_info<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span>_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br />ULONG getfilelength<span style="color: #000000;">&#40;</span> int handle <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; ULONG nEnd = hb_fsSeek<span style="color: #000000;">&#40;</span> handle, <span style="color: #000000;">0</span> , <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; ULONG nStart = hb_fsSeek<span style="color: #000000;">&#40;</span> handle , <span style="color: #000000;">0</span> , <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span> nEnd - nStart <span style="color: #000000;">&#41;</span> ;<br /><span style="color: #000000;">&#125;</span><br /><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>DATATOSQL<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;char *FromBuffer ;<br />&nbsp; &nbsp;ULONG iSize, iFromSize ;<br />&nbsp; &nbsp;char *ToBuffer;<br />&nbsp; &nbsp;BOOL bResult = <span style="color: #00C800;">FALSE</span> ;<br />&nbsp; &nbsp;iSize= hb_parclen<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp;iFromSize = iSize ;<br /><br />&nbsp; &nbsp;FromBuffer = <span style="color: #000000;">&#40;</span>char*<span style="color: #000000;">&#41;</span> hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> ; &nbsp; <span style="color: #B900B9;">/// aqui modifico wmormar</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> iSize <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp;ToBuffer = <span style="color: #000000;">&#40;</span> char *<span style="color: #000000;">&#41;</span> hb_xgrab<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> iSize*<span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ToBuffer <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ISNUM<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iSize = mysql_real_escape_string<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>, ToBuffer, FromBuffer, iSize<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iSize = mysql_escape_string<span style="color: #000000;">&#40;</span> ToBuffer, FromBuffer, iSize <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;hb_retclenAdopt<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> char *<span style="color: #000000;">&#41;</span> ToBuffer, iSize <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp;bResult = <span style="color: #00C800;">TRUE</span> ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> !bResult <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Should we raise a runtime error here????? or just return the original string</span><br />&nbsp; &nbsp; &nbsp;hb_retclen<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>char *<span style="color: #000000;">&#41;</span> FromBuffer, iFromSize <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span>FILETOSQLBINARY<span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;BOOL bResult = <span style="color: #00C800;">FALSE</span> ;<br />&nbsp; &nbsp;char *szFile= <span style="color: #000000;">&#40;</span>char*<span style="color: #000000;">&#41;</span> hb_parcx<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>; &nbsp; <span style="color: #B900B9;">// aqui modifoco wmormar</span><br />&nbsp; &nbsp;int fHandle;<br />&nbsp; &nbsp;ULONG iSize;<br />&nbsp; &nbsp;char *ToBuffer;<br />&nbsp; &nbsp;char *FromBuffer;<br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> szFile && hb_parclen<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp;fHandle &nbsp; &nbsp;= hb_fsOpen<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span> BYTE *<span style="color: #000000;">&#41;</span> szFile,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> fHandle > <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;iSize &nbsp; &nbsp; &nbsp;= getfilelength<span style="color: #000000;">&#40;</span> fHandle <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> iSize > <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FromBuffer = <span style="color: #000000;">&#40;</span> char *<span style="color: #000000;">&#41;</span> hb_xgrab<span style="color: #000000;">&#40;</span> iSize <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> FromBuffer <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iSize &nbsp; &nbsp; &nbsp;= hb_fsReadLarge<span style="color: #000000;">&#40;</span> fHandle , <span style="color: #000000;">&#40;</span> BYTE * <span style="color: #000000;">&#41;</span> FromBuffer , iSize <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> iSize > <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ToBuffer &nbsp; = <span style="color: #000000;">&#40;</span> char *<span style="color: #000000;">&#41;</span> hb_xgrab<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> iSize*<span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> ToBuffer <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ISNUM<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iSize = mysql_real_escape_string<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>MYSQL *<span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>, ToBuffer, FromBuffer, iSize<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iSize = mysql_escape_string<span style="color: #000000;">&#40;</span> ToBuffer, FromBuffer, iSize<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_retclenAdopt<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> char *<span style="color: #000000;">&#41;</span> ToBuffer, iSize<span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bResult = <span style="color: #00C800;">TRUE</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_xfree<span style="color: #000000;">&#40;</span> FromBuffer <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;hb_fsClose<span style="color: #000000;">&#40;</span> fHandle <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> !bResult <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp;hb_retc<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br /><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:2xs66kr5] Gracias Saludos
Antonio ¡estoy inquieto!
Paco, Añádele al principio #include <hbapi.h>
Antonio ¡estoy inquieto!
Antonio gracias por tu ayuda, ahora me tira estos errores Error E2209 \harbour\include\hbdefs.h 52: Unable to open include file 'stdarg.h' Error E2209 \harbour\include\hbdefs.h 53: Unable to open include file 'stdio.h' Error E2209 \harbour\include\hbdefs.h 54: Unable to open include file 'stdlib.h' Error E2209 \harbour\include\hbdefs.h 55: Unable to open include file 'string.h' Error E2209 \harbour\include\hbdefs.h 56: Unable to open include file 'limits.h' Error E2209 \harbour\include\hbdefs.h 75: Unable to open include file 'stdint.h' Warning W8017 \harbour\include\hbdefs.h 526: Redefinition of 'HB_LONG_LENGTH' is not identical Error E2257 \harbour\include\hbdefs.h 557: , expected Error E2257 \harbour\include\hbdefs.h 612: , expected Error E2451 .\obj\tmysql.c 122: Undefined symbol 'NULL' Error E2141 .\obj\tmysql.c 122: Declaration syntax error Error E2190 .\obj\tmysql.c 122: Unexpected } Error E2040 .\obj\tmysql.c 122: Declaration terminated incorrectly Error E2190 .\obj\tmysql.c 292: Unexpected } Error E2109 .\obj\tmysql.c 292: Not an allowed type in function hb_vm_SymbolInit_TMYSQL *** 14 errors in Compile *** Gracias
Antonio ¡estoy inquieto!
Antonio, Me autorespondo, tenia cambiado el path de mi ilink32.cfg y bcc32.cfg, los corregi y los errores que te acabo de publicar no me los tira mas, pero me vuelve a tirar los primeros errores que te publique. Saludos
Antonio ¡estoy inquieto!
Retomando este hilo, yo también estoy cambiando hacia HARBOUR, pero no puedo compilar la MYSQL.C. Alguien puede apoyarme con esto?. Gracias.
Antonioerror al compilar ej. de progress
Antonio el ejemplo que me posteaste me da este error C:\sistema\progres.prg(9) Error E0030 Syntax error: "parse error at '@'" este es el ejemplo : #include "fivewin.ch" function Mainp() local oDlg, oProg, nValue := 30, oProg2, nValue2 := 20 DEFINE DIALOG oDlg resource "ODLG_browali" TITLE "Progress Bars" linea 9 @ 1, 1 PROGRESS oProg POSITION nValue SIZE 80, 12 @ 1, 20 PROGRESS oProg2 POSITION nValue2 SIZE 12, 50 VERTICAL @ 3, 9 BUTTON "Ok" ACTION oDlg:End() ACTIVATE DIALOG oDlg CENTER ; ON INIT ( oProg:nPosition := nValue,; oProg2:nPosition := 50 ) return nil ¿ Esta clase viene con FWH2.7 o tengo que conseguirla aparte? GRACIAS DE ANTEMANO POR LOS COMENTARIOS SALUDOS
Antonioerror al compilar ej. de progress
Luis, Esa clase viene con FWH, pero la claúsula VERTICAL es nueva y no estará en el FWH que tienes.
Antonioerror al compilar ej. de progress
Antonio, Al comentar la linea con la cláusula "VERTICAL" me da el mismo error, Error E0030 Syntax error: "parse error at '@'" Habrá algun ejemplo mas desarrollado en EL build que yo tengo? GRACIAS DE ANTEMANO SALUDOS <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Antonioerror al compilar ej. de progress
Luis, Busca PROGRESS en tu FiveWin.ch.
Antonioerror al compilar ej. de progress
Antonio, Busqué Progress en mi FIVEWIN.CH y no está <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Antonioerror al compilar ej. de progress
Luis, Necesitas una versión más actualizada de FWH.
Antonioerror al compilar ej. de progress
Antonio, La versión de FWH que tengo es de DIC 2005.. la progress bar no está implementada aquí? Verás, lo que necesito es dar aspecto XP a una aplicacion que estoy desarrollando y lo único que falta es el "meter" ..y bueno si no está, me matriculo con el último build.
Antonioerror al compilar ej. de progress
Luis, En ese build no está implementada totalmente.
Antonioneed help!How to ShowToolTip without move the mouse
I have a tooltip in a get and in a MsgBar, and I need to show both when I show my dialog, my app is for markets, and the use of mouse is rare in my app I already tryed the ShowToolTip() method but it didn't work I searched in the forum but didn't found a solution, some topics like these simple go on unanswered....
Antonioneed help!How to ShowToolTip without move the mouse
If I remember correctly, you need a tooltip class. There was one posted here some time ago. The normal FW tooltip is not a class but rather some functions in TWindow (I think). This is why you need a Tooltip class. Try searching again for "tooltip class." James
Antonioneed help!How to ShowToolTip without move the mouse
I don't have the TTip class and don't like to use third code, Fivewin already have the code but it didn't work or I couldn't discover how to use because of the lack of comments... But thanks for answer
Antonioneed help!How to ShowToolTip without move the mouse
>Fivewin already have the code but it didn't work or I couldn't discover how to use because of the lack of comments... I am trying to tell you that you can't do what you want using only FW native code. The functions are STATIC functions inside one of the FW PRGs, and you cannot call a STATIC function outside the PRG. I know this because I spent many hours on this issue years ago. James
Antonioneed help!How to ShowToolTip without move the mouse
So don't you think that Antonio should do something? I really don't want to move the mouse via code and return to the original position just to show the tooltip... I didn't find the TTip class
Antonioneed help!How to ShowToolTip without move the mouse
>So don't you think that Antonio should do something? Antonio says that the tooltips are STATIC for speed reasons. >I didn't find the TTip class According to this thread: [url:16x8dbld]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=12412&hilit=+in+place+tooltips+[/url:16x8dbld] FW has a new TTooltip class as of version 8.09. I have not tried using it. James
Antonioneed help!How to ShowToolTip without move the mouse
I can't find this class in my 9.06 version
Antonioneed help!How to ShowToolTip without move the mouse
I don't see that class either. Antonio? James
Antonioneed help!How to ShowToolTip without move the mouse
[quote="James Bott":j4x2riq3]I don't see that class either. Antonio? James[/quote:j4x2riq3] Antonio! Where are you?
Antonioneed help!How to ShowToolTip without move the mouse
I am out of the office until tomorrow, so I will check it as soon as I am back there where we have all our tools <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Please send me a reminder, if I don't answer by tomorrow, thanks
Antonioneed help!How to ShowToolTip without move the mouse
Samir, This code shows how to create a standard WIndows tooltip, though it behaves standard, and I don't think thats the behavior that you want: [code=fw:xie65yhd]<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 /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oWnd, hWndTooltip<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CLICK</span> hWndTooltip := CreateTooltip<span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">hWnd</span>, <span style="color: #ff0000;">"Hello world"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:xie65yhd] So I don't think we may be able to use a standard tooltip to create it and leave it fixed at a certain place. Please notice that as soon as the mouse leaves the window owner of the tooltip, it vanishes away. Maybe we should create a small window that simulates a real tooltip
Antonioneed help!How to ShowToolTip without move the mouse
This info seems to provide the missing part: [url:uk1w89qx]http&#58;//msdn&#46;microsoft&#46;com/en-us/library/bb760252(VS&#46;85)&#46;aspx#tooltip_sample_inplace[/url:uk1w89qx] anyhow it seems as we can only change its location in response to a notification code (TTN_SHOW) and that means that the mouse is over the window. Not sure if this may be what you want.
Antonioneed help!How to ShowToolTip without move the mouse
I NEED to show the tooltip through a method or procedure...
Antonioneed help!How to ShowToolTip without move the mouse
Samir, The question is: where the mouse will be ? If it goes out of the window then the tooltip will not be visible. Is that fine for you ?
Antonioneed help!How to ShowToolTip without move the mouse
I need to show the tooltip in a Dialog, I have 4 places where I want to show the tooltip at the same time, there is a image of what I want to do To make this image I overlaped 4 printscreens each one the mouse is over one position [img:2atonykr]http&#58;//img62&#46;imageshack&#46;us/img62/5295/tooltip&#46;png[/img:2atonykr] [quote="Antonio Linares":2atonykr]Samir, The question is: where the mouse will be ? If it goes out of the window then the tooltip will not be visible. Is that fine for you ?[/quote:2atonykr] The mouse will not be moved.
Antonioneed help!How to ShowToolTip without move the mouse
Antonio and Samir, Here is a little program that shows the problem. Calling oControl:showTooltip() does not force the tooltip to be displayed. If we can find a way to do this, the problem will be solved. I think this would be useful in other situations also. For instance, I would use it to force a tooltip to be displayed when the user makes an invalid entry. James [code=fw:2kfdzdt6]<div class="fw" id="{CB}" style="font-family: monospace;">include <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oGet, oBtn, cName:=<span style="color: #ff0000;">"James"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">define</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Test Tooltip"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">5</span>,<span style="color: #000000;">5</span> <span style="color: #0000ff;">get</span> oGet <span style="color: #0000ff;">var</span> cName <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">pixel</span><br />&nbsp; &nbsp;oGet:<span style="color: #000000;">cTooltip</span>:= <span style="color: #ff0000;">"Test tooltip"</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Shows that you cannot force the tooltip to be displayed.</span><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">5</span> <span style="color: #0000ff;">button</span> oBtn <span style="color: #0000ff;">prompt</span> <span style="color: #ff0000;">"Show Tooltip"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">action</span> oGet:<span style="color: #000000;">showToolTip</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">pixel</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:2kfdzdt6]
Antonioneed help!How to ShowToolTip without move the mouse
OK, here is a clue. If I put a msgBeep() as the very last line of showToolTip(), it beeps BEFORE the tooltip is displayed, so it seems that the showTooltip() method does not acually display the tooltip. Perhaps it is just an init routine? Now we need to find the code that actually does display the tooltip. James
Antonioneed help!How to ShowToolTip without move the mouse
James, I think it is related to the standard behavior that Windows provides to the tooltip class. They relate the tooltip to the mouse movements. Maybe there is a message to be sent to the tooltip that forces its inmediate display. But after reviewing Samir's screenshot, I think that a different implementation may be taken. I would display an overlapping bitmaps with all the "simulated" tooltips on it. Similar to samples\newhelp,prg implementation.
Antonioneed help!How to ShowToolTip without move the mouse
Here is a thread on forcing a tooltip to display, but they could find no solution. <!-- m --><a class="postlink" href="http://www.codeguru.com/forum/archive/index.php/t-28180.html">http://www.codeguru.com/forum/archive/i ... 28180.html</a><!-- m --> It also seems that you can display only one tooltip at a time. Samir, it appears that you want to show them all at the same time? James
Antonioneed help!How to ShowToolTip without move the mouse
[quote="Antonio Linares":2bjkoa2v]James, I think it is related to the standard behavior that Windows provides to the tooltip class. They relate the tooltip to the mouse movements. Maybe there is a message to be sent to the tooltip that forces its inmediate display. But after reviewing Samir's screenshot, I think that a different implementation may be taken. I would display an overlapping bitmaps with all the "simulated" tooltips on it. Similar to samples\newhelp,prg implementation.[/quote:2bjkoa2v] The image is just to show what I wish: show multiple tooltips at the same time and without move the mouse
Antonioneed help!How to ShowToolTip without move the mouse
Hola, there is a post-it sample system, why not use it like a base to emualte a multiple tooltip regards Marcelo
Antonioneed help!How to ShowToolTip without move the mouse
Antonio, I'm still waiting a solution, you asked me for remember you, beside the facebook I don't have any other means to enter in contact with you, could you turn on the Private Message in the forum?
Antonioneed help!How to ShowToolTip without move the mouse
Samir, First, we have determined you cannot use the standard windows tooltip since only one can be displayed at one time. So you are going to have to take another approach. Two have been mentioned. Antonio suggested using transparent bitmaps as is shown in \samples\newhelp.prg. And Marcelo suggested looking at the sample post-it program. Either one of these may be your answer. Regards, James
Antonioneed help!How to ShowToolTip without move the mouse
How to change the time the tooltip is displayed and the time the tooltip take to appear, I saw on the MSDN that the tooltip has this atributes, but don't know how to change them... I think that with this 2 properties, 3 seconds for the first, and 0 miliseconds to the second, plus mousemove + SysRefresh() I can simulate what I want.... But James said that the windows show just one ToolTip.
Antonioneed help!How to ShowToolTip without move the mouse
I recenty made this trick: Function UserShowToolTip(cText) oBrowse:DestroyToolTip() oBrowse:cToolTip:=cText // Create and destoy a dialog Define dialog odlg00 from 2,2 to 3,3 STYLE WS_POPUP Activate dialog oDlg00 NOWAIT oDlg00:end() ; oBrowse:setfocus() // Show de tooltip oBrowse:CheckToolTip()
Antonio. Sobre el nombre de las Clases
Hola: El problema que tengo es que si creo una clase heredando de otra ( lo estoy haciendo con btnbmp) el comportamiento de esta clase no es el mismo que el de la clase original. Esto es debido en que algunas partes del codigo de las clases de Fivewin se controla el nombre de la clase para actuar de una u otra forma. Creo que este comportaiento no debería depender del nombre de la clase sinó de algún otro dato que tuviese la clase, porque sino una simple modificación de una clase me obliga a modificar la clase principal window y también creo que la clase control. Yo sólo quiero crear una clase nueva igual que la otra pero con otro nombre, en la que le agregaré una serie de datos adicionales para modificar su comportamiento. Bueno, ahora la pregunta. Si tengo el siguiente codigo [code:28v92dxf]CLASS MiBtn FROM TBNTBMP &#46;&#46;&#46;&#46;&#46; ENDCLASS // redefino los métodos constructores para que se ejecuten los metodos del padre O &#58;= MiBtn&#40;&#41;&#58;New&#40;&#41; o&#58;lCancel &#58;= &#46;T&#46;[/code:28v92dxf] Pues la clausula cancel no funciona Como puedo solucionar esto sin tener que modificar la clase WINDOW, control, ... no se cuales más tendría que modificar. [b:28v92dxf]¿Es posible cambiar el nombre de una clase para que tenga uno distinto al que se usó para crearla?[/b:28v92dxf]
Antonio. Sobre el nombre de las Clases
Tienes toda la razón. Los nombres de las Clases no deberían usarse directamente en determinadas clases, sino usar el método que comprueba si una determinada clase es igual ó deriva de otra. Puedes cambiar el nombre de la clase, pero busca en los PRGs donde se está usando el nombre de esa clase, y añade el tuyo tambien.
Antonio. Sobre el nombre de las Clases
Gracias Antonio, [color=red:2ula6w6y]pero hay alguna forma para que pueda cambiar el nombre de la clase Lo que pretendo es no tener que modificar las clases padres. [/color:2ula6w6y] Te explico el porqué Cuando empece a desarrollar con fivewin me encontré en la necesidad de modificar algunas clases para adaptarlas al funcionamiento que quería. El resultado final es el que yo deseaba, pero al cabo de un poco de tiempo decidí actualizar la versión de fivewin y el resultado fué que tuve que volver a modificar mis clases para poder usar las modificaciones que se se habían realizado en algunas de ellas (yo ignoraba e ignoro cuales fueron modificadas). Entonces decidí que no actualizaria la librería porque los problemas que me originaba no me conpensaba y mientras no necesitara otra cosa pues a aguantarse. Hace aproximadadamente un año decidí volver a actualizar y me volvió a pasar lo mismo, el caso es que se me hace bastante complicado el mantenimiento de las clases modificadas. Como lo resuelvo, bueno pues decido no usar las clases que modifico y en su lugar usar clases heredadas de las originales pero con una serie de comportamientos especificos, reprogramo los metodos que me interesan y el resto los dejo. Al final obtengo una clase con cuatro o cinco métodos modificados que me es muy facil de mantener, pero Si modifico la clase, por ejemplo Window, y actualizo la libreria no solo tengo que preocuparme de los cambios que afecten a las clases que yo he modificado sinoo de otras que no cambié. Un saludo y gracias de nuevo
Antonio. Sobre el nombre de las Clases
Quizás pueda servir algo así : [code:bssunol6]CLASS MiBtn FROM TBNTBMP &#46;&#46;&#46;&#46;&#46; METHOD ClassName&#40;&#41; INLINE "TBTNBMP" &#46;&#46;&#46;&#46;&#46; ENDCLASS[/code:bssunol6] Saludos
Antonio. Sobre el nombre de las Clases
Gracias funcionó. Pero supongo que el nombre de la clase estará registrado en alguna parte de esta, pero no encuentro el data ni el método ClassName definido dentro de la clase. He rebuscado en Windows y Control, pero no lo encuentro, espero que no me cause futuros problemas. Un saludo <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
Antonio. Sobre el nombre de las Clases
Harbour/xHarbour registran automaticamente el nombre de la clase desde la línea CLASS ... la Clase HBObject de [x]Harbour implementa esos métodos y todas las clases heredan automaticamente de ella. Puedes revisar dicha clase en Harbour/source/rtl/tobject.prg.
Antonio.. Por favor
Estimado Antonio, podras revisar este post.... viewtopic.php?f=6&t=19863 o Perdon! Diferencias Listbox actualizacion FWH10.08 (era asi) Muchas Gracias
Antonio.. Por favor
Carlos, Te acabo de contestar en la conversación inicial
Antonio.. tienes un ejemplo completo de mysql y xharbour
Antonio como vas, espero que bien. Necesito un favor, lo que pasa es que por ahi buscando encontre un manual para mysql y habour. De causalidad no tienes uno para xhabour o me sirve el mismo? De antemano gracias
Antonio.. tienes un ejemplo completo de mysql y xharbour
Leandro, Debería servirte el mismo. De todas formas el "gurú" del MySQL es Manú Expósito.
Antonio.. tienes un ejemplo completo de mysql y xharbour
Puedes utilizar Eagle1 y Condor1 de Manuel Expoxito. Lo puedes encontar en: <!-- m --><a class="postlink" href="http://es.groups.yahoo.com/group/eagle1/">http://es.groups.yahoo.com/group/eagle1/</a><!-- m --> <!-- m --><a class="postlink" href="http://es.groups.yahoo.com/group/condor1/">http://es.groups.yahoo.com/group/condor1/</a><!-- m --> Saludos, José Mª
Antonio.. tienes un ejemplo completo de mysql y xharbour
Leandro, Otra opción que puedes valorar es usar ADO para acceder a MySql. Saludos, José Luis Capel PD: Ver <!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?p=5287#5287">http://fivetechsoft.com/forums/viewtopi ... =5287#5287</a><!-- m -->
Antonio.. tienes un ejemplo completo de mysql y xharbour
jlcapel, como vas? Perdon la ignorancia, pero me puedes explicar un poco mas que es ADO y cuales son sus ventajas?
Antonio.. tienes un ejemplo completo de mysql y xharbour
No soy JL Capel, pero "algo" se de esto: 1) ADO = Activex Data Objects, un estandar de windows que te permite accesar a datos SQL utilizando componentes OLE 2) La ventaja, no necesitas configurar nada excepto el "ADO Provider", que en realidad es un componente ODBC muy simple de instalar. 3) ADO te provee de una forma estandar de acceder a los datos, sin importar que base de datos utilices, MySQL, SQL Server, Oracle, Informix, ADS etc. El mismo juego de metodos ADO funciona para cualquier base de datos. 4) ADO trabaja con 3 objetos basicos: Conexion, Comando y RecordSet, todos accesibles desde OLE con (x)Harbour. 5) Un objeto RecordSet es muy similar a un objeto TDBF de FW, asi todas las operaciones sobre un grupo de datos son realizadas de manera rapida sin necesidad de ejecutar comandos SQL sobre una tabla. Este es un ejemplo basico de conexion ADO con MySQL: [code:1warwku8] /* creamos el objeto conexion */ oCon&#58;=toleauto&#40;&#41;&#58;new&#40;"adodb&#46;connection"&#41; /* conectamos con el servidor de base de datos de MySQL */ oCon&#58;OPEN&#40;"DRIVER=&#123;MySQL ODBC 3&#46;51 DRIVER&#125;;SERVER=192&#46;168&#46;2&#46;101;DATABASE=garis;UID=root;PWD=18167231"&#41; /* creamos un objeto comando para ejecutar los queries */ oSql&#58;=toleauto&#40;&#41;&#58;new&#40;"adodb&#46;command"&#41; /* "conectamos" el objeto comando con la conexion previamente creada*/ oSql&#58;ActiveConnection&#40;oCon&#41; /* Creamos el Query SQL en la DATA CommandText*/ oSql&#58;CommandText&#58;="Select * from B3000 where nomar like '%CHICO%'" /* Ejecutamos el Query, el resultado del query queda guardado en otro objeto tipo "recordset" */ oDatos&#58;=oSql&#58;Execute&#40;&#41; /* ¿ cuantos renglones trajo de regreso el query ?*/ ? STR&#40;oDatos&#58;RecordCount&#40;&#41;&#41; /* ¿ cuantas Columnas trajo de regreso el query ? */ ? STR&#40;oDatos&#58;Fields&#58;Count&#40;&#41;&#41; /* Vamos a volcar todos los datos retornados por el query en un array de &#40;x&#41; Harbour*/ aDatos &#58;= &#123;&#125; oDatos&#58;MoveFirst&#40;&#41; // equivale a GO TOP en un DBF do while &#46;not&#46; oDatos&#58;EOF&#40;&#41; AADD&#40;aDatos, &#123;oDatos&#58;Fields&#40;0&#41;&#58;value,; oDatos&#58;Fields&#40;1&#41;&#58;value,; oDatos&#58;Fields&#40;2&#41;&#58;value,; oDatos&#58;Fields&#40;3&#41;&#58;value&#125;&#41; oDatos&#58;MoveNext&#40;&#41; // equivale un SKIP en un DBF enddo [/code:1warwku8]
Antonio.. tienes un ejemplo completo de mysql y xharbour
Rene, Donde puedo encontrar mas información de los comandos, varaibles,etc., de ADO, ej: [code:1aoi2kwb] oSql&#58;CommandText&#58;=&#46;&#46;&#46; oDatos&#58;=oSql&#58;Execute&#40;&#41; oDatos&#58;RecordCount&#40;&#41; oDatos&#58;Fields&#58;Count&#40;&#41; oDatos&#58;MoveFirst&#40;&#41; oDatos&#58;Fields&#40;0&#41;&#58;value&#46;&#46;&#46; [/code:1aoi2kwb] etc. Saludos, Carlos Sincuir
Antonio.. tienes un ejemplo completo de mysql y xharbour
Hola Me interesaria ver un lindo ejemplo de un ABM con ADO, eso, basicamente una tabla inicial de presentacion, modificaciones alta y bajas, como ir refrescando el recordset o existe necesidad de crear otro ? Y creo que se podria browsear DIRECTAMENTE el recordset de ADO sin necesidad de incorporar un array de por medio, mas aun si quiero browsear una base de datos de millones de registros, me quedaria sin memoria <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Salu2
Antonio.. tienes un ejemplo completo de mysql y xharbour
Algo que hay que agregar es que necesitas instalar el MyODBC que lo descargas gratis del website de MySQL
Antonio.. tienes un ejemplo completo de mysql y xharbour
[quote="Hernan Diego Ceccarelli":csi51d8i]Hola Me interesaria ver un lindo ejemplo de un ABM con ADO, eso, basicamente una tabla inicial de presentacion, modificaciones alta y bajas, como ir refrescando el recordset o existe necesidad de crear otro ? Y creo que se podria browsear DIRECTAMENTE el recordset de ADO sin necesidad de incorporar un array de por medio, mas aun si quiero browsear una base de datos de millones de registros, me quedaria sin memoria <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Salu2[/quote:csi51d8i] Hernan: Una de las cosas que hay que quitarnos de la cabeza cuando trabajamos con SQL, es ell modelo de BROWSES de los lenguajes xBase, aqui no se trata de poner una tabla en un browse y darle doble click a un registro para luego traerte la informacion de dicho registro. Ten en cuenta que el modelo SQL es un modelo que se invento a finales de los 60's y no ha cambiado mucho desde entonces. La idea principal del SQL es realizar busquedas que reporten LA MENOR CANTIDAD DE DATOS POSIBLES, es decir, en un sistema por ejemplo de personal, no pones un browse con TODOS los nombres y claves de los trabajadores, le das doble click a un registro y te traes sus datos, mas bien, tienes un GET, le das la clave del trabajador o algun dato que te permita recuperar la informacion, y el programa te devolvera un grupo reducido de datos basados en tu criterio de busqueda, por eso se llama SQL = Structured Query Language o Lenguaje Estructurado de BUSQUEDAS. Este modelo fue diseñado asi desde un princpio, y aunque es perfectamente posible traerte una base de datos de hasta 4 millones de registros (con (x)Harbour) y meterla en un array, pues en realidad es una tonteria hacerlo siendo que bajo el modelo SQL se busca tener la menor cantidad de datos posible. Ahora bien, el volcado de datos a un array lo hice por una deformacion profesional de hace muuucho tiempo, te explico: Antes de trabajar con ADO, era necesario el uso de ODBC, (ahora también pero ADO simplifica el modelo), cuando trabajas con ODBC, todos tus Queries quedan atrapados en un "CURSOR", este cursor es un area de memoria donde reside el resultado del query ejecutado, la unica forma de compatibilizar eso con FiveWin, era descargar el resultado de dicho Query a un DBF temporal o a un Array para poder visualizar los datos. Actualmente, gracias al modelo ADO, tu puedes browsear directamente sobre el RecordSet, simplemente define las columnas de tu browse como datas oRecordSet:Fields(x):value, define un bloque de código :Bskip para moverte sobre los registros del RecordSet, y asigna la data :bLogicLen a RecordSee:RecordCount() y te ahorras la molestia de pasar por el array. Para la actualizacion de datos tiene distintos metodos del record set que se encargan de ellos, eso si, dependen del tipo de cursor que estes utilizando, tambien es importante recordar que para este inviento de la actualizacion directa del RecordSet funcione, es necesario haber hecho un buen diseño de la base de datos, que incorpore el uso de llaves primarias, relaciones e integridad referencial.
Antonio.. tienes un ejemplo completo de mysql y xharbour
[quote:338yz79r] Actualmente, gracias al modelo ADO, tu puedes browsear directamente sobre el RecordSet, simplemente define las columnas de tu browse como datas oRecordSet:Fields(x):value, define un bloque de código :Bskip para moverte sobre los registros del RecordSet, y asigna la data :bLogicLen a RecordSee:RecordCount() y te ahorras la molestia de pasar por el array. [/quote:338yz79r] Un pequeño ejemplo de esto seria maravilloso master Saludos Joel Andujo
Antonio.. tienes un ejemplo completo de mysql y xharbour
Jose Luis Capel hizo unos ejemplos muy interesantes, visita su blog: [url:3qu72qmi]http&#58;//www&#46;capelblog&#46;com/?p=58[/url:3qu72qmi]
Antonio.. tienes un ejemplo completo de mysql y xharbour
Rene, Muchas gracias, has sido muy explicativo. Los modelos SQL nos dan rapidez de consulta, seguridad y C/S, pero nos limitan la "intuitividad" de la aplicacion, es decir, no se concibe un abm intuitivo de algo sin un browse, en ese sentido vamos para atras. <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Salu2
Antonio.. tienes un ejemplo completo de mysql y xharbour
[quote="Hernan Diego Ceccarelli":1u8985y9]Rene, Muchas gracias, has sido muy explicativo. Los modelos SQL nos dan rapidez de consulta, seguridad y C/S, pero nos limitan la "intuitividad" de la aplicacion, es decir, no se concibe un abm intuitivo de algo sin un browse, en ese sentido vamos para atras. <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> Salu2[/quote:1u8985y9] Asi es, ademas de que el concepto de "bloqueo" de registros no existe, un SQL plantea bloqueos "optimistas", es decir, si dos personas estan visualizando la misma informacion, y los dos deciden modificarla, prevaleceran los cambios que haga LA ULTIMA persona. Tampoco existe la actualización de las vistas en linea, es decir, si dos personas estan visualizando la misma informacion, y un tercero altera alguno de los datos visualizados por los otros dos, ambos deberan de "refrescar" la vista de datos para tener acceso a las ultimas modificaciones. El modelo XBase de finales de los 70 prometia superar algunas de las espectatvias de lo que eran los modelos SQL de los 60's, ahora, el modelo ADO pretende copiar lo mismo que hizo el Xbase en su momento, creando objetos RecordSet (que se pudieran comparara con DBFs), y trabajando sobre esos objetos (como si fuesen campos de una DBF), con instrucciones muy similares a las que en su momento tuvo dBase. El modelo ADO pretende darte en "background" un modelo de bloqueo y actualizacion en linea, como lo daba en su momento el modelo Xbase, el gran problema con el que se en encuentra ADO es que la arquitectura sQL no esta pensada como si fuera XBase. Por otro lado, solo los gestores de bases de datos "potentes" como Oracle, SQL Server, Sybase y otros, te dan los componentes necesarios para lo que ADO pretende hacer, si bien MySQL, Postgre, o FireBird te presentan la funcionalidad de un SQL, nunca tendran las prestaciones de un SQL de paga, por algo cuestan lo que cuestan. Si yo siempre he dicho, que lo unico que le hace falta al Xbase para ser perfecto era una herramienta que lo manejara como Gestor de Base de Datos Relacional, y ADS lo hace, con lo cual.....
Antonio... xBrowse modificar teclas pguppgdwon
Holas . De nuevo por aqui.. existe alguna forma de poder capturar las teclas PgUp, PgDown del xBrowse para asignar mi propio metodo sin necesidad de modificar la clase en si. Cualquier cable me serviria para probar. Eso. Gracias.
Antonio... xBrowse modificar teclas pguppgdwon
Olá Adolfo, Você pode criar seu própio método para substituir o método da classe xbrowse assim: [code=fw:38073tji]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">function</span> MAIN<br /><br />override <span style="color: #00C800;">method</span> KeyDown  in <span style="color: #00C800;">class</span> <span style="color: #0000ff;">XBrowse</span>  with MyKeydown<br /><br />...<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> MyKeyDown<span style="color: #000000;">&#40;</span> nKey, nFlags <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> <span style="color: #00C800;">Self</span> := HB_QSelf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oCol<br /><br />   <span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />   <span style="color: #00C800;">case</span> nKey == VK_ESCAPE<br />        <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lEditMode</span><br />           oCol := ::<span style="color: #000000;">SelectedCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">if</span> oCol:<span style="color: #000000;">oEditLbx</span> != <span style="color: #00C800;">nil</span><br />              oCol:<span style="color: #000000;">oEditLbx</span>:<span style="color: #000000;">nLastKey</span> = VK_ESCAPE<br />           <span style="color: #00C800;">endif</span><br />           ::<span style="color: #000000;">CancelEdit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br />        <span style="color: #00C800;">else</span><br />           <span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">KeyDown</span><span style="color: #000000;">&#40;</span> nKey, nFlags <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">endif</span><br /><br />     <span style="color: #00C800;">case</span> nKey == VK_UP    .and. GetKeyState<span style="color: #000000;">&#40;</span> VK_SHIFT <span style="color: #000000;">&#41;</span> .or. ;<br />        nKey == VK_DOWN  .and. GetKeyState<span style="color: #000000;">&#40;</span> VK_SHIFT <span style="color: #000000;">&#41;</span> .or. ;<br />        nKey == VK_LEFT  .and. GetKeyState<span style="color: #000000;">&#40;</span> VK_SHIFT <span style="color: #000000;">&#41;</span> .or. ;<br />        nKey == VK_RIGHT .and. GetKeyState<span style="color: #000000;">&#40;</span> VK_SHIFT <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">KeyDown</span><span style="color: #000000;">&#40;</span> nKey, nFlags <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">case</span> nKey == VK_UP<br />      ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">GoUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">case</span> nKey == VK_DOWN<br />      ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">GoDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">case</span> nKey == VK_LEFT<br />      <span style="color: #00C800;">if</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />         ::<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">else</span><br />         ::<span style="color: #000000;">GoLeft</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">case</span> nKey == VK_RIGHT<br />      <span style="color: #00C800;">if</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />         ::<span style="color: #000000;">GoRightMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">else</span><br />         ::<span style="color: #000000;">GoRight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">case</span> nKey == VK_HOME<br />         ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />         ::<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">case</span> nKey == VK_END<br />         ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />         ::<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">case</span> nKey == VK_PRIOR<br />         ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">if</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />            ::<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">else</span><br />            ::<span style="color: #000000;">PageUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endif</span><br />         ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">case</span> nKey == VK_NEXT<br />         ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">if</span> GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />            ::<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">else</span><br />            ::<span style="color: #000000;">PageDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endif</span><br />         ::<span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">case</span> ::<span style="color: #000000;">lAllowCopy</span> .and. nKey == <span style="color: #0000ff;">ASC</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'C'</span> <span style="color: #000000;">&#41;</span> .and. GetKeyState<span style="color: #000000;">&#40;</span> VK_CONTROL <span style="color: #000000;">&#41;</span><br />         ::<span style="color: #000000;">Copy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">otherwise</span><br />         <span style="color: #00C800;">return</span> <span style="color: #00C800;">Super</span>:<span style="color: #000000;">KeyDown</span><span style="color: #000000;">&#40;</span> nKey, nFlags <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">endcase</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">0</span><br /><br /> </div>[/code:38073tji] Com isto você pode controlar todas as teclas do xbrowse. Espero que seja isso que você precisa <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->
Antonio.... Otra Problema con FWH10.08 !!!
Antonio: Aparte de lo comentado a cerca de los listbox, surgio este otro tema. Compilando con la version FWH10.08 y al usar (en este ejemplo) la clausula WHEN para inhabilitar controles, al presionar la tecla Alt, par poder usar el teclado (Alt+N Consulta Nomenclador) me desaparecen los Radios !!!!!!! Tal lo muestra esta imagen : <!-- m --><a class="postlink" href="http://www.4shared.com/photo/NNYN-j1z/Alt-Fwh1008.html">http://www.4shared.com/photo/NNYN-j1z/Alt-Fwh1008.html</a><!-- m --> Bien, visto esto, cambio de version de compilador a la FWH09.04 (nada mas que eso, sin modificar nada en los .prg ni en los .rc) y la combinacion de teclas Alt+N funciona perfecto y no desaparecen los Radios ..... <!-- m --><a class="postlink" href="http://www.4shared.com/photo/EgOww3WV/Alt-Fwh0904.html">http://www.4shared.com/photo/EgOww3WV/Alt-Fwh0904.html</a><!-- m --> Ademas existen otros Bugs con los listboxs, com por ejemplo: Arrastro hacia arriba los elementos que estan dentro de un listbox ,sin usar las barras laterales, llega un momento, que se pierden los Headers del listbox, y a veces hasta los datos reflejados en este..... Desde ya muchas gracias ... y quedo a la espera .......
Antonio.... Otra Problema con FWH10.08 !!!
Carlos, Has descargado la versión más reciente de FWH 10.8 ? Por favor vuelve a descargarla ya que se han corregido una serie de errores que se han ido detectando, gracias
Antonio.... Otra Problema con FWH10.08 !!!
Antonio : Muchas gracias por la respuesta ...!!!!! La decargo, y reviso lo expuesto en este foro .... Muchas Gracias ......
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
Estoy migrando a la FWH 8.08 y hay algunas cosas que en las que necesito ayuda.En un xBrowse por recursos, necesito ver una lista de precios, pero la columna numerica aunque en la columna le indico la secuencia para mascara (PICTURE) en [b:1ojjqnd9]cEditPicture[/b:1ojjqnd9], me muestra la columna sin separadores.He revisado otros Post, y [b:1ojjqnd9]cEditPicture[/b:1ojjqnd9], no ofrece mucha detalle, en los ejemplos de la FWH, tampoco se tiene mucho alcance, mas para prueba y error.Por otro lado al declarar un BRUSH y quererlo insertar al xBrowse con [b:1ojjqnd9]SetBackGround( oBrush )[/b:1ojjqnd9] me da un error (ver abajo).[code:1ojjqnd9] DEFINE BRUSH oBrush FILE "fondos\fact&#46;bmp" * Define la lista XBrowse WITH OBJECT &#40; oBrowse &#58;= TXBrowse&#40;&#41;&#58;new&#40; oWndChilds&#91;1&#93; &#41; &#41; &#58;CreateFromResource&#40; 803 &#41; &#58;cAlias &#58;= "MOVI" &#58;nColDividerStyle &#58;= LINESTYLE_FORECOLOR &#58;lColDividerComplete &#58;= &#46;T&#46; &#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLROW &#58;lAllowRowSizing &#58;= &#46;F&#46; &#58;lRecordSelector &#58;= &#46;F&#46; &#58;lAllowColHiding &#58;= &#46;F&#46; &#58;lAutoSort &#58;= &#46;T&#46; &#58;lAllowRowSizing &#58;= &#46;F&#46; &#58;lHScroll &#58;= &#46;F&#46; &#58;bClrSel &#58;= &#123;|| &#123; CLR_BLACK, GetSysColor&#40; 13 &#41; &#125; &#125; &#58;SetBackGround&#40; oBrush &#41; && Agrega columna al xBrowse WITH OBJECT &#40; oCol &#58;= &#58;AddCol&#40;&#41; &#41; &#58;cHeader &#58;= "Descripción" &#58;bStrData &#58;= &#123;|| MOVI->MOVI_DESCR &#125; &#58;nWidth &#58;= 256 &#58;nHeadStrAlign &#58;= AL_CENTER END && Agrega columna al xBrowse WITH OBJECT &#40; oCol &#58;= &#58;AddCol&#40;&#41; &#41; &#58;cHeader &#58;= "Precio" &#58;bStrData &#58;= &#123;|| MOVI->MOVI_PRECI &#125; &#58;nWidth &#58;= 90 &#58;nHeadStrAlign &#58;= AL_CENTER &#58;nDataStrAlign &#58;= AL_RIGHT &#58;cEditPicture &#58;= "@Z 99,999&#46;9999" END END [/code:1ojjqnd9]El error que me causa insertar SetBackGround( oBrush )[quote:1ojjqnd9] Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL Args: [ 1] = U Stack Calls =========== Called from: => EVAL(0) Called from: XBROWSE.prg => (b)TXBROWSE:TXBROWSE(286) Called from: => TXBROWSE:KEYCOUNT(0) Called from: XBROWSE.prg => TXBROWSE:REFRESH(823) Called from: WINDOW.prg => (b)TWINDOW:TWINDOW(544) Called from: => TXBROWSE:SETBRUSH(0) Called from: XBROWSE.prg => TXBROWSE:SETBACKGROUND(3602) Called from: Inv_cfac.prg => GENFACT(191) Called from: M2.prg => (b)MAIN(141) Called from: BTNBMP.prg => TBTNBMP:CLICK(389) Called from: BTNBMP.prg => TBTNBMP:LBUTTONUP(560) Called from: => TWINDOW:HANDLEEVENT(0) Called from: CONTROL.prg => TCONTROL:HANDLEEVENT(1429) Called from: BTNBMP.prg => TBTNBMP:HANDLEEVENT(1042) Called from: WINDOW.prg => _FWH(3300) Called from: => WINRUN(0) Called from: WINDOW.prg => TMDIFRAME:ACTIVATE(951)[/quote:1ojjqnd9][/quote]
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
Blessed:Intenta con TRANSFORM()::bStrData := {|| TRANSFORM(MOVI->MOVI_PRECI,"@Z 99,999.9999" } Saludos
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
Blessed, apoyo lo de Armando. Lo siguiente me trabaja perfecto.oCol = oBrw:AddCol() oCol:bStrData = { || Transform((cAlias)->DEBE,"999,999,999.99") } oCol:nDataStrAlign := 1 //alineado a la derechaoCol:cHeader = "DEBITOS" oCol:nEditType = EDIT_GET oCol:bOnPostEdit = { | oCol, xVal, nKey | If( RecCount() == 0, ( DbAppend(), oBrw:Refresh() ),), If( nKey == VK_RETURN, (cAlias)->DEBE := Val(xVal),) } SaludosFrancisco.
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
Armando, FranciscoLes agradezco, me ha servido muy bien su recomendacion, en cuanto a al picture en el xBrowse.Pero aun tengo pendiente lo del error que me causa insertar SetBackGround( oBrush ) desde recursos:[quote:1ylsxhwn]Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL Args: [ 1] = U Stack Calls =========== Called from: => EVAL(0) Called from: XBROWSE.prg => (b)TXBROWSE:TXBROWSE(286) Called from: => TXBROWSE:KEYCOUNT(0) Called from: XBROWSE.prg => TXBROWSE:REFRESH(823) Called from: WINDOW.prg => (b)TWINDOW:TWINDOW(544) Called from: => TXBROWSE:SETBRUSH(0) Called from: XBROWSE.prg => TXBROWSE:SETBACKGROUND(3602) Called from: Inv_cfac.prg => GENFACT(191) Called from: M2.prg => (b)MAIN(141) Called from: BTNBMP.prg => TBTNBMP:CLICK(389) Called from: BTNBMP.prg => TBTNBMP:LBUTTONUP(560) Called from: => TWINDOW:HANDLEEVENT(0) Called from: CONTROL.prg => TCONTROL:HANDLEEVENT(1429) Called from: BTNBMP.prg => TBTNBMP:HANDLEEVENT(1042) Called from: WINDOW.prg => _FWH(3300) Called from: => WINRUN(0) Called from: WINDOW.prg => TMDIFRAME:ACTIVATE(951) [/quote:1ylsxhwn]Saludos desde Honduras
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
[quote="Blessed":1wt1bieh]Estoy migrando a la FWH 8.08 y hay algunas cosas que en las que necesito ayuda. En un xBrowse por recursos, necesito ver una lista de precios, pero la columna numerica aunque en la columna le indico la secuencia para mascara (PICTURE) en [b:1wt1bieh]cEditPicture[/b:1wt1bieh], me muestra la columna sin separadores. He revisado otros Post, y [b:1wt1bieh]cEditPicture[/b:1wt1bieh], no ofrece mucha detalle, en los ejemplos de la FWH, tampoco se tiene mucho alcance, mas para prueba y error. Por otro lado al declarar un BRUSH y quererlo insertar al xBrowse con [b:1wt1bieh]SetBackGround( oBrush )[/b:1wt1bieh] me da un error (ver abajo). [code:1wt1bieh] DEFINE BRUSH oBrush FILE "fondos\fact&#46;bmp" * Define la lista XBrowse WITH OBJECT &#40; oBrowse &#58;= TXBrowse&#40;&#41;&#58;new&#40; oWndChilds&#91;1&#93; &#41; &#41; &#58;CreateFromResource&#40; 803 &#41; &#58;cAlias &#58;= "MOVI" &#58;nColDividerStyle &#58;= LINESTYLE_FORECOLOR &#58;lColDividerComplete &#58;= &#46;T&#46; &#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLROW &#58;lAllowRowSizing &#58;= &#46;F&#46; &#58;lRecordSelector &#58;= &#46;F&#46; &#58;lAllowColHiding &#58;= &#46;F&#46; &#58;lAutoSort &#58;= &#46;T&#46; &#58;lAllowRowSizing &#58;= &#46;F&#46; &#58;lHScroll &#58;= &#46;F&#46; &#58;bClrSel &#58;= &#123;|| &#123; CLR_BLACK, GetSysColor&#40; 13 &#41; &#125; &#125; &#58;SetBackGround&#40; oBrush &#41; && Agrega columna al xBrowse WITH OBJECT &#40; oCol &#58;= &#58;AddCol&#40;&#41; &#41; &#58;cHeader &#58;= "Descripción" &#58;bStrData &#58;= &#123;|| MOVI->MOVI_DESCR &#125; &#58;nWidth &#58;= 256 &#58;nHeadStrAlign &#58;= AL_CENTER END && Agrega columna al xBrowse WITH OBJECT &#40; oCol &#58;= &#58;AddCol&#40;&#41; &#41; &#58;cHeader &#58;= "Precio" &#58;bStrData &#58;= &#123;|| MOVI->MOVI_PRECI &#125; &#58;nWidth &#58;= 90 &#58;nHeadStrAlign &#58;= AL_CENTER &#58;nDataStrAlign &#58;= AL_RIGHT &#58;cEditPicture &#58;= "@Z 99,999&#46;9999" END END [/code:1wt1bieh] El error que me causa insertar SetBackGround( oBrush ) [quote:1wt1bieh] Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL Args: [ 1] = U Stack Calls =========== Called from: => EVAL(0) Called from: XBROWSE.prg => (b)TXBROWSE:TXBROWSE(286) Called from: => TXBROWSE:KEYCOUNT(0) Called from: XBROWSE.prg => TXBROWSE:REFRESH(823) Called from: WINDOW.prg => (b)TWINDOW:TWINDOW(544) Called from: => TXBROWSE:SETBRUSH(0) Called from: XBROWSE.prg => TXBROWSE:SETBACKGROUND(3602) Called from: Inv_cfac.prg => GENFACT(191) Called from: M2.prg => (b)MAIN(141) Called from: BTNBMP.prg => TBTNBMP:CLICK(389) Called from: BTNBMP.prg => TBTNBMP:LBUTTONUP(560) Called from: => TWINDOW:HANDLEEVENT(0) Called from: CONTROL.prg => TCONTROL:HANDLEEVENT(1429) Called from: BTNBMP.prg => TBTNBMP:HANDLEEVENT(1042) Called from: WINDOW.prg => _FWH(3300) Called from: => WINRUN(0) Called from: WINDOW.prg => TMDIFRAME:ACTIVATE(951)[/quote:1wt1bieh][/quote:1wt1bieh][/quote]Blessed:Yo tenía exactamente el mismo problema. La cuestión era que lo llamaba antes del CreateFromCode(). Al llamarlo después, me funcionó correctamente.Ejemplo: oBrw:CreateFromCode() BackGrdBrw(oBrw) //poner fondo al Browse oChild:oClient := oBrw ACTIVATE WINDOW oChild RETURN NIL//------------------------------------FUNCTION BackGrdBrw( oBrw ) Local oBrush DEFINE BRUSH oBrush FILENAME "MiFondo.BMP" oBrw:SetBackGround( oBrush ) RELEASE BRUSH oBrush oBrw:Refresh()return nil Saludos.Francisco Alegría P.
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
Francisco, GraciasLo probe como recomiendas, y me da el mismo error.Una acotacion, yo lo necesito crear desde recursos (CreateFromResource)no directamente desde el codigo (CreateFromCode).Y por cierto, desde recursos no hay documentacion de como hacerlo.Porque he buscado en los ejemplos que acompañan la FWH 8.08 y todos van dirigidos desde codigo, no desde recursos.En la documentacion de ayuda aun no hay referencia al topico de xbrowse desde recursos.Saludos <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
Es posible actualmente utilizar SetBackGround( oBrush ) desde recursos, o estara disponible pronto.Saludos <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
Antonio, Estoy queriendo poner mis aplicaciones al dia, con los cambios de la FWH 8.01 a la 8.08 y me pregunto si es posible actualmente utilizar SetBackGround( oBrush ) desde recursos, o estara disponible pronto. ya que al colocarlo me da el siguiente error:[code:2sru2wb0]DEFINE BRUSH oBrush FILE "fondos\fact&#46;bmp" * Define la lista XBrowse WITH OBJECT &#40; oBrowse &#58;= TXBrowse&#40;&#41;&#58;new&#40; oWndChilds&#91;1&#93; &#41; &#41; &#58;CreateFromResource&#40; 803 &#41; &#58;cAlias &#58;= "MOVI" &#58;nColDividerStyle &#58;= LINESTYLE_FORECOLOR &#58;lColDividerComplete &#58;= &#46;T&#46; &#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLROW &#58;lAllowRowSizing &#58;= &#46;F&#46; &#58;lRecordSelector &#58;= &#46;F&#46; &#58;lAllowColHiding &#58;= &#46;F&#46; &#58;lAutoSort &#58;= &#46;T&#46; &#58;lAllowRowSizing &#58;= &#46;F&#46; &#58;lHScroll &#58;= &#46;F&#46; &#58;bClrSel &#58;= &#123;|| &#123; CLR_BLACK, GetSysColor&#40; 13 &#41; &#125; &#125; &#58;SetBackGround&#40; oBrush &#41; && Agrega columna al xBrowse WITH OBJECT &#40; oCol &#58;= &#58;AddCol&#40;&#41; &#41; &#58;cHeader &#58;= "Descripción" &#58;bStrData &#58;= &#123;|| MOVI->MOVI_DESCR &#125; &#58;nWidth &#58;= 256 &#58;nHeadStrAlign &#58;= AL_CENTER END && Agrega columna al xBrowse WITH OBJECT &#40; oCol &#58;= &#58;AddCol&#40;&#41; &#41; &#58;cHeader &#58;= "Precio" &#58;bStrData &#58;= &#123;|| TRANSFORM&#40; MOVI->MOVI_PRECI, "@Z 99,999&#46;9999" &#41; &#125; &#58;nWidth &#58;= 90 &#58;nHeadStrAlign &#58;= AL_CENTER &#58;nDataStrAlign &#58;= AL_RIGHT END END [/code:2sru2wb0][quote:2sru2wb0]Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL Args: [ 1] = U Stack Calls =========== Called from: => EVAL(0) Called from: XBROWSE.prg => (b)TXBROWSE:TXBROWSE(286) Called from: => TXBROWSE:KEYCOUNT(0) Called from: XBROWSE.prg => TXBROWSE:REFRESH(823) Called from: WINDOW.prg => (b)TWINDOW:TWINDOW(544) Called from: => TXBROWSE:SETBRUSH(0) Called from: XBROWSE.prg => TXBROWSE:SETBACKGROUND(3602) Called from: Inv_cfac.prg => GENFACT(191) Called from: M2.prg => (b)MAIN(141) Called from: BTNBMP.prg => TBTNBMP:CLICK(389) Called from: BTNBMP.prg => TBTNBMP:LBUTTONUP(560) Called from: => TWINDOW:HANDLEEVENT(0) Called from: CONTROL.prg => TCONTROL:HANDLEEVENT(1429) Called from: BTNBMP.prg => TBTNBMP:HANDLEEVENT(1042) Called from: WINDOW.prg => _FWH(3300) Called from: => WINRUN(0) Called from: WINDOW.prg => TMDIFRAME:ACTIVATE(951)[/quote:2sru2wb0]Saludos <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
[quote="Blessed":1edt8698] DEFINE BRUSH oBrush FILE "fondos\fact.bmp" [/quote:1edt8698]no definas el BRUSH:SetBackGrnd( [b:1edt8698]"[/b:1edt8698] direccion del bitmap o nombre del recurso [b:1edt8698]"[/b:1edt8698] )otra forma como lo puedes hacer si quieres definir el BRUSH primero, cuando actives el DIALOG o el WINDOW que contiene el xbrowse en la clausula ON INIT colocas la asignacion del brushactivate dialog oDlg on init oBrw:SetBackGrnd( oBrush )
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
mcfox, Gracias por tu tiempo.Probe de ambas maneras y no me resulta; seguiremos esperando, tal vez...Saludos desde Honduras <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Antonio...Ayuda con xBrowse (SetBackGround) desde recursos
Blessed,El error se debe a que bKeyCount es nil:[code:1sjpr0w2] Stack Calls =========== Called from&#58; => EVAL&#40;0&#41; Called from&#58; XBROWSE&#46;prg => &#40;b&#41;TXBROWSE&#58;TXBROWSE&#40;286&#41; Called from&#58; => TXBROWSE&#58;KEYCOUNT&#40;0&#41; &#46;&#46;&#46; [/code:1sjpr0w2]Es suficiente con que definas oBrw:bKeyCount antes de intentar asignar el brush.
Antonio...Codigo que no funciona
AntonioEsto es un código que no he podido hacer funcionar bajo ninguna versión de FWH superior a 2.4. y xHarbour 0.99.60Pareciera que el objeto contenedor (la ventana inicial) perdiera su contenido y por eso desconoce al modulo que se está ejecutando...¿alguna sugerencia para superar el problema? ':oops:'*********** CODIGO QUE NO FUNCIONA ***********#include "FiveWin.ch"Global oWnd//------------------------------------------//Function Main() Local oFont2 IF IsExeRunning( cFileName( HB_ARGV(0) ) ) Alert("No es posible iniciar nuevamente..."+CRLF+; "el programa esta abierto en"+CRLF+; "segundo plano",,"ATENCION") RETURN NIL //ELSE // xxSigue := .T. ENDIF BWCCRegister( GetResources() ) DEFINE FONT oFont2 name "ARIAL" size 0, -40 DEFINE WINDOW oWnd FROM 0, 0 TO MAXROW(), MAXCOL() ; TITLE "ANALISIS MODULAR DE PROCESOS OPERATIVOS" ; MENU BuildMenu() SET MESSAGE OF oWnd ; TO FWVERSION + ", " + "AMPO By SisGEm" CENTERED KEYBOARD ACTIVATE WINDOW oWnd ON PAINT ; ( SayTexto(oWnd,"Análisis Modular de Procesos Organizacionales",oFont2,,,3 ) MAXIMIZED/* ACTIVATE WINDOW oWnd ON PAINT ; ( FillColor( oWnd,4,,,, 1), SayTexto(oWnd,"Análisis Modular de Procesos Organizacionales",oFont2,,,3 )) ; MAXIMIZED*/return nilFunction SayTexto(_oWnd, texto, _oFont, nBottom, nRight, nLineBot) local hWnd := _oWnd:hWnd local aRect := GetClientRect( hWnd ) LOCAL nSizeTxt, nHeightFont DEFAULT texto := "SisGEm",; _oFont := _oWnd:GetFont(),; nBottom := aRect[ 3 ],; nRight := aRect[ 4 ],; nLineBot:= 1 IF _oWnd != NIL IF ! Empty( Texto ) nSizeTxt := _oWnd:GetWidth( texto, _oFont ) nHeightFont := _oFont:nHeight _oWnd:GetDC() _oWnd:Say(nBottom - (nHeightFont*nLineBot), ; nRight - (nSizeTxt + 20) , ; texto , ; "W+/B","B+/W" , ; _oFont, .T., .T., 0) _oWnd:ReleaseDC() ENDIF ENDIFRETURN NILDLL32 FUNCTION BWCCRegister( hInst AS LONG ) AS WORD PASCAL LIB "SgemBW32.DLL" //(BWCC32.DLL)FUNCTION BuildMenu() Local oMenu // Define our menu for the shell window MENU oMenu MENUITEM "&Acerca de..." MENU MENUITEM "&Autoría" ; ACTION AboutMe() //MsgLogo( "Logosys.bmp",5) ENDMENU MENUITEM "&Entidades" ; ACTION Nodisp() ; //0101 MESSAGE "Registro de entidades que componen la organización bajo análisis" SEPARATOR MENUITEM "&Procesos" ; ACTION NoDisp() ; //0102 MESSAGE "Registro de procesos existentes en cada Entidad" SEPARATOR MENUITEM "&Actividades" ; ACTION NoDisp() ; //0103 MESSAGE "Registro y mantenimiento de Actividades que componen un Proceso" *MENUITEM "&Help" ; // 05 * ACTION VerHelp("SHM_Contents0001") ; * MESSAGE "Ayuda principal" MENUITEM "e&Xit" ; ACTION oWnd:end() ; MESSAGE "Salir del programa" ENDMENURETURN oMenuFUNCTION AboutMe() Local oDlg, oBt DEFINE DIALOG oDlg RESOURCE "AboutMe" REDEFINE BUTTON oBt ID 101 ; OF oDlg ; ACTION oDlg:end() CANCEL ACTIVATE DIALOG oDlg CENTEREDRETURN NILFUNCTION NoDisp() mSGINFO("Falta Desarrollar...","ATENCION...")RETURN NIL******** ARCHIVO RC *****/*************************************************************************ampo.rcproduced by Borland Resource Workshop*************************************************************************/#define BITMAP_1 1AboutMe DIALOG 109, 53, 148, 88STYLE WS_POPUP | WS_VISIBLE | WS_CAPTIONCAPTION "COPYRIGHT"FONT 8, "MS Sans Serif"{ LTEXT "[A]nálisis", -1, 82, 9, 60, 8, NOT WS_GROUP LTEXT "[M]odular de", -1, 82, 17, 60, 8, NOT WS_GROUP LTEXT "[P]rocesos", -1, 82, 25, 60, 8, NOT WS_GROUP LTEXT "[O]rganizacionales", -1, 82, 33, 60, 8, NOT WS_GROUP LTEXT "Sistemas y Gestión Empresarial", -1, 22, 69, 104, 8, NOT WS_GROUP LTEXT "Lima - Mayo, 2008", -1, 22, 77, 63, 8, NOT WS_GROUP LTEXT "CopyRight", -1, 23, 61, 60, 8, NOT WS_GROUP CONTROL "", -1, "BorShade", BSS_HDIP | BSS_LEFT | WS_CHILD | WS_VISIBLE, 0, 55, 146, 1 PUSHBUTTON "Button", 101, 6, 8, 66, 39}8777 BITMAP "logosys.bmp"Sisgem BITMAP { '42 4D 36 13 00 00 00 00 00 00 76 00 00 00 28 00' '00 00 78 00 00 00 50 00 00 00 01 00 04 00 00 00' '00 00 C0 12 00 00 CE 0E 00 00 C4 0E 00 00 00 00' '00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80' '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80' '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF' '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF' '00 00 FF FF FF 00 FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F9' '9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF 99 9F FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF F9 99 99 FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF F9 99 99 9F FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF 99 99' '99 9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF F9 99 99 99 99 FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF 99 99 99 99 99 9F FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF 99 99 9B 99 99 99 FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF F9 99 99 BB' 'B9 99 99 9F FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF 99 99 99 BB B9 99 99 9F' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF F9 99 99 9B BB BB 99 99 99 FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F9' '99 99 BB BB BB B9 99 99 9F FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF 99 99 9B BB BB' 'BB BB 99 99 99 FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF F9 99 99 9B BB BB BB BB 99 99' '99 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF 99 99 99 BB BB BB BB BB B9 99 99 9F FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF 99 99' '9B BB BB BB BB BB BB 99 99 9F FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF F9 99 99 BB BB BB BB' 'BB BB BB B9 99 99 FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF 99 99 99 BB BB BB BB BB BB BB B9' '99 99 9F FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'F9 99 99 9B BB BB BB BB BB BB BB BB 99 99 99 FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF F9 99 99 9B' 'BB BB BB BB BB BB BB BB B9 99 99 FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF 99 99 99 BB BB BB BB BB' 'BB BB BB BB BB 99 99 9F FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF F9 99 99 9B BB BB BB BB BB BB BB BB BB' 'BB 99 99 99 FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 99' '99 99 BB BB BB BB BB BB BB BB BB BB BB B9 99 99' '9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF F9 99 99 9B BB BB' 'BB BB BB BB BB BB BB BB BB BB 99 99 99 FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF 99 99 99 BB BB BB BB BB BB BB' 'BB BB BB BB BB BB B9 99 99 9F FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF 99 99 99 BB BB BB BB BB BB BB BB BB BB BB' 'BB BB B9 99 99 9F FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF F9 99 99' '9B BB BB BB BB BB BB BB BB BB BB BB BB BB BB 99' '99 99 FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF 99 99 99 BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB B9 99 99 9F FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF F9 99 99 9B BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB 99 99 99 FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'F9 99 99 9B BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB 99 99 99 FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF 99 99 9F FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF 99 99 9F FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF 99 9F FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF F9 99 9F' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF F9 9F FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF 99 FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 9F' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF F9 9F FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF F9 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF F9 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 9F FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF F9 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF 99 99 99 BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB B9 99 99 9F FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF F9 99 99 9B BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' '99 99 99 FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'F9 99 99 BB BB BB BB BB BB BB BB 09 99 90 BB B0' '0B B0 00 BB BB 00 BB BB BB BB BB BB B9 99 99 FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF 99 99 99 BB' 'BB BB BB BB BB BB B0 99 99 99 0B B9 9B B0 99 BB' 'BB 99 BB BB BB BB BB BB B9 99 99 9F FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF F9 99 99 9B BB BB BB BB BB' 'BB BB B9 9B BB B0 00 B9 9B B0 99 BB BB 99 BB BB' 'BB BB BB BB BB 99 99 99 FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF F9 99 99 BB BB BB BB BB BB BB BB 09 90' '00 00 00 B9 9B B0 99 BB BB 99 BB BB BB BB BB BB' 'BB B9 99 99 FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 99' '99 9B BB BB BB BB BB BB BB BB B9 90 00 09 9B B9' '9B B0 99 BB BB 99 BB BB BB BB BB BB BB BB 99 99' '9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF F9 99 99 9B BB BB' 'BB BB BB BB BB BB B9 90 00 09 9B B9 9B B0 99 BB' 'BB 99 BB BB BB BB BB BB BB BB 99 99 99 FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF 99 99 99 BB BB BB BB BB BB BB' 'BB BB BB 09 99 90 BB B9 9B B0 99 99 9B 99 BB BB' 'BB BB BB BB BB BB B9 99 99 9F FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF F9 99 99 9B BB BB BB BB BB BB BB BB BB BB BB' '00 BB BB B0 0B B0 00 00 9B 99 BB BB BB BB BB BB' 'BB BB B9 99 99 99 FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF 99 99 99' '9B BB BB BB BB BB BB BB BB BB BB BB BB BB BB B9' '9B BB BB BB BB 99 BB BB BB BB BB BB BB BB BB 99' '99 99 9F FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF 99 99 99 BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB B9 9B BB BB BB' 'BB 99 BB BB BB BB BB BB BB BB BB B9 99 99 9F FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF F9 99 99 9B BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB 99 99 99 FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'F9 99 99 9B BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB 99 99 99 FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF 99 99 FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF 99 99 9F FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF F9 99 FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF 99 99' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF 99 FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF 99 9F FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF F9 FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF 99 FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 9F FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF F9 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 9F FF FF FF FF FF' 'FF FF FF FF FF FF FF FF F9 99 99 9B BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB 99 99 99 FF FF FF FF FF FF FF FF FF' 'FF FF FF FF F9 99 99 9B BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' '99 99 99 FF FF FF FF FF FF FF FF FF FF FF FF FF' '99 99 99 BB BB BB B0 09 99 00 0B BB BB BB BB BB' '00 0B BB BB BB BB 00 00 BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB B9 99 99 9F' 'FF FF FF FF FF FF FF FF FF FF FF FF 99 99 9B BB' 'BB B9 99 99 99 99 99 0B B9 90 BB 09 99 99 0B BB' 'B0 99 99 99 90 99 BB 99 99 99 99 99 99 9B 99 0B' 'BB B9 90 BB BB 99 9B BB BB 99 99 9F FF FF FF FF' 'FF FF FF FF FF FF FF F9 99 99 BB BB BB 00 0B BB' 'BB BB B9 9B B9 90 B0 00 0B B9 90 B0 99 0B BB BB' '09 99 BB 99 0B BB BB BB BB BB 99 0B BB B9 90 BB' 'BB 99 9B BB BB 99 99 99 FF FF FF FF FF FF FF FF' 'FF FF FF 99 99 99 BB BB BB BB BB BB BB BB 09 9B' 'B9 90 BB B0 99 99 9B B9 99 BB BB BB B0 99 BB 99' '0B BB BB BB BB BB 99 0B BB B9 90 BB BB 99 9B BB' 'BB B9 99 99 9F FF FF FF FF FF FF FF FF FF F9 99' '99 9B BB BB BB BB 00 99 99 99 99 0B B9 90 B0 99' '90 0B BB B9 90 BB BB 99 99 99 BB 99 00 00 00 0B' 'BB BB 99 9B BB 09 99 BB B0 99 0B BB BB BB 99 99' '99 FF FF FF FF FF FF FF FF FF F9 99 99 9B BB BB' 'BB B0 99 99 99 99 90 BB B9 90 B0 99 0B B0 00 B9' '90 BB BB 99 99 99 BB 99 99 99 99 0B BB BB 99 90' 'BB 09 99 BB B9 99 0B BB BB BB 99 99 99 FF FF FF' 'FF FF FF FF FF F9 99 99 99 BB BB BB BB 09 90 BB' 'BB BB BB BB B9 90 BB 09 99 99 0B B9 99 BB BB BB' 'BB 00 BB 99 0B BB BB BB BB BB 99 99 99 99 09 99' '99 90 BB BB BB BB B9 99 99 99 FF FF FF FF FF FF' 'FF F9 99 99 9B BB BB BB BB B9 90 BB BB BB 00 0B' 'B0 00 BB BB 00 0B BB B9 99 BB BB BB B0 99 BB 99' '0B BB BB BB BB BB 00 0B 00 0B B0 00 00 0B BB BB' 'BB BB BB 99 99 99 FF FF FF FF FF FF FF 99 99 99' 'BB BB BB BB BB BB 09 99 99 99 90 BB B9 90 BB BB' 'BB BB BB BB 09 99 99 99 99 9B BB 99 99 99 99 99' '99 9B BB BB BB BB BB BB BB BB BB BB BB BB BB B9' '99 99 9F FF FF FF FF FF F9 99 99 9B BB BB BB BB' 'BB BB BB BB 00 00 BB BB B9 90 BB BB BB BB BB BB' 'BB 00 99 90 00 BB BB 99 99 99 99 99 99 9B BB BB' 'BB BB BB BB BB BB BB BB BB BB BB B9 99 99 99 FF' 'FF FF FF FF 99 99 99 BB BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB 99 99 99 9F FF FF FF FF' '99 99 99 BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB BB' 'BB BB BB BB B9 99 99 9F FF FF FF F9 99 9F FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF 99 99 99 FF FF FF 99 99 FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF 99 99' '9F FF F9 9F FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF F9 99 FF F9 FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 'FF FF FF FF FF FF FF FF 99 FF 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99' '99 99 99 99 99 9F'}
Antonio...Codigo que no funciona
Vamos Antonio!!! Dame una "ayudita" que ya he tratado por muchos medios de averiguar porqué no logra funcionar
Antonio...Codigo que no funciona
Armando,Acabo de leer este mensaje que pusistes en Mayo! <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> Por favor, siempre que yo no responda, insistid. Porque a veces se me pasan mensajes por revisar. Gracias,Y de paso preguntarte, lo solucionastes ?
Antonio...Codigo que no funciona
[quote="Antonio Linares":2mxi21nb]Armando, Acabo de leer este mensaje que pusistes en Mayo! <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> Por favor, siempre que yo no responda, insistid. Porque a veces se me pasan mensajes por revisar. Gracias, Y de paso preguntarte, lo solucionastes ?[/quote:2mxi21nb]Si lo solucioné, no hace mucho... Esta es la explicación.Lo que sucede (salvo que sea una exageración mia) es que al cambiar el codigo del xHarbour que se utilizaba con la versión 2.4 --que en mi caso fue el referente--, se hizo imperativo:1) Cargar la libreria para manejar el BWCC32.DLL, al inicio del programa de entrada: hBorland := LoadLibrary("BWCCDLL.32");2) Luego las llamadas normales a los menu y etc., etc. y;3) Finalmente liberar el manejador: FreeLibrary("BWCC32.DLL")Hasta la versión 2.4 no era imprescindible cargar el manejador del Bwcc32.dll. En las siguientes versiones incluyendo la actual, por el cambio en el codigo del xHarbour, se tornó crítico, y por ello, el contenedor no podía registrar los objetos y daba el mensaje de "modulo desconocido" y se truncaba el programa. Estuve peleando con este bug desde la siguiente versión del FWH... y ya puedes imaginar que nivel de decepción alcancé.Saludos.Armando