Crystal Report - Algoritmo Incorrecto?

 
Vista:

Algoritmo Incorrecto?

Publicado por Alejandro (1 intervención) el 07/09/2005 23:23:50
Saludos a los del Foro. Hice un pequeño algoritmo dentro de una Formula (en Sintaxis Crystal), cuando la compruebo no me bota error, sin embargo, cuando ejecuto el reporte me bota en blanco la formula.

El campo k estoy usando es: Sales_Shipper_ttx.SALES_CARRIER.SHIPPER_INSTRUCT
y contiene los sguientes datos: ABC, BCA, CAB (un ejemplo),
y lo k estoy tratando de hacer es extraer la 2da palabra de este contexto, es decir, "BCA".

Este es el codigo k uso, me gustaria k me ayudaran con el problemilla. Gracias.

Local numberVar i;
Local NumberVar LongVariable := Length ({Sales_Shipper_ttx.SALES_CARRIER.SHIPPER_INSTRUCT});
Local numberVar cont:= 0;
Local stringVar sVariable;
Local stringVar sDomicilio;

for i := 1 to LongVariable Do
(
sVariable := Mid({Sales_Shipper_ttx.SALES_CARRIER.SHIPPER_INSTRUCT}, i, 1);
if sVariable = "," then
(
cont := cont + 1;
)
else
(
cont := cont + 0;
);

if cont=2 then
(
EXIT FOR
);

if cont=1 then
(
sDomicilio=sDomicilio + sVariable;
);

);

sDomicilio
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