FoxPro/Visual FoxPro - Duda sobre Text endtext

 
Vista:

Duda sobre Text endtext

Publicado por es_binario (757 intervenciones) el 14/06/2011 23:53:05
Usando Text Endtext se supera la barrera de los 250 caracteres en una cadena de texto, yo la uso mucho en sql con textmerge.

mi duda es como puedo usarla haciendo que acepte comandos como chr(13) o propios de foxpro... mi cadena no supera los 250 pero podría y de ahí mi inquietud.

el código en el que me gustaría usarla una cadena que se suma según las condiciones.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
bf_detalle_vent = ""
SELECT cantidad, articulo, precio_pub FROM detallevent;
	WHERE detallevent.folio = bf_folio_consul INTO CURSOR bf_det_vent_cur
 
SELECT bf_det_vent_cur
bf_no_registros =  RECCOUNT()
IF bf_no_registros = 1
	*// un solo registro
	bf_detalle_vent = ALLTRIM(STR(bf_det_vent_cur.cantidad)) + " " +;
		ALLTRIM(bf_det_vent_cur.articulo) + " P.U. $" + ALLTRIM(STR(bf_det_vent_cur.precio_pub,10,2)) +CHR(13)
ELSE
	*///
	*/// para mas de un articulo alineacion segun longitud de campos
	*///
	*// mas de un articulo
ENDIF
bf_detalle_vent = bf_detalle_vent + "Importe TOTAL: $" + ALLTRIM(STR(bf_datos_venta_cur.importe,10,2)) + CHR(13)
IF bf_datos_venta_cur.eng_dado > 0
	bf_detalle_vent = bf_detalle_vent + "Enganche dado $" +;
		ALLTRIM(STR(bf_datos_venta_cur.eng_dado,10,2)) + CHR(13)
	bf_detalle_vent = bf_detalle_vent + "Importe - Enganche: $" + ALLTRIM(STR((bf_datos_venta_cur.importe-bf_datos_venta_cur.eng_dado),10,2)) + CHR(13)
ELSE
	bf_detalle_vent = bf_detalle_vent + "No Dio Enganche" + CHR(13)
ENDIF
 
bf_detalle_vent = bf_detalle_vent + "Vendedor: " + ALLTRIM(bf_datos_venta_cur.vendedor) + CHR(13)
bf_detalle_vent = bf_detalle_vent + "Cobrador: " + ALLTRIM(bf_datos_venta_cur.cobrador)
*// pone los datos en el edit el resumen
Thisform.edit2.Value = bf_detalle_vent



gracias por lo que me apoyen.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

Duda sobre Text endtext

Publicado por Juan Manuel Cruz (512 intervenciones) el 15/06/2011 10:44:40
Siempre puedes usar la cláusula ADDITIVE del TextMerge, para que agregue a lo ya existente en la variable, y una combinatoria del PRETEXT para eliminar espacios vacíos pero que respete el corte de línea.

Y el reemplazo de valores, claro, que ahorra estar haciendo llamadas adicionales a funciones para formatear.

Ejemplo:

bf_detalle_vent = ""

*** bla bla bla...

TEXT TO bf_detalle_vent ADDITIVE TEXTMERGE NOSHOW PRETEXT 7
<<Transform( vCursor.cantidad, '999,999')>> <<PADR( vCursor.articulo)>> <<Transform( vCursor.precio_pub,'@$ 99,999.99') >>

ENDTEXT

*** bla bla bla...

TEXT TO bf_detalle_vent ADDITIVE TEXTMERGE NOSHOW PRETEXT 7
Vendedor: <<vCursor.Vendedor>>
Cobrador: <<vCursor.Cobrador>>
ENDTEXT
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Duda sobre Text endtext

Publicado por es_binario (757 intervenciones) el 15/06/2011 16:54:53
Te lo agradezco efectivamente funciona.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar