topic
stringlengths
1
63
text
stringlengths
1
577k
Cannot use cGetFile32 in some secure networks
That source is for FW 16 bit. The one for FWH is getfile.c. EMG
Cannot use cGetFile32 in some secure networks
The only cGetFile function in getfile.c is cGetFile(). There is no cGetFile32() function located in getfile.c. But I guess what you are saying is that I should not use cGetFile32(). I should only use cGetFile().
Cannot use cGetFile32 in some secure networks
Exactly. EMG
Cantidad de Bases de datos abiertas MySQL
Buenos dias amigos. Actualmente tengo un app que trabaja con 2 bases de datos que esta alojadas en un servidor en la nube,,,, pregunto,. hasta cuantas bases de datos simultáneas puedo gestionar con FiveWin ?
Cantidad de Bases de datos abiertas MySQL
Willi buenas tardes Creo que el tema de cuantas base de datos puedes tener ALOJADAS en el servidor depende directamente del proveedor del hosting. Con respecto a la cantidad de bases de datos datos abiertas simultáneamente, nosotros hemos tenido hasta 10 bases de datos al tiempo y sin inconvenientes. Nos conectamos con ADO.
Cantidad de Bases de datos abiertas MySQL
Hola Willy! Yo no creo que tengas límite de conexiones abiertas. Cada conexión será un objeto distinto, intuyo que el límite te lo dará la memoria del equipo. Igualmente, si las bases de datos están en el mismo hosting, y tienes un usuario que tenga permiso a ver todas las bases de datos, podrías manejarlo con una única conexion, y hacer referencia a la base de datos en cada consulta. Eso depende de la frecuencia que uses la segunda base de datos si te será util esta forma que te comento. Me explico mejor con un ejemplo Vos conectas a una base (Supongamos que el usuario willy tiene permisos para las dos bases de datos) [code=fw:2sczy2an]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oServer := Connect<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'mi_ip'</span>, <span style="color: #ff0000;">'willy'</span>, <span style="color: #ff0000;">'1234'</span>, <span style="color: #000000;">3306</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">'base1'</span><span style="color: #000000;">&#41;</span> &nbsp; <br />&nbsp;</div>[/code:2sczy2an] Una consulta a la base1 para la tabla customers sería [code=fw:2sczy2an]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oQry := oServer:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SELECT * FROM customers"</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2sczy2an] Y una para la base2 sería [code=fw:2sczy2an]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oQry := oServer:<span style="color: #000000;">Query</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SELECT * FROM base2.customers"</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2sczy2an] Espero que te de una pista al menos
Cantidad de Bases de datos abiertas MySQL
Gracias por vuestro apoyo....
Cantidad de Campos de un DBF
Hola a todos: Requiero de una ayuda, estoy medio olvidado de los DBF ( creo que son mis años <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> ), Existe alguna funcion que me informe la cantidad de campos que tiene un DBF ( Ojo no los registros ), sino la cantidad de columnas que tiene ese DBF, lo requiero pasar poder rescatar los datos de una consulta que me devuelve un DBF, pero que su cantidad de campos es variable. Saludos y gracias, Carito
Cantidad de Campos de un DBF
Me respondo, una forma que encontre es: use customer aCols := dbstruct() ? LEN( aCols ) // # de columnas del DBF Si algo mejor, me cuentan por favor.
Cantidad de Campos de un DBF
[code=fw:3mb3bres]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// C:\IMPSTRUC\IMPSTRUC.PRG</span><br /><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 />&nbsp; &nbsp;Imp_Estruc<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CUSTOMER.DBF"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Imp_Estruc<span style="color: #000000;">&#40;</span> cBase <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oPrn, oFont, I, nLin, nPag, nLinMax, nItens, nCampo<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aEstruct := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> cBase = <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Base de Datos no Ubicado en el Sitio"</span>, <span style="color: #ff0000;">"Atencion"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;USE <span style="color: #000000;">&#40;</span> cBase <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;aEstruct := dbStruct<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;USE<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">PRINT</span> oPrn <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Estructura del .DBF"</span> PREVIEW <span style="color: #0000ff;">MODAL</span><br /><br />&nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">SetLandscape</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> oPrn:<span style="color: #000000;">hDC</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; nLin &nbsp; &nbsp;:= <span style="color: #000000;">6</span><br />&nbsp; &nbsp; &nbsp; nPag &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nLinMax := <span style="color: #000000;">27</span><br />&nbsp; &nbsp; &nbsp; nItens &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nCampo &nbsp;:= <span style="color: #000000;">1</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">PAGE</span><br /><br />&nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">CmSay</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nLin - <span style="color: #000000;">2.5</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">"ESTRUCTURA DE LA BASE DE DATOS, "</span> + &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UPPER<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cBase <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">CmSay</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nLin - .<span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1.5</span>, Replicate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"="</span>, <span style="color: #000000;">32</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">CmSay</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nLin - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1.5</span>, <span style="color: #ff0000;">"Nº Campo Tipo Long. Dec. "</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> I = <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">&#40;</span> aEstruct <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SYSREFRESH<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oPrn:<span style="color: #000000;">CmSay</span><span style="color: #000000;">&#40;</span> nLin, <span style="color: #000000;">1</span>, Str<span style="color: #000000;">&#40;</span> nCampo <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" "</span> + aEstruct<span style="color: #000000;">&#91;</span> i, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oPrn:<span style="color: #000000;">CmSay</span><span style="color: #000000;">&#40;</span> nLin, <span style="color: #000000;">4.4</span>, aEstruct<span style="color: #000000;">&#91;</span> i, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oPrn:<span style="color: #000000;">CmSay</span><span style="color: #000000;">&#40;</span> nLin, <span style="color: #000000;">5</span>, Str<span style="color: #000000;">&#40;</span> aEstruct<span style="color: #000000;">&#91;</span> i, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" "</span> + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Str<span style="color: #000000;">&#40;</span> aEstruct<span style="color: #000000;">&#91;</span> i, <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLin += <span style="color: #000000;">0.7</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCampo++<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span> I<br /><br />&nbsp; &nbsp; &nbsp; oPrn:<span style="color: #000000;">CmSay</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nLin - .<span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1.5</span>, Replicate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"="</span>, <span style="color: #000000;">32</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ENDPAGE</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDPRINT</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// FIN / END</span><br />&nbsp;</div>[/code:3mb3bres] Regards, saludos.
Cantidad de Campos de un DBF
Gracias Karinha.
Cantidad de Campos de un DBF
(cAlias)->( FCount() )
Cantidad de Campos de un DBF
Hola Carlos, super.... esta funcion era la mas especifica y correcta. muchas gracias.
Cantidad de Copias a Imprimir en Preview de FWH
Saludos, una consulta. En el prev32.dll que viene con FWH 2.7 solo tenemos las opciones de imprimir todo, solo pagina actual o un rango de paginas, existe algun preview/clase que solicite mas datos, como cantidad de copias, pares, impares, Paginas especificas, etc. Gracias por contestar
Cantidad de Registros
Buenos Día Foro. una pregunta al solo titulo informativo. las bases de datos del tipo xBase tiene una capacidad de mil millones de registros, la pregunta es alguien sabe cual es la capacidad de registros de una tabla del tipo base.mdb . Estoy buscando esa información y no la encuentro. desde ya muchas gracias.
Cantidad de Registros
Saludos ! Los archivos .mdb, son base de datos microsoft acces, en ellas puedes encontrar, reportes, consultas, tablas, formularios, macros, etc. y su capacidad depende del la memoria ram que disponga el pc donde manipules la BD
Cantidad de Registros
gracias, si sabia que en la base de datos hay consultas, forms etc. mi duda es que tengo un sistema con bases de datos bien cargadas, y al dueño de la empresa le dicen que las pase por seguridad a MDB así que como nadie me sabe decir cuan es la capacidad de registros de cada tabla , tengo mis dudas. ya que lo que he leído habla de la capacidad de memoria. igual muchas gracias.
Cantidad de Registros
Juan carlos La capacidad de registros de los archivos en Clipper fueron de mil millones hasta la versión 5.2 Para la versión 5.3 se amplió a 4 mil millones. En Harbour se supone que supera los 4 mil millones... ¿alguien ha podido llegar a manejar en sus aplicaciones esas cifras de registros? A lo largo de mi experiencia no he tenido noticias que hayan llegado a semejante cantidad. es posible que si, pero no he tenido noticia alguna. así que, tengo la impresión que a tu cliente le están "dorando la píldora" para encaminarlo hacia los productos de Microsoft. Saludos Armando
Cantidad de Registros
mil millones es mucho tengo tablas dbf en 5.3 de hasta 5millones de registros y es una locura con el espacio en disco y DBF y CDX, solo de pensar en generar indices es una locura. ahora migrando a MySql se supone que el limite es el espacio en disco saludos, Mauricio
Cantidad de Registros
Mauricio En un equipo viejito con Pentium IV y un disco de 120 GB un cliente mio manejaba tablas de transacciones que llegaron hasta 17 millones, eso bajo clipper, y salvo cuando habia que rehacer los indices, no se sentia lentituda alguna. Cuando pase la aplicación a xHarbour la velocidad se aceleró a casi 2.4 veces. Como digo, muchas veces los requerimientos de los clientes son "inducidos" por tanto galifardo que funge de "conocedor" o gurú. <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> Saludos Armando
Cantidad de Registros
Bueno, Yo tengo una aplicación atacando a MySql y una sola tabla tiene 69 millones de registros y contando... con datos almacenados de 7 años.
Cantidad de Registros
Armando, exactamente, el problema es cuando toca generar indices por fallas en la energia o X, ahi si a tomar varias tazas de cafe en lo que termina. Saludos, Mauricio
Cantidad de Registros
Pablo Si es cierto que la capacidad de mysql es tremenda. El caso es que a muchos de los cliperos no se les hace fácil afrontar el nuevo estilo de programar para lograr los efectos de una gran consulta. Quien se ha entrenado en, por ejemplo, lenguajes como Java o PHP se adecuán más ráido que los cliperos "clásicos". Saludos Armando
Cantidad de Registros
Armando Es cierto que trabajar con sentencias SQL se hace inicialmente complicado para los que siempre hemos usado DBFs, pero de un tiempo a esta parte la migracion para trabajar en una Base de Datos se hace cada vez mas imperiosa, por diferentes motivos, para eso hay librerias (pago) como SQLLIB y SQLRDD que "encapsulan" las sentencias SQL en comandos tradicionales Clipper/(x)Harbour, eso hace que la migracion sea MUY rapida, claro que poco a poco hay que ir migrando a SQL pues cosas como un "Do Whil ... End Do" se solucionan con un simple "UPDATE" y como en la Base de Datos uno no se preocupa de la apertura en modo exclusivo o publico (eso lo maneja el motor) el UPDATE (replace en DBF) de todas las lineas lo hace de un solo golpe, sin tener que pasar a preguntar linea por linea si puede bloquear el registro como en los DBFs, a parte de que no hay que sacar a nadie para una baja fisica y los indices solo se crean cuando se crea la tabla. En fin me fui, lo que quiero decir que dejar DBFs por Bases de Datos (como MySQL) no es un drama, es mas sencillo de lo que se imagina, por lo menos con las librerias arriba mencionadas, hay otras opciones FREE como TDolphin, ADO que viene con soporte en FWH, Etc., pero esas nunca las he usado asi que no puedo opinar
Cantidad de Registros
Enrrique, Yo hice la transicion en el 2002 o 2003 con la eagle1 de manu Y es la que he usado, hice una aplicacion en linux puro y duro usando la tmysql que viene con la xharbour con modificaciones mias. Y ahora estoy usando la tDolphin, una clase extremadamente genial. Ahora me estoy embarcando un poco mas alla, pues estoy en los procesos de hacer una aplicacion para android y webservices que ataque a la MySql.
Cantidad de Registros
Juan Carlos [quote="juan carlos bellucci":auk64yz0]...le dicen que las pase por seguridad a MDB...[/quote:auk64yz0] Debo concidir con el compañero que dice que a tu cliente le están vendiendo basura. COmparando las tablas mdb y dbf, las segundas son MUCHO mas seguras por algo muy simple: tienen una estructura de registro fijo, con texto plano, y facilmente recuperables y accesibles, y las estructuras complejas como los índices están en archivos separados que se pueden regenerar en cualquier momento sin riesgo de pérdidas de información. Por el contrario, en el caso de las mdb, los datos están paginados (como en los índices) y todas las tablas índices y otros objetos extraños están dentro del mismo fichero. Que Dios nos proteja de tener que recuperar informacion de tales engendros. Y si la seguridad tiene que ser muy alta, y quieres ciertas garantías de seguridad, se me ocurren tres soluciones cliente-servidor basadas en DBF: Advantage Database Server, Apollo o la libre específica para [x]Harbour LetoDB. MDB es una estructura muy compleja dentro de un único fichero, ni por asomo podría llegar a ser más segura que un sistema donde cada entidad tiene su propio archivo. Espero que esto te resulte útil para poder aclarar el concepto a tu cliente. Un saludo
Cantidad de Registros
Gracias Armando y gracias a todos por su tiempo. la cosa es así las bases de datos del tipo dbf puede ser abiertas con herramientas externas algo que no ocurre con las mdb si tienen password ya que en un sistemas de cuentas de clientes algún empleado no muy fiel podría alterar sus datos. Mi pregunta era solo si una tabla podría almacenar la misma cantidad de registros que una dbf. yo me manejo con ado no uso access ya que estoy programando con fivewin y xharbour , de hecho ya tengo un sistema asi totalmente y aprovecho a decirles que si alguien desea alguna cosa desde ya estoy a sus gratas ordenes. Consulte a varios especialistas del tema y algunos me dijeron que una tabla no puede pasar los 64kbts otros que no hay información es por eso que como buen clippero y ahora adorador de Fivetech pregunte en el foro. Señeres nuevamente gracias y veremos tratare de llenar una tabla para medir su capacidad de registros. Tabla abierta como data1 obvio For I := 1 to 1000.000.0000 Data1:AddNew() Data1:Fields("Numero "):Value := I Data1:UpDate() Next I Veremos cuanto registros entran mientras me tomo un cafe ja ja que tengan buen dia .
Cantidad de Registros
bellucci, Los limites de una .dbf dependen, ademas del nº de registros, de la cantidad de campos. Es decir, el nº de campos va a condicionar el nº de registros posibles. Yo tengo .dbfs con 20 millones de registros, usando xHarbour. Es muy probable que con Harbour, con sus numerosisimas mejoras y extensiones, los limites y prestaciones de las .dbfs hayan aumentado con respecto al olvidado xHarbour. Saludos
Cantidad de Registros
Juan Carlos, en Harbour las dbfs se pueden encriptar, por ejemplo lo uso para registrar el acceso a un programa: [code=fw:1opv2tp0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   Use <span style="color: #ff0000;">'Acceso.dbf'</span> Shared <span style="color: #00C800;">New</span><br />   dbInfo<span style="color: #000000;">&#40;</span> DBI_PASSWORD, <span style="color: #ff0000;">'palabraclave'</span> <span style="color: #000000;">&#41;</span><br />   NetAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   Field->Usuario:= NetName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   Field->Fecha  := Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   Field->Entrada:= <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br />   Field->Empresa:= AllTrim<span style="color: #000000;">&#40;</span> cMarcaLog <span style="color: #000000;">&#41;</span><br />   dBCommit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   dBUnLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   Close Acceso<br /><br /> </div>[/code:1opv2tp0] Adios problemas con empleador deshonestos, jeje. Por cierto, en <!-- m --><a class="postlink" href="http://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems">http://en.wikipedia.org/wiki/Comparison ... nt_systems</a><!-- m --> dice que el tamaño máximo de tabla es 2Gb, y 255 columnas. Acá tenemos algunas tablas especiales para hacer unas interfaces con 300 o 400 campos y sin problemas.
Cantidad de archivos .RC
Saludos Cuantos archivos .RC puedo incluir en el .mak de mi aplicacion y si es posible, alguien me puede mostrar algun ejemplo? Gracias de antemano
Cantidad de archivos .RC
Compuin If you are worried about too many .rc's you can use a simple CMD Dos COPY command and combine them all together into a single .RC [code=fw:29ri89lj]<div class="fw" id="{CB}" style="font-family: monospace;"><br />COPY *.RC MyRC32.RC<br /> </div>[/code:29ri89lj] Then all you have to do is load the one file MyRC32.RC in your link list .. Rc files are text only and you can combine as many of them together as you like into a single monolithic RC file Rick Lipkin
Cantidad de archivos .RC
[quote="Rick Lipkin":2uav76vi]Compuin If you are worried about too many .rc's you can use a simple CMD Dos COPY command and combine them all together into a single .RC [code=fw:2uav76vi]<div class="fw" id="{CB}" style="font-family: monospace;"><br />COPY *.RC MyRC32.RC<br /> </div>[/code:2uav76vi] Then all you have to do is load the one file MyRC32.RC in your link list .. Rc files are text only and you can combine as many of them together as you like into a single monolithic RC file Rick Lipkin[/quote:2uav76vi] That's great! Thanks a lot Mr. Rick
Cantidad de objetos?
Estimados tengo este archivo .bc que si le agrego un nuevo objeto me deja de funcionar la clase twbrowse, me arroja que no existe el metodo :Set3DStyle(), y si le saco el objeto me funciona, hay alguna forma de decirle que asume mas objetos, recuerdo que en versiones mas antigua de xharbour habia una libreria llamada lib640 o algo parecido [code:1x4bx7s0]c&#58;\borland\bcc55\lib\c0w32&#46;obj + Wcta&#46;Obj Datetime&#46;obj + Clientes&#46;Obj General&#46;Obj Red&#46;Obj Ayuda&#46;obj Indexar&#46;Obj BaseDato&#46;Obj + txtprev&#46;obj tDosPrn&#46;obj + txls&#46;obj Proveedo&#46;Obj Articu&#46;obj Salidas&#46;Obj SaliBole&#46;Obj Maestros&#46;Obj + Listado&#46;Obj FactGuia&#46;Obj RutaBan&#46;Obj + Monetari&#46;obj + sTrabajo&#46;obj + oCompra&#46;Obj EntraFac&#46;obj EntraFa2&#46;Obj SSBodega&#46;Obj SalidaBo&#46;Obj + LibroCmp&#46;Obj LibroVta&#46;Obj CartProd&#46;Obj CartCli&#46;obj VtaDepto&#46;Obj Cotiza&#46;Obj NCrCli&#46;Obj OtMant&#46;Obj + Oleauto&#46;obj ttmpicke&#46;OBJ tdtpicke&#46;OBJ timepick&#46;OBJ datepick&#46;OBJ + cartpeso&#46;obj + cajadia&#46;obj Centrali&#46;Obj IngreOt&#46;Obj Acceso&#46;Obj tDbfSave&#46;obj Fpago&#46;Obj SaldoCli&#46;obj, + wcta&#46;exe, + wcta&#46;map, + TWBRW32 + HbTDbf + c&#58;\Fwh\lib\FiveHX&#46;LIB + c&#58;\Fwh\lib\FiveHc&#46;LIB + Funlib32 + FileXls + vBarH + vBoxH + SBrowseH + TBtnGet32 + c&#58;\harbour\lib\rtl&#46;lib + c&#58;\harbour\lib\vm&#46;lib + c&#58;\harbour\lib\gtGui&#46;lib + c&#58;\harbour\lib\lang&#46;lib + c&#58;\harbour\lib\macro&#46;lib + c&#58;\harbour\lib\rdd&#46;lib + c&#58;\harbour\lib\dbfcdx&#46;lib+ c&#58;\harbour\lib\dbffpt&#46;lib+ c&#58;\harbour\lib\hbsix&#46;lib + c&#58;\harbour\lib\common&#46;lib+ c&#58;\harbour\lib\pp&#46;lib + c&#58;\harbour\lib\rddads&#46;lib+ c&#58;\harbour\lib\Ace32&#46;lib + c&#58;\borland\bcc55\lib\cw32&#46;lib + c&#58;\borland\bcc55\lib\import32&#46;lib,, + recurso\wcta&#46;res recurso\toolbar1&#46;res Classes\dt\ejemplo&#46;res [/code:1x4bx7s0][quote][/quote]
Cantidad de objetos?
Patricio, Si te refieres a archivos OBJ, no tiene porque existir ninguna limitación. Te recomiendo que te actualices a la versión más reciente de xharbour (<!-- w --><a class="postlink" href="http://www.fivetechsoft.com/files/xharbour.exe">www.fivetechsoft.com/files/xharbour.exe</a><!-- w -->) ya que hace poco se ha corregido un error que puede estar relacionado con lo que comentas
Cantidad de objetos?
Recompile todo fivehx + todas las librerias de terceros con la nueva xharbour .99.71 pero igual no funciona incluyendo un objeto mas A lo mejor el problema es el rmake de clipper 5.3 que utilizo ahora quiero cambiarme a hbmake que se encuantra en c:\xharbour\bin\hbmake.exe Mi peticion es si alguien tiene un pequeño ejemplo de unos ( 2 o 3 obj) de como utilizar esta herramienta desde ya muchas gracias
Cantidad de objetos?
Patricio, Nuestro consejo es que uses el make de Borland ó el de Microsoft Tienes ejemplos de su uso en FWH\makes
Cantidad de objetos?
Gracias Antonio Ahora funciona perfecto con mas objetos(obj) <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->, en conclusion era el rmake de clipper 5.3, era lo único que me quedaba de recuerdo...
Cantidad de registros afectados en un UPDATE
Estimados, buenas tardes Alguno de ustedes sabe como obtener la cantidad de registros afectados por una sentencia UPDATE en MySQL, la funcion que parece devolver esto es mysql_affected_rows() pero no consigo que me devuelva el dato ... algun ejemplo. Gracias
Cantidad de registros afectados en un UPDATE
Buenas noches, podrías usar el metodo execute del objeto coneccion, la documentacion indica lo siguiente: METHOD Execute( cSqlStatement, [params], [lShowError] ) --> uResult (Can also use oCn:SqlQuery(...) ) uResult can be a) nil if there is no result or if error occured. In case of error, oCn:nError and oCn:cError provide teh error information Optionally setting lShowError displays ther error or result of sql statement, b) Numeric: In case of insert, update, etc indicating the affected rows c) If the result is a result-set, it is returned as Multi-Dim array Saludos
Cantidad de registros de una base ACCESS
Amigos, Cómo se obtiene? he intentado asi: [code=fw:2q8w1y8q]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRSet:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />nRec:=oRSet:<span style="color: #000000;">Recno</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// no funciona</span><br /><br />nRec:=oRSet:<span style="color: #000000;">RecCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//tampoco</span><br />&nbsp;</div>[/code:2q8w1y8q] Gracias por la ayuda Saludos, Adhemar
Cantidad de registros de una base ACCESS
Hola , Y haciendo la consulta directamente " select count(*) from ..... " Atte., Lautaro Moreira
Cantidad de registros de una base ACCESS
Gracias Lautaro Yo la abro asi: [code=fw:3w2ux1z7]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;sSQLQuery := <span style="color: #ff0000;">"SELECT * FROM CHECKINOUT"</span><br />&nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; oRSet:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> sSQLQuery, oConnection <span style="color: #000000;">&#41;</span><br />&nbsp; CATCH oError<br />&nbsp; &nbsp;MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"No se ha podido crear el RECORDSET CHECKINOUT "</span>+ oError:<span style="color: #000000;">Description</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span><br />&nbsp; END<br />&nbsp;</div>[/code:3w2ux1z7] Donde lo coloco para que se almacene en una variable. Saludos, Adhemar
Cantidad de registros de una base ACCESS
Hola, Deberia ser asi : [code=fw:2ttkshsa]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   ....<br />   nRegistros:=oRset:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span><br />  .....<br /> </div>[/code:2ttkshsa] Saludos, Lautaro Moreira
Cantidad de registros de una base ACCESS
Lautaro no funciona Saludos, Adhemar
Cantidad de registros de una base ACCESS
Hola, Perdon, estaba viendo mi codigo que usa algunas clases para enmascarar el recordset, puedes usar en el recordset el data :recordcount [code=fw:2wrx9tyr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp;oRSet:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #B900B9;">/*nRec:=oRSet:Recno() // no funciona<br /><br />nRec:=oRSet:RecCount() &nbsp;//tampoco<br />&nbsp;*/</span><br /><br />nRec := oRSet:<span style="color: #000000;">recordcount</span><br /><br /><br />&nbsp;</div>[/code:2wrx9tyr] Atte., Lautaro Moreira
Cantidad de registros de una base ACCESS
Gracias Lautaro, Funcionó perfecto. Se puede mandar el puntero a un registro con una condición asi como el LOCATE. Saludos, Adhemar
Cantidad de registros de una tabla filtrada? (Solucionado)
Hola a todos... Necesito saber cuantos registros resultan de abrir una tabla filtrada y no se como hacerlo sin tener que contar a mano recorriendo la tabla. [code=fw:sfjcyyqs]<div class="fw" id="{CB}" style="font-family: monospace;"><br />USE VENTAS <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span>cAliasVen<span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span><br />AdsEnableEncryption<span style="color: #000000;">&#40;</span>cKey<span style="color: #000000;">&#41;</span><br />DATABASE oDbfVen<br />oDbfVen:<span style="color: #000000;">bEoF</span>:=<span style="color: #00C800;">nil</span><br />oDbfVen:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span><br />DBSETFILTER<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#40;</span>cAliasVen<span style="color: #000000;">&#41;</span>->FECHA>=vFec1 .AND. <span style="color: #000000;">&#40;</span>cAliasVen<span style="color: #000000;">&#41;</span>->FECHA<=vFec2 <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />DBGOTOP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oDbfVen:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />nTotal1:=<span style="color: #000000;">&#40;</span>cAliasVen<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>OrdKeyCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />nTotal2:=<span style="color: #000000;">&#40;</span>cAliasVen<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>LastRec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />nTotal3:=<span style="color: #000000;">&#40;</span>cAliasVen<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nTotal1<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nTotal2<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nTotal3<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:sfjcyyqs] Todos los resultados de esas tres opciones me regresan la cantidad de registros totales de la tabla. Alguien sabe si existe alguna función que me regrese ese valor numérico? Desde ya muchas gracias. Saludos, Esteban.
Cantidad de registros de una tabla filtrada? (Solucionado)
Hola, viendo que utilizas ADS, revisa la doc de ADSKeyCount y ADSKeyNo, por ejemplo ADSKeyCount(NIL,NIL,3 ) ADSKeyNo(NIL,NIL,3 ) saludos Marcelo
Cantidad de registros de una tabla filtrada? (Solucionado)
Hola... Ninguna de las dos funciones me regresa el valor que necesito. De todas formas, muchas gracias.
Cantidad de registros de una tabla filtrada? (Solucionado)
Hola, disculpa que no sea especifico, aqui hay algo [url:1outf3tv]http&#58;//www&#46;harbour-project&#46;org/doc/adskeycount&#46;htm[/url:1outf3tv] pero debes complementar con la doc de ADS saludos Marcelo
Cantidad de registros de una tabla filtrada? (Solucionado)
Listo amigo, ahora si funciona correctamente. Saludos, Esteban.
Cantidad de registros de una tabla filtrada? (Solucionado)
Como fue la solucion ?
Cantidad de registros de una tabla filtrada? (Solucionado)
Holaigo... Así: [code=fw:1248pum6]<div class="fw" id="{CB}" style="font-family: monospace;">nTotal:=<span style="color: #000000;">&#40;</span>cAliasVen<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>AdsKeyCount<span style="color: #000000;">&#40;</span>,,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:1248pum6] Saludos, Esteban.
Cantidad de registros de una tabla filtrada? (Solucionado)
Gracias Esteban.
Cantidad de veces que se llama a un metodo o funcion
Existe la posibilidad de saber, en determinada clase, cuantas veces se llamó a determinado metodo? (sin poner un contador en cada metodo...) Y cuantas veces se llamó a determinada funcion? Gracias
Cantidad de veces que se llama a un metodo o funcion
Me contesto yo mismo, lo encontre en el blog de Walter Negro. <!-- m --><a class="postlink" href="http://cosadenegro.blogspot.com/2005_08_01_archive.html">http://cosadenegro.blogspot.com/2005_08_01_archive.html</a><!-- m --> Saludos
Cantidad variable de parámetros
Cuando necesiteis llamar a una función y proporcionarle un número variable de parámetros podeis usar: function MyFunc( ... ) y entonces llamar a hb_aparams() para obtener un array con todos ellos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Cantidad variable de parámetros
Muchas gracias por la información, Antonio
Cantidad variable de parámetros
Antonio, En general no es imprescindible indicar ni siquiera que parámetros pasas, a menos que quieras ponerle un nombre <!-- s;) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";)" title="Wink" /><!-- s;) --> , pero si vas a usar hb_aparams, o HB_PValue(), ni siquiera hace falta indicarlo con '...' . HB_PValue(i) devuelve el parámetro i-ésimo, y sabremos cuantos parámetros hay con PCount(). Por ejemplo: ? Expand( 'Select * from clientes where id = $1', 22 ) -> Select * from clientes where id = 22 FUNCTION Expand( cQuery ) // Aunque escribiendo (cQuery, ... ) hace más obvio que tiene parámetros variables LOCAL i i:= PCount() WHILE i > 1 cQuery:= StrTran( cQuery, '$'+(LTrim(Str(i-1))), ClipValue2SQL( HB_PValue(i) ) ) i-- ENDDO RETURN cQuery Se pueden hacer cosas bastante majas...
Cantidad variable de parámetros
Carlos, gracias por la información <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Dudo que Przemek pasará por alto algo asi. Tal vez haya otro uso para "..." que desconocemos. Si os parece importante lo podemos preguntar en la lista de desarrollo de Harbour
Cantidad variable de parámetros
Solo se me ocurre una cuestion de orden y elegancia, una forma de hacer explícito el hecho de que vas a usar parámetros. Tal vez el pcode generado podría llegar a mostrar alguna diferencia, no se... Pero en lo personal lo he usado bastante, como en el ejemplo, y como podrás adivinar, con uso intensivo (es en las querys) y va fenomenal. Y para añadir más cosas a la colección de cositas guapas, por si alguno todavía no lo conoce, van los siguientes #pragmas: [code=fw:3omm8r68]<div class="fw" id="{CB}" style="font-family: monospace;"><br />#xcommand <span style="color: #0000ff;">TEXT</span> INTO <v> => <span style="color: #00D7D7;">#pragma</span> __cstream|<v>:=%s<br />#xcommand <span style="color: #0000ff;">TEXT</span> INTO <v> ADDITIVE => <span style="color: #00D7D7;">#pragma</span> __cstream|<v>+=%s<br /> </div>[/code:3omm8r68] Esto nos permite escribir texto literal, que incluya incluso saltos de línea, como en: [code=fw:3omm8r68]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #0000ff;">TEXT</span> INTO cTexto<br /><br />      CREATE TABLE <span style="color: #00C800;">IF</span> NOT <span style="color: #0000ff;">EXISTS</span> `validalta` <span style="color: #000000;">&#40;</span><br />        `<span style="color: #0000ff;">id</span>`         int<span style="color: #000000;">&#40;</span><span style="color: #000000;">11</span><span style="color: #000000;">&#41;</span> NOT <span style="color: #00C800;">NULL</span> AUTO_INCREMENT,<br />        `fechanaci`  date,<br />        `nif`        varchar<span style="color: #000000;">&#40;</span><span style="color: #000000;">9</span><span style="color: #000000;">&#41;</span>  <span style="color: #00C800;">DEFAULT</span> <span style="color: #00C800;">NULL</span>,<br />        `<span style="color: #0000ff;">mail</span>`       varchar<span style="color: #000000;">&#40;</span><span style="color: #000000;">50</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">DEFAULT</span> <span style="color: #00C800;">NULL</span>,<br />        `cuenta`     varchar<span style="color: #000000;">&#40;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">DEFAULT</span> <span style="color: #00C800;">NULL</span>,<br />        PRIMARY KEY <span style="color: #000000;">&#40;</span>`<span style="color: #0000ff;">id</span>`<span style="color: #000000;">&#41;</span>,<br />        UNIQUE KEY `NIF` <span style="color: #000000;">&#40;</span>`nif`<span style="color: #000000;">&#41;</span><br />      <span style="color: #000000;">&#41;</span>;<br />   ENDTEXT<br /><br />   oServer:<span style="color: #000000;">Command</span><span style="color: #000000;">&#40;</span> cTexto <span style="color: #000000;">&#41;</span><br /> </div>[/code:3omm8r68] o bien, XML combinado con la funcioncita de Expand [code=fw:3omm8r68]<div class="fw" id="{CB}" style="font-family: monospace;"><br />               <span style="color: #0000ff;">TEXT</span> INTO cTransac<br />                  <tns:<span style="color: #000000;">importAbsenceFiles</span> xmlns:<span style="color: #000000;">tns</span>=<span style="color: #ff0000;">"http://echange.service.open.server.com"</span>><br />                     <tns:<span style="color: #000000;">absenceFilesToImport</span>><br />                        <tns:<span style="color: #000000;">absenceFile</span>><br />                           <tns:<span style="color: #000000;">absenceTypeAbbreviation</span>>VACAC</tns:<span style="color: #000000;">absenceTypeAbbreviation</span>><br />                           <tns:<span style="color: #000000;">employeeIdentificationNumber</span>>$<span style="color: #000000;">1</span></tns:<span style="color: #000000;">employeeIdentificationNumber</span>><br />                           <tns:<span style="color: #000000;">startDate</span>>$<span style="color: #000000;">2</span></tns:<span style="color: #000000;">startDate</span>><br />                           <tns:<span style="color: #000000;">endDate</span>>$<span style="color: #000000;">3</span></tns:<span style="color: #000000;">endDate</span>><br />                        </tns:<span style="color: #000000;">absenceFile</span>><br />                     </tns:<span style="color: #000000;">absenceFilesToImport</span>><br />                  </tns:<span style="color: #000000;">importAbsenceFiles</span>><br />               ENDTEXT<br /><br />               cTransac:= Expand<span style="color: #000000;">&#40;</span> cTransac, oQuery:<span style="color: #000000;">dni</span>, oQuery:<span style="color: #000000;">FechaInicio</span>, oQuery:<span style="color: #000000;">FechaFin</span> <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:3omm8r68] Como te decía, entre SQL, XML y web... lo uso de forma intensiva, y ayuda a hacer la programación muchísimo más clara.
Cantidad variable de parámetros
Carlos, Muy bueno <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Muchas gracias por compartirlo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Cantidad variable de parámetros
Carlos --> Bravo, bonissimo para mi, no lo conocia.... <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> (Copy/paste cagando leches....) Gracias !!!
Cantidad variable de parámetros
Cada día de aprende algo nuevo! Gracias tocayo, muy bueno, me serán de bastante utilidad tus ejemplos. Saludos. Carlos.
Cantidad variable de parámetros
Carlos, muchísimas gracias por compartir la información y los ejemplos. Saludos
Cantidad variable de parámetros
Carlos Gracias, es muy bueno
Cantidad variable de parámetros
Uau, uau, uau .. esos #pragma son la repera !! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Cantidad variable de parámetros
Carlos, muy, pero que muy bueno Fácil de leer en el código fuente, facil de copiar y pegar para probar la consulta sql. Increíble.
Cantidad variable de parámetros
Si os parece incluimos esos pragmas en FiveWin.ch <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Controlando que sea Harbour, porque imagino que no funcionan en xHarbour
Cantidad variable de parámetros
[code=fw:2u2d8oov]<div class="fw" id="{CB}" style="font-family: monospace;">#ifndef __XHARBOUR__<br />&nbsp; &nbsp;#xcommand <span style="color: #0000ff;">TEXT</span> INTO <v> => <span style="color: #00D7D7;">#pragma</span> __cstream|<v>:=%s<br />&nbsp; &nbsp;#xcommand <span style="color: #0000ff;">TEXT</span> INTO <v> ADDITIVE => <span style="color: #00D7D7;">#pragma</span> __cstream|<v>+=%s<br />#endif<br />&nbsp;</div>[/code:2u2d8oov]
Cantidad variable de parámetros
Antonio, no se como lo maneja xharbour internamente, pero segun la ayuda [quote:olubiqw0]Syntax TEXT [TO PRINTER] [TO FILE <fileName>] <text> ENDTEXT or TEXT INTO <varName> <text> ENDTEXT Arguments TO PRINTER The text is additionally output to the printer. TO FILE <fileName> The text is additionally output to the file <fileName>. It can be specified as a literal file name or as a character expression enclosed in parentheses. The default extension is TXT. INTO <varName> This is the symbolic name of the variable to assign <text> to. <text> This is a literal text block enclosed in TEXT and ENDTEXT. The text is output to the screen and displayed exactly as written in the PRG source code file. Description The TEXT...ENDTEXT command outputs a block of literal text to the console. Output can be directed additionally to a printer or a file. When SET CONSOLE is set to OFF, the screen output is suppressed. ALternatively, the text is assigned as character string to the variable <varName> when the INTO option is used. [/quote:olubiqw0]
Cantidad variable de parámetros
yo lo uso igual con instrucciones sql grandes, para mayor claridad, la leche seria si tuviera la funcionalidad que tiene en vfp, la cual es capaz de evaluar variables y poner en su lugar el valor. por ejemplo TEXT INTO cSql SELECT CODIGO, NOMBRE, FECHA FROM TABLA WHERE FECHA=<<DATE()>> ENDTEXT salu2 carlos vargas [quote:idff6bhp]Sends lines of text specified by TextLines to the current output device or memory variable. Visual FoxPro sends lines of text to the current output device until it encounters an ENDTEXT statement or until the program ends. The current output device can include the main Visual FoxPro window, a user-defined window, a printer, a text file, or a low-level file. TEXT [TO VarName [ADDITIVE] [TEXTMERGE] [NOSHOW] [FLAGS nValue] [PRETEXT eExpression]] TextLines ENDTEXT Parameters TextLines Specifies text to send to the current output device. TextLines can consist of text, memory variables, array elements, expressions, functions, or any combination of these. NoteNote Visual FoxPro evaluates expressions, functions, memory variables, and array elements specified with TextLines only if you set SET TEXTMERGE to ON and enclose them with the delimiters specified by SET TEXTMERGE DELIMITERS. If SET TEXTMERGE is OFF, Visual FoxPro outputs expressions, functions, memory variables, and array elements as string literals along with their delimiters. For example, Visual FoxPro evaluates and outputs the current date when you specify the DATE( ) function as TextLines only if SET TEXTMERGE is ON, and TextLines contains the function and the appropriate delimiters, such as <<DATE( )>>. If SET TEXTMERGE is OFF, Visual FoxPro outputs <<DATE( )>> as a string literal. If you place comments within TEXT...ENDTEXT or after the single backslash character (\) or double backslash characters (\\), Visual FoxPro outputs the comments. TO VarName Specifies the memory variable name to use for passing the contents of the TEXT...ENDTEXT. This variable can already exist. If the variable has not yet been declared, Visual FoxPro automatically creates it as a private variable. The TO clause operates regardless of how SET TEXTMERGE is set. If SET TEXTMERGE is set to a file, and the TO statement is included, Visual FoxPro outputs both the file and variable. ADDITIVE Determines whether the contents of the TO variable are overwritten or added to existing contents. NoteNote If the contents of TO VarName is not a string, Visual FoxPro always overwrites the contents in VarName. TEXTMERGE Enables evaluation of contents surrounded by delimiters without setting SET TEXTMERGE to ON. NOSHOW Disables display of the text merge to the screen. FLAGS nValue Specifies a numerical value that determines if output is suppressed to an output file, or if blank lines preceding any text are included in the output. Value (additive) Description 1 Suppresses output to the file specified with the _TEXT System Variable. 2 When the NOSHOW clause is included, preserves blank lines preceding text that appears within TEXT...ENDTEXT. Setting nValue to 2 will separate current TEXT...ENDTEXT output from previous TEXT...ENDTEXT output with a line feed. NoteNote Combining an nValue setting of 2 and PRETEXT of 4 will separate current TEXT…ENDTEXT output from previous TEXT…ENDTEXT output with a line feed while removing empty lines in the TEXT...ENDTEXT output. PRETEXT eExpression Specifies a character string to insert before each line of the text merge contents between TEXT...ENDTEXT or a numeric expression. The following table describes behaviors of the PRETEXT clause depending on the expression specified by eExpression. eExpression PRETEXT behavior Character expression Insert the expression before each line of the text merge contents appearing between the TEXT...ENDTEXT statement. When using PRETEXT with TEXT...ENDTEXT, eExpression is limited to a maximum length of 255 characters. eExpression overrides the contents of the _PRETEXT system variable. When eExpression contains an expression that needs to be evaluated, for example, a user-defined function (UDF), Visual FoxPro evaluates it only once when the TEXT command first appears. Numeric expression Specify additive flag values to determine behavior for the text merge contents appearing between the TEXT...ENDTEXT statement. For example, a value of 7 specifies that Visual FoxPro eliminate all white space including spaces, tabs, and carriage returns. A value falling outside of the range of 0-15 produces an error. NoteNote Specifying a value of zero does not eliminate white space. When eExpression is a numeric expression, you can use the _PRETEXT system variable to insert additional text after Visual FoxPro eliminates white space. The following table lists numeric additive flags that you can use in eExpression to specify additional behavior. Value (Additive) Description 1 Eliminate spaces before each line. 2 Eliminate tabs before each line. 4 Eliminate carriage returns, for example, blank lines, before each line. 8 Eliminate line feeds. NoteNote Unlike the _PRETEXT system variable, the PRETEXT clause does not have global scope and applies only to the TEXT...ENDTEXT statement in which it appears. Characters removed using the PRETEXT clause apply only to text within the TEXT...ENDTEXT statement and not to evaluated text merged from cExpression. In the following example, the spaces in the memory variable, myvar, are not removed when merged with the text in TEXT...ENDTEXT: CopyCode imageCopy Code myvar = " AAA" TEXT TO x NOSHOW ADDITIVE TEXTMERGE PRETEXT 7 Start Line <<myvar>> BBB CCC ENDTEXT Collapse imageRemarks By default, TEXT ... ENDTEXT sends output to the main Visual FoxPro window or the active window. To suppress output to the main Visual FoxPro window or the active window, issue SET CONSOLE OFF. To send output to a printer or a text file, use SET PRINTER. To send output from TEXT ... ENDTEXT to a low-level file that you created or opened using FCREATE( ) or FOPEN( ), store the file handle returned by FCREATE( ) or FOPEN( ) to the _TEXT system variable, which you can use to direct output to the corresponding low-level file. NoteNote The text merge process usually includes any white space that might appear before each line in a TEXT...ENDTEXT statement. However, the inclusion of white space might cause the text merge to fail, for example, when XML is used in a Web browser. You must remove such white space to avoid incorrectly formatted XML. Nesting TEXT...ENDTEXT statements is not recommended, especially if using the PRETEXT clause because the nested statements can affect the format of the outer statements. Collapse imageExample Example 1 The following example demonstrates creating a low-level file called myNamesFile.txt and storing its file handle in the _TEXT system variable. The program exits if the myNamesFile.txt file cannot be created. Visual FoxPro opens the customer table and outputs the names of the first ten contacts to myNamesFile.txt. Visual FoxPro outputs the text and results of the functions to the text file. The example uses MODIFY FILE to open myNamesFile.txt. CopyCode imageCopy Code CLEAR CLOSE DATABASES SET TALK OFF SET TEXTMERGE ON STORE FCREATE('myNamesFile.txt') TO _TEXT IF _TEXT = -1 WAIT WINDOW 'Cannot create an output file. Press a key to exit.' CANCEL ENDIF CLOSE DATABASES OPEN DATABASE (HOME(2) + 'Data\testdata') USE customer TEXT CONTACT NAMES <<DATE( )>> <<TIME( )>> ENDTEXT WAIT WINDOW 'Press a key to generate the first ten names.' SCAN NEXT 10 TEXT <<contact>> ENDTEXT ENDSCAN CLOSE ALL MODIFY FILE myNamesFile.txt ERASE myNamesFile.txt Example 2 The following example shows a custom procedure that uses TEXT...ENDTEXT to store an XML DataSet to a variable. In the example, all spaces, tabs, and carriage returns are eliminated. CopyCode imageCopy Code PROCEDURE myProcedure DO CASE CASE nValue = 1 TEXT TO myVar NOSHOW TEXT PRETEXT 7 <?xml version="1.0" encoding="utf-8"?> <DataSet xmlns="http://tempuri.org"> <<ALLTRIM(STRCONV(leRetVal.item(0).xml,9))>> </DataSet> ENDTEXT OTHERWISE ENDCASE ENDPROC [/quote:idff6bhp]
Cantidad variable de parámetros
Tocayo, todo esto de los pragmas vino justo a partir de eso: del reemplazo de variables por valores, muy parecido a lo que a ti te gustaría. Mira la funcioncita 'Expand()' y luego el ejemplo de XML que subí, no es _exactamente_ lo que pides pero esta bastante cerca, es casi lo mismo. Es más: Puedes tener la sentencia SQL usando los parámetros $1, $2, etc.. y expandirlos en el momento que vayas a usarlo, usando variables. No repites toda la sentencia. ¿Funcionan los #pragmas con xHarbour?
Cantidad variable de parámetros
Hola, Añadiendo hbcompat.ch ya está disponible TEXT INTO cVariable Un saludo
Cantidad variable de parámetros
Carlos Vargas, Yo tengo implementado este método (se puede usar como función) que hace la funcionalidad de FoxPro de sustituir variables <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> [code=fw:2mgfz0r7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> RunQuery<span style="color: #000000;">&#40;</span> cSQLQuery, cTitle <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> ...<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oRs, nStart, nEnd, cVariable, cDlgTitle, uValue<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> cSQLQuery <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">while</span> <span style="color: #ff0000;">"[["</span> $ cSQLQuery<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;uValue = Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nStart = <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"[["</span>, cSQLQuery <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nEnd &nbsp; = <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"]]"</span>, cSQLQuery <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVariable = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cSQLQuery, nStart + <span style="color: #000000;">2</span>, nEnd - nStart - <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #ff0000;">","</span> $ cVariable<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cDlgTitle = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cVariable, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">","</span>, cVariable <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; cVariable = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cVariable, <span style="color: #000000;">1</span>, <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">","</span>, cVariable <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> cDlgTitle <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cDlgTitle = <span style="color: #ff0000;">"Please write the value for "</span> + cVariable<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MsgGet<span style="color: #000000;">&#40;</span> cDlgTitle, <span style="color: #ff0000;">""</span>, @uValue <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #ff0000;">"/"</span> $ uValue<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uValue = StrTran<span style="color: #000000;">&#40;</span> FW_ValToSQL<span style="color: #000000;">&#40;</span> CToD<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> uValue <span style="color: #000000;">&#41;</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;<span style="color: #ff0000;">"'"</span>, <span style="color: #ff0000;">""</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; uValue = FW_ValToSQL<span style="color: #000000;">&#40;</span> AllTrim<span style="color: #000000;">&#40;</span> uValue <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 />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cDlgTitle = <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSQLQuery = <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cSQLQuery, <span style="color: #000000;">1</span>, nStart - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;uValue + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cSQLQuery, nEnd + <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; end<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// MsgInfo( cSQLQuery )</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span></div>[/code:2mgfz0r7] Las espressiones que quieres que se evaluen se escriben entre [[ ... ]]]
Cantidad variable de parámetros
Carlos, Excelente ejemplo <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> gracias!
Cantidad variable de parámetros
Carlos ++++1
Cantidad variable de parámetros
Estimadísimos, [quote="Antonio Linares":2jxu9zqk] Dudo que Przemek pasará por alto algo asi. Tal vez haya otro uso para "..." que desconocemos. [/quote:2jxu9zqk] Al menos encontré uno... otra grata sorpresa! Me expreso mejor con código, así es que aqui va el ejemplo de uso: [code=fw:2jxu9zqk]<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 />   <span style="color: #00C800;">LOCAL</span> bBlock:= <span style="color: #000000;">&#123;</span>|...| Evalua<span style="color: #000000;">&#40;</span> ... <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />  <br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'Sin este MsgInfo() no me muestra el otro, pero es irrelevante...'</span> <span style="color: #000000;">&#41;</span><br /><br />   Eval<span style="color: #000000;">&#40;</span> bBlock, <span style="color: #ff0000;">'A'</span>, <span style="color: #ff0000;">'B'</span>, <span style="color: #ff0000;">'C'</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// =>Pops up 'Params :ABC'</span><br />   <br />   QUIT<br /><br /><span style="color: #00C800;">FUNCTION</span> Evalua<span style="color: #000000;">&#40;</span> a, b, c <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'Params :'</span> + a + b + c <span style="color: #000000;">&#41;</span><br /> </div>[/code:2jxu9zqk] Estábamos buscando el significado de "..." como declaración, per su uso más significativo es en la llamada. Significa algo así como 'pasa como parámetros todos los parametros de la stack. Se me acaba de ocurrir... pasará también Self? Hay que probar. Estas cosas las tengo que escribir en el blog, tengo que escribir en el blog, tengo que escribir en el blog....
Cantidad variable de parámetros
Carlos, [quote="Carlos Mora":37sdxyhz]Solo se me ocurre una cuestion de orden y elegancia, una forma de hacer explícito el hecho de que vas a usar parámetros. Tal vez el pcode generado podría llegar a mostrar alguna diferencia, no se... Pero en lo personal lo he usado bastante, como en el ejemplo, y como podrás adivinar, con uso intensivo (es en las querys) y va fenomenal. Y para añadir más cosas a la colección de cositas guapas, por si alguno todavía no lo conoce, van los siguientes #pragmas: [code=fw:37sdxyhz]<div class="fw" id="{CB}" style="font-family: monospace;"><br />#xcommand <span style="color: #0000ff;">TEXT</span> INTO <v> => <span style="color: #00D7D7;">#pragma</span> __cstream|<v>:=%s<br />#xcommand <span style="color: #0000ff;">TEXT</span> INTO <v> ADDITIVE => <span style="color: #00D7D7;">#pragma</span> __cstream|<v>+=%s<br /> </div>[/code:37sdxyhz] Esto nos permite escribir texto literal, que incluya incluso saltos de línea, como en: [code=fw:37sdxyhz]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   <span style="color: #0000ff;">TEXT</span> INTO cTexto<br /><br />      CREATE TABLE <span style="color: #00C800;">IF</span> NOT <span style="color: #0000ff;">EXISTS</span> `validalta` <span style="color: #000000;">&#40;</span><br />        `<span style="color: #0000ff;">id</span>`         int<span style="color: #000000;">&#40;</span><span style="color: #000000;">11</span><span style="color: #000000;">&#41;</span> NOT <span style="color: #00C800;">NULL</span> AUTO_INCREMENT,<br />        `fechanaci`  date,<br />        `nif`        varchar<span style="color: #000000;">&#40;</span><span style="color: #000000;">9</span><span style="color: #000000;">&#41;</span>  <span style="color: #00C800;">DEFAULT</span> <span style="color: #00C800;">NULL</span>,<br />        `<span style="color: #0000ff;">mail</span>`       varchar<span style="color: #000000;">&#40;</span><span style="color: #000000;">50</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">DEFAULT</span> <span style="color: #00C800;">NULL</span>,<br />        `cuenta`     varchar<span style="color: #000000;">&#40;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">DEFAULT</span> <span style="color: #00C800;">NULL</span>,<br />        PRIMARY KEY <span style="color: #000000;">&#40;</span>`<span style="color: #0000ff;">id</span>`<span style="color: #000000;">&#41;</span>,<br />        UNIQUE KEY `NIF` <span style="color: #000000;">&#40;</span>`nif`<span style="color: #000000;">&#41;</span><br />      <span style="color: #000000;">&#41;</span>;<br />   ENDTEXT<br /><br />   oServer:<span style="color: #000000;">Command</span><span style="color: #000000;">&#40;</span> cTexto <span style="color: #000000;">&#41;</span><br /> </div>[/code:37sdxyhz] o bien, XML combinado con la funcioncita de Expand [code=fw:37sdxyhz]<div class="fw" id="{CB}" style="font-family: monospace;"><br />               <span style="color: #0000ff;">TEXT</span> INTO cTransac<br />                  <tns:<span style="color: #000000;">importAbsenceFiles</span> xmlns:<span style="color: #000000;">tns</span>=<span style="color: #ff0000;">"http://echange.service.open.server.com"</span>><br />                     <tns:<span style="color: #000000;">absenceFilesToImport</span>><br />                        <tns:<span style="color: #000000;">absenceFile</span>><br />                           <tns:<span style="color: #000000;">absenceTypeAbbreviation</span>>VACAC</tns:<span style="color: #000000;">absenceTypeAbbreviation</span>><br />                           <tns:<span style="color: #000000;">employeeIdentificationNumber</span>>$<span style="color: #000000;">1</span></tns:<span style="color: #000000;">employeeIdentificationNumber</span>><br />                           <tns:<span style="color: #000000;">startDate</span>>$<span style="color: #000000;">2</span></tns:<span style="color: #000000;">startDate</span>><br />                           <tns:<span style="color: #000000;">endDate</span>>$<span style="color: #000000;">3</span></tns:<span style="color: #000000;">endDate</span>><br />                        </tns:<span style="color: #000000;">absenceFile</span>><br />                     </tns:<span style="color: #000000;">absenceFilesToImport</span>><br />                  </tns:<span style="color: #000000;">importAbsenceFiles</span>><br />               ENDTEXT<br /><br />               cTransac:= Expand<span style="color: #000000;">&#40;</span> cTransac, oQuery:<span style="color: #000000;">dni</span>, oQuery:<span style="color: #000000;">FechaInicio</span>, oQuery:<span style="color: #000000;">FechaFin</span> <span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:37sdxyhz] Como te decía, entre SQL, XML y web... lo uso de forma intensiva, y ayuda a hacer la programación muchísimo más clara.[/quote:37sdxyhz] No encuentro la definición de ENDTEXT. Puedes comprobar en que se preprocesa ? gracias
Cantidad variable de parámetros
Hola Antonio, hasta donde entiendo, ENDTEXT marca el fin de la cadena, no se preprocesa. Funciona como la comilla final de una cadena cuando se abre con TEXT, marcando el final de la stream multilinea. Existe desde un principio por el comando TEXT/ENDTEXT. ¿Has tenido algún inconveniente? Por acá va muy bien. Un saludo
Cantidad variable de parámetros
Carlos, Tienes toda la razón. Como TEXT INTO se preprocesa, pensé que ENDTEXT se preprocesaba tambien. Funcionando correctamente, gracias <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Cantidad variable de parámetros
Carlos, Cuando usas TEXT ... ENDTEXT, si no "pegas" el texto a la izquiera, este toma los espacios de la izquierda. Como haces en tu código para que no tome esos espacios ? Ejemplo: [code=fw:2bcd7yit]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">TEXT</span> INTO cTest<br />&nbsp; &nbsp;Uno<br />&nbsp; &nbsp;Dos<br />&nbsp; &nbsp;Tres<br />ENDTEXT<br /><br /><span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> cTest <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2bcd7yit] El texto "Uno" tiene 3 espacios a la izquierda. La cuestión es que entonces no puedes indentar el comando TEXT ... ENDTEXT o te incluye los espacios de la indentación en el texto. Has podido solucionar esto de alguna forma ? gracias
Cantidad variable de parámetros
Hola Antonio, no conozco una forma práctica de evitar el indentado. TEXT/ENDTEXT funcionan como si fueran comillas, no hace caso de nada excepto de lo que hay al final. No le he dado mucha importancia hasta ahora porque lo he usado en situaciones donde esos espacios no me molestan, como sql o xml. Y si, es cierto que a veces el código no queda tan bonito si tienes los bloques de texto fuera de la indentación natural dentro del código donde aparece. Lo veo un poco complicado, no hay nada de funcionalidad en el preprocesador para indentado porque, si lo piensas, el indentado es relevante al programador y no a como lo "lee" el compilador. Si se me ocurre algo te lo digo.
Cantidad variable de parámetros
Carlos, ok, gracias. Es una lástima porque perdemos la indentación del código PRG.
Cantidad variable de parámetros
[quote:33heuwju]yo lo uso igual con instrucciones sql grandes, para mayor claridad, la leche seria si tuviera la funcionalidad que tiene en vfp, la cual es capaz de evaluar variables y poner en su lugar el valor. por ejemplo TEXT INTO cSql SELECT CODIGO, NOMBRE, FECHA FROM TABLA WHERE FECHA=<<DATE()>> ENDTEXT [/quote:33heuwju] FWH provides some help to enable writing SQL queries in a portable manner. I mean the same code will work for different RDMS, be it MySql, Access, MySql, Oracle, etc. To start with, simple SELECT statement: [code=fw:33heuwju]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">PRIVATE</span> cDate := FW_ValToSQL<span style="color: #000000;">&#40;</span> Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">TEXT</span> INTO cSql<br />&nbsp; &nbsp;<span style="color: #0000ff;">SELECT</span> CODIGO, NOMBRE, FECHA<br />&nbsp; &nbsp;<span style="color: #0000ff;">FROM</span> TABLA <span style="color: #0000ff;">WHERE</span> FECHA = &cDate<br />&nbsp; &nbsp;ENDTEXT<br /><br />&nbsp; &nbsp;? cSql<br />&nbsp;</div>[/code:33heuwju] Result: [code=fw:33heuwju]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #0000ff;">SELECT</span> CODIGO, NOMBRE, FECHA<br />&nbsp; &nbsp;<span style="color: #0000ff;">FROM</span> TABLA <span style="color: #0000ff;">WHERE</span> FECHA = <span style="color: #ff0000;">'2015-03-14'</span><br />&nbsp;</div>[/code:33heuwju] By default and if we established a connection to MySql server using FW_OpenAdoConnection(), the translation is for MySql. The Query formatting has to be different for different RDBMS If we earlier established connection to MsAccess database with FW_ * function and run the same code above the result is: [code=fw:33heuwju]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #0000ff;">SELECT</span> CODIGO, NOMBRE, FECHA<br />&nbsp; &nbsp;<span style="color: #0000ff;">FROM</span> TABLA <span style="color: #0000ff;">WHERE</span> FECHA = #<span style="color: #000000;">2015</span><span style="color: #000000;">-03</span><span style="color: #000000;">-14</span>#<br />&nbsp;</div>[/code:33heuwju] If we are connected to Oracle server and run the same code as above the result is: [code=fw:33heuwju]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #0000ff;">SELECT</span> CODIGO, NOMBRE, FECHA<br />&nbsp; &nbsp;<span style="color: #0000ff;">FROM</span> TABLA <span style="color: #0000ff;">WHERE</span> FECHA = DATE <span style="color: #ff0000;">'2015-03-14'</span><br />&nbsp;</div>[/code:33heuwju] Now building INSERT and UPDATE queries, even using TEX INTO ..ENDTEXT is not that easy. We also need to keep our code portable. FWH provides very useful translates for this purpose. We need to include "adodef.ch" in our program. We include this anyway if we are using ADO. Insert SQL: [code=fw:33heuwju]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; cName &nbsp; &nbsp;:= <span style="color: #ff0000;">"John"</span><br />&nbsp; &nbsp;nAge &nbsp; &nbsp; := <span style="color: #000000;">40</span><br />&nbsp; &nbsp;dJoin &nbsp; &nbsp;:= STOD<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"20001010"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;lMarried := .f.<br />&nbsp; &nbsp;cNote &nbsp; &nbsp;:= <span style="color: #ff0000;">"David's brother"</span><br /><br />&nbsp; &nbsp;cSql &nbsp;:= SQL INSERT INTO EMPLOYEE <span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">NAME</span>, AGE, JGDATE, MARRIED, NOTE <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VALUES <span style="color: #000000;">&#40;</span> cName, nAge, dJoin, lMarried, cNote <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;? cSql<br /><br />&nbsp; &nbsp;cSql &nbsp;:= SQL <span style="color: #0000ff;">UPDATE</span> EMPLOYEE SET AGE = <span style="color: #000000;">30</span>, JGDATE = STOD<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"20071010"</span> <span style="color: #000000;">&#41;</span>, MARRIED = .T. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHERE</span> <span style="color: #0000ff;">ID</span> = <span style="color: #000000;">201</span><br />&nbsp; &nbsp;? cSql<br /><br />&nbsp;</div>[/code:33heuwju] We can straight away use (x)Harbour variables here and there is no need to format them for SQL and also there is no need to remember which RDMS we are presently connected to. Result for MySql: [code=fw:33heuwju]<div class="fw" id="{CB}" style="font-family: monospace;">INSERT INTO EMPLOYEE <span style="color: #000000;">&#40;</span> `<span style="color: #0000ff;">NAME</span>`,`AGE`,`JGDATE`,`MARRIED`,`NOTE` <span style="color: #000000;">&#41;</span> VALUES <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'John'</span>,<span style="color: #000000;">40</span>,<span style="color: #ff0000;">'2000-10-10'</span>,<span style="color: #000000;">0</span>,<span style="color: #ff0000;">'David'</span><span style="color: #ff0000;">'s brother'</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">UPDATE</span> EMPLOYEE SET `AGE` = <span style="color: #000000;">30</span>,`JGDATE` = <span style="color: #ff0000;">'2007-10-10'</span>,`MARRIED` = <span style="color: #000000;">1</span> <span style="color: #0000ff;">WHERE</span> <span style="color: #0000ff;">ID</span> = <span style="color: #000000;">201</span><br />&nbsp;</div>[/code:33heuwju] If we connect to MsAccess and run the same code the result is: [code=fw:33heuwju]<div class="fw" id="{CB}" style="font-family: monospace;">INSERT INTO EMPLOYEE <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#91;</span><span style="color: #0000ff;">NAME</span><span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span>AGE<span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span>JGDATE<span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span>MARRIED<span style="color: #000000;">&#93;</span>,<span style="color: #000000;">&#91;</span>NOTE<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> VALUES <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'John'</span>,<span style="color: #000000;">40</span>,#<span style="color: #000000;">2000</span><span style="color: #000000;">-10</span><span style="color: #000000;">-10</span>#,<span style="color: #000000;">0</span>,<span style="color: #ff0000;">'David'</span><span style="color: #ff0000;">'s brother'</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">UPDATE</span> EMPLOYEE SET <span style="color: #000000;">&#91;</span>AGE<span style="color: #000000;">&#93;</span> = <span style="color: #000000;">30</span>,<span style="color: #000000;">&#91;</span>JGDATE<span style="color: #000000;">&#93;</span> = #<span style="color: #000000;">2007</span><span style="color: #000000;">-10</span><span style="color: #000000;">-10</span>#,<span style="color: #000000;">&#91;</span>MARRIED<span style="color: #000000;">&#93;</span> = <span style="color: #000000;">1</span> <span style="color: #0000ff;">WHERE</span> <span style="color: #0000ff;">ID</span> = <span style="color: #000000;">201</span><br />&nbsp;</div>[/code:33heuwju] FWH now provides safe portability of code for Access, MySql, MSSql, SqLite3 and Oracle. I advise using facilities provided by FWH and save lots of time in formatting SQL statements as well as lot of time in debugging your sql statements.
Cantidad variable de parámetros
Muchas gracias. La verdad, es que TEXT ... END TEXT ya existía en Clipper Summer 87, pero no me acordaba, además sólo iba con SCREEN y PRINTER, creo, ni mi imaginaba que funcionaría también aquí. Qué maravilla.
Can´t find error meanning. ""Error BASE/1009 : <&quo
I am getting an error "Error BASE/1009 : <" and can´t find what is it. This error is not in Clipper docs. The prg line is "RETURN Inkey()"... It s an FiveWin + Clipper program. Does anyone know what is it ?
Can´t find error meanning. ""Error BASE/1009 : <&quo
DBCMD/1009 Argument error Explanation: The argument FIELDNAME() was non-numeric. Action: Correct the program. See Also: FIELDNAME() function
Can´t find error meanning. ""Error BASE/1009 : <&quo
You should not use Inkey() on a FW application.
Can´t find error meanning. ""Error BASE/1009 : <&quo
[quote="Antonio Linares":3j9mozoi]You should not use Inkey() on a FW application.[/quote:3j9mozoi] Ok, thanks. What should I use to wait a key in FiveWin ?
Can´t find error meanning. ""Error BASE/1009 : <&quo
Please explain what you need to do. What do you need that keystroke for ?
Can´t find error meanning. ""Error BASE/1009 : <&quo
[quote="Antonio Linares":cb6uamoe]Please explain what you need to do. What do you need that keystroke for ?[/quote:cb6uamoe] In this case I need to wait sometime to repeat a procedure.
Can´t find error meanning. ""Error BASE/1009 : <&quo
Then use something like SysWait( nSec ). EMG
Can´t initialize character set unknown (path: compiled_in)
Estimado José, Verifica la configuración de MySQL: Asegúrate de que los archivos de configuración de MySQL no contengan errores de sintaxis ni configuraciones incorrectas. El archivo de configuración principal generalmente se llama my.cnf o my.ini, dependiendo de tu sistema operativo. Verifica la configuración del conjunto de caracteres: Asegúrate de que la configuración del conjunto de caracteres en el archivo de configuración de MySQL sea correcta y que apunte a rutas válidas para los conjuntos de caracteres. El mensaje de error podría sugerir que se especifica un conjunto de caracteres con la ruta "compiled_in," pero eso no es una ruta válida. Asegúrate de que las configuraciones del conjunto de caracteres sean precisas y de que los archivos de conjunto de caracteres correspondientes existan en la ubicación correcta. Verifica la instalación de MySQL: Asegúrate de que MySQL esté instalado correctamente en tu sistema. Si recientemente actualizaste MySQL o instalaste una nueva versión, verifica que el proceso de instalación se haya completado con éxito. Verifica los permisos de archivo: Asegúrate de que el proceso del servidor MySQL tenga los permisos adecuados para acceder a los archivos de conjuntos de caracteres y al directorio de datos de MySQL. Verifica los registros de MySQL: Examina los registros de error de MySQL (generalmente se encuentran en el directorio de datos de MySQL o en el directorio de registros del sistema) para obtener más información sobre el error específico y sus posibles causas. Reinstala o repara MySQL: Si aún no puedes identificar el problema, puedes intentar reinstalar MySQL o usar un gestor de paquetes para reparar la instalación.
Can´t initialize character set unknown (path: compiled_in)
Estimado Antonio Hola, muchas gracias por la pronta y detallada respuesta. Procederemos a revisar y hacer todo lo que indicas. Comentaré acá los resultados, sea para pedir más ayuda o para dejar aquí la solución. Saludos.
Can´t initialize character set unknown (path: compiled_in)
Hola a todos, y gracias de antemano por leer y por responder a quienes puedan hacerlo. Usando Debian 11, MySQL 8.0.33 y 5.7.20, utilizando lo nativo de FWH/mariaDB para conectar a ddbb MySQL, da error "2019 Can´t initialize character set unknown (path: compiled_in)" y no se conecta (por lo tanto, el sistema no abre) Para solucionarlo y entre tanto parche probado, agregamos estas configuraciones a MySQL [client] default-character-set = utf8mb4 [mysql] default-character-set = utf8mb4 [mysqld] character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci Así se logra conectar a ddbb MySQL, pero al grabar registros que contengan caracteres especiales (óñáé, etc.) quedan como "?" en algunas tablas Conecto de esta forma con la ddbb: FWConnect oMyCon Host <cIPSuc> User <cAUsu> Password <cPsw> Port <nPort> DB <cDB> Estoy usando las siguientes herramientas, en proceso de migración de mis softwares aún) HB 3.2, FWH 21.06 Borland C++ 7.0 MariaDB 10.3 32 bit Gracias.
Can´t initialize character set unknown (path: compiled_in)
Estimado Antonio, hola. Pedí al equipo que revisara todo según tus indicaciones y el problema se resolvió; no puedo decir que fue exactamente, imagino que más de una cosa. Si tengo más luz al respecto compartiré los datos. Gracias.
Can´t initialize character set unknown (path: compiled_in)
muy bien! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Can´t produce .exe with MSVC 2019 [solved]
Hello, I get this errors when linking: LINK : warning LNK4098: la biblioteca predeterminada'MSVCRT' entra en conflicto con otras bibliotecas; use la biblioteca /NODEFAULTLIB:biblioteca fiveh32.lib(VALTOSTR.obj) : error LNK2001: símbolo externo _HB_FUN_HB_TSTOUTC sin resolver fiveh32.lib(VSTRFUN1.obj) : error LNK2019: símbolo externo _hb_strAtI sin resolver al que se hace referencia en la función _HB_FUN_FW_ATIC hbvm.lib(hvmall.obj) : error LNK2019: símbolo externo ___iob_func sin resolver al que se hace referencia en la función "void __cdecl internal_malloc_stats(struct malloc_state *)" (?internal_malloc_stats@@YAXPAUmalloc_state@@@Z) rddcdx.lib(dbfcdx1.obj) : error LNK2001: símbolo externo ___iob_func sin resolver hbcplr.lib(hbcomp.obj) : error LNK2001: símbolo externo ___iob_func sin resolver hbpp.lib(ppcore.obj) : error LNK2001: símbolo externo ___iob_func sin resolver rddcdx.lib(dbfcdx1.obj) : error LNK2019: símbolo externo _printf sin resolver al que se hace referencia en la función "struct _CDXKEY * __cdecl hb_cdxKeyPutItem(struct _CDXKEY *,void *,unsigned long,struct _CDXTAG *,int,int)" (?hb_cdxKeyPutItem@@YAPAU_CDXKEY@@PAU1@PAXKPAU_CDXTAG@@HH@Z) hbpp.lib(ppcore.obj) : error LNK2001: símbolo externo _printf sin resolver MSVCRT.lib(chandler4gs.obj) : error LNK2019: símbolo externo __except_handler4_common sin resolver al que se hace referencia en la función __except_handler4 demo.exe : fatal error LNK1120: 5 externos sin resolver
Can´t produce .exe with MSVC 2019 [solved]
Moises, Are you using buildh32.bat to build it ?