xharbour a harbour

xharbour a harbour

Postby Patricio Avalos Aguirre » Wed Jul 25, 2012 2:03 pm

Estimados, estoy pasando de xharbour a harbour por sus bondades pero me enfrasco con este tema

Code: Select all  Expand view
    TEXT into cSql
                  SELECT * FROM TABLA
    ENDTEXT
 


hay alguna otra forma en harbour para esta sentencia, o solo hay que hacerlo a la antigua, uyy el 99% lo tengo de esa manera :-(

Code: Select all  Expand view
cSql := "SELECT * FROM TABLA"
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1059
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: xharbour a harbour

Postby Antonio Linares » Wed Jul 25, 2012 2:28 pm

Prueba con algo asi :-)

#xcommand TEXT INTO <cVar> ;; <sentence,...> ;; ENDTEXT ;
=> <cVar> := <(sentence)>
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41366
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xharbour a harbour (SOLUCIONADO )

Postby Patricio Avalos Aguirre » Wed Jul 25, 2012 3:39 pm

Antonio

no funciono pero me diste una pista y lo busque en el std.ch de xharbour
por ahora no dio problema de compilacion

Code: Select all  Expand view
#command TEXT INTO <lValue>         => <lValue> := "" ; hb_setwith( {|_1| <lValue> += _1 } );;
                                       text __TextInto, hb_SetWith
 


Gracias
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1059
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: xharbour a harbour

Postby carlos vargas » Wed Jul 25, 2012 4:26 pm

esta instruccion en foxpro es muy usada para la construccion de sql de gran tamaño, incluso
creo recordar que permitia la resoucion de variables lo que le daba mas flexibilidad.
este el el help de vfp, seria interesante dotar a esta instruccion en harbour de las caracteristicas que tiene en vfp.

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:

myvar = " AAA"
TEXT TO x NOSHOW ADDITIVE TEXTMERGE PRETEXT 7
Start Line
<<myvar>>
BBB
CCC
ENDTEXT


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.

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.

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


Collapse imageSee Also

Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1688
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: xharbour a harbour

Postby Patricio Avalos Aguirre » Wed Jul 25, 2012 10:10 pm

Esto si que es un chapuson ...

aun no puedo cambiarme :-(

seguiremos con xharbour por ahora.. me canse...
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1059
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: xharbour a harbour

Postby Carlos Mora » Thu Jul 26, 2012 1:21 pm

Es más que útil, sobre todo si se usa SQL

Creo que con esto se soluciona:

Code: Select all  Expand view

#xcommand TEXT INTO <v> => #pragma __cstream|<v>:=%s
#xcommand TEXT INTO <v> ADDITIVE => #pragma __cstream|<v>+=%s

PROCEDURE Main()
    LOCAL cPrueba

TEXT INTO cPrueba
      Linea 1
      textosss
      mas textos
      function ()"'
ENDTEXT
msginfo( cPrueba )
TEXT INTO cPrueba ADDITIVE
      aun más
ENDTEXT

msginfo( cPrueba )

RETURN


Un saludo
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: xharbour a harbour

Postby compubrion » Thu Jul 26, 2012 7:34 pm

Saludos !
Prueba añadiendo en tu prg

#include "hbcompat.ch"

en este esta esta definicion
/* TEXT INTO <varname> */
#xcommand TEXT INTO <v> => #pragma __text|<v>+=%s+hb_eol();<v>:=""
Harbour / Bcc / MinGW / Fwh 13.9
User avatar
compubrion
 
Posts: 130
Joined: Thu Mar 08, 2007 6:12 pm
Location: Miranda - Venezuela

Re: xharbour a harbour

Postby Patricio Avalos Aguirre » Fri Jul 27, 2012 2:19 pm

Hola

Gracias compubrion, eso era..

ahora solo me quedan dos errores y estamos listo :-)

Compiling...
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
c:\borland\bcc582\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external '_HB_FUN_DBSKIPPER' referenced from D:\APL\PRGS\LIB32
H\TWBRW32.LIB|WBROWSE
Error: Unresolved external '_HB_LOG' referenced from D:\APL\PRGS\LIB32H\SBROWSE9
.LIB|TSBFuncs

** error 2 ** deleting wCta.exe
Presione una tecla para continuar . . .


a ver si alguien me envia la wbrowse de hernan para harbour 3 y tsbfunc.c de la tsbrowse9 del maestro Manuel Mercado

desde ya gracias
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1059
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: xharbour a harbour

Postby nnicanor » Sat Jul 28, 2012 1:39 am

Lo solucionas agregando el archivo hbcompat.ch en los archivos donde tienes la sentencia TEXT ....


#include "hbcompat.ch"

Slds
Nicanor Martinez M.
Auditoria y Sistemas Ltda.
MicroExpress Ltda.
FW + FWH + XHARBOUR + HARBOUR + PELLES C + XDEVSTUDIO + XEDIT + BCC + VC_X86 + VCC_X64 + MINGW + R&R Reports + FastReport + Tdolphin + ADO + MYSQL + MARIADB + ORACLE
nnicanor@yahoo.com
nnicanor
 
Posts: 295
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Re: xharbour a harbour

Postby nnicanor » Sat Jul 28, 2012 3:44 pm

hbcompat.ch funciona con ambos compiladores y no es necesario removerlo o hacer una compilacion condicional el objetivo es compatibilizar expresiones de xharbour y Harbour, cuando comenze a migrar los primeros proyectos encontre ese pequeño detalle y use compilacion condicional pero despues de investigar lo use y puedo compilar las aplicaciones sin cambis con cualquiera de los compiladores de xHarbour y Harbour (BCC,MVC,MINGW etc).

Slds
Nicanor Martinez M.
Auditoria y Sistemas Ltda.
MicroExpress Ltda.
FW + FWH + XHARBOUR + HARBOUR + PELLES C + XDEVSTUDIO + XEDIT + BCC + VC_X86 + VCC_X64 + MINGW + R&R Reports + FastReport + Tdolphin + ADO + MYSQL + MARIADB + ORACLE
nnicanor@yahoo.com
nnicanor
 
Posts: 295
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Re: xharbour a harbour

Postby nnicanor » Sat Jul 28, 2012 3:49 pm

Para solucionar lo del wbrowse puedes ver este post

http://forums.fivetechsupport.com/viewtopic.php?f=6&t=24266&start=0&hilit=wbrowse


Slds
Nicanor Martinez M.
Auditoria y Sistemas Ltda.
MicroExpress Ltda.
FW + FWH + XHARBOUR + HARBOUR + PELLES C + XDEVSTUDIO + XEDIT + BCC + VC_X86 + VCC_X64 + MINGW + R&R Reports + FastReport + Tdolphin + ADO + MYSQL + MARIADB + ORACLE
nnicanor@yahoo.com
nnicanor
 
Posts: 295
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Re: xharbour a harbour

Postby Patricio Avalos Aguirre » Mon Jul 30, 2012 3:56 pm

Gracias Nicanor

logre ya compilar, pero no todo es luz ejej

ahora al entrar a un modulo se queda como pegado y luego plus...

creo que aqui ya no hay solucion ....

Error irrecuperable 6005: Exception error:

Exception Code:C0000005
Exception Address:0049C05F
EAX:0550A28C EBX:75AA702C ECX:00000019 EDX:FFFFFFFF
ESI:0018D19C EDI:75AA702C EBP:0018D16C
CS:EIP:0023:0049C05F SS:ESP:002B:0018D168
DS:002B ES:002B FS:0053 GS:002B
Flags:00210202
CS:EIP: 8B 04 98 5B 5D C3 90 90 90 55 8B EC 53 8B 5D 08
SS:ESP: 007CAF78 0018D188 004B32E7 75AA702C 0065960A 00000000 007CAF78 00000
001 0018D238 004B3188 00000019 0018D19C 00000000 00000300 0000034F 000001A7

C stack:
EIP: EBP: Frame: OldEBP, RetAddr, Params...
0049C05F 0018D16C 0018D188 004B32E7 75AA702C 0065960A 00000000 007CAF78 00
000001
004B32E7 0018D188 0018D238 004B3188 00000019 0018D19C 00000000 00000300 00
00034F 000001A7 054F8D7C 054F97DC
004B3188 0018D238 0018D344 0048723E 00000001 00650451 054FDCF4 006594B0 00
7CAF88 0018D278 0018D26C 0018D274
0048723E 0018D344 0018D354 00407B45 006595ED 006594A0
00407B45 0018D354 0018D374 0048D1C9 00767D28 00000495 00000001 002FDEA4 00
000000 00000011
0048D1C9 0018D374 0018D380 0048D57D 054F0002
0048D57D 0018D380 0018D394 00407BE7 00000002 00000000 C6101F75
00407BE7 0018D394 0018D3A8 004220C3 C6101F75 00767D28 007CAF78
004220C3 0018D3A8 0018D3C4 0048D0AC 00000486 00000001 002FDEA4 00000000 00
000000
0048D0AC 0018D3C4 0018D4D0 0048723E 00000001 00711F2D 00000000 0070F890 00
7CAF78 00B86E90 0018D560 0000000B
0048723E 0018D4D0 0018D4E0 0040706C 0065006D 0064F33C
0040706C 0018D4E0 0018D500 0048D269 007CAF78 00000481 00000001 002FDEA4 00
030010 00000099
0048D269 0018D500 0018D60C 004872F8 00000002 00714904 00000000 00710AC0 1D
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
User avatar
Patricio Avalos Aguirre
 
Posts: 1059
Joined: Fri Oct 07, 2005 1:56 pm
Location: La Serena, Chile

Re: xharbour a harbour

Postby nnicanor » Fri Aug 03, 2012 10:31 pm

Puedes colocar parte del codigo donde se cuelga ??, esto es para poder darte una luz de como solucionar el problema, usas una dll archivo rc ??, para hacerle seguimiento coloca unos mensajes de depuracion para identificar exactamente la instruccion que te genera el error, si deseas puedo enviarte una lib con wbrowse de hernan compilada y los fuentes en un zip.

SLds

Nicanor
Nicanor Martinez M.
Auditoria y Sistemas Ltda.
MicroExpress Ltda.
FW + FWH + XHARBOUR + HARBOUR + PELLES C + XDEVSTUDIO + XEDIT + BCC + VC_X86 + VCC_X64 + MINGW + R&R Reports + FastReport + Tdolphin + ADO + MYSQL + MARIADB + ORACLE
nnicanor@yahoo.com
nnicanor
 
Posts: 295
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Re: xharbour a harbour

Postby sysctrl2 » Fri Aug 03, 2012 11:07 pm

por lo que veo entonces harbour no es tan bondadoso,
es un trauma cambiarse.
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 959
Joined: Mon Feb 05, 2007 7:15 pm

Re: xharbour a harbour

Postby nnicanor » Sat Aug 04, 2012 12:28 am

No es un trauma, lo que pasa es que harbour tiene un control mas estricto en cuanto al uso de tipos de datos y estructuras y me he dado cuenta que muchas cosas que no funcionan es porque cuando las usamos en clipper y xharbour nunca nos dieron error eso nos permite corregir el codigo y optimizarlo para que funcione con cualquier compilador.

Slds
Nicanor Martinez M.
Auditoria y Sistemas Ltda.
MicroExpress Ltda.
FW + FWH + XHARBOUR + HARBOUR + PELLES C + XDEVSTUDIO + XEDIT + BCC + VC_X86 + VCC_X64 + MINGW + R&R Reports + FastReport + Tdolphin + ADO + MYSQL + MARIADB + ORACLE
nnicanor@yahoo.com
nnicanor
 
Posts: 295
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 31 guests