cindyrella
Programmer
I'm a newbie to Crystal 5, so please bear with me. I have a text field that I need to strip of hyphens. There will be a variable number of hyphens in the text field. So far, I have:
StringVar UPC;
NumberVar H1;
UPC := Trim({InventoryMasterfile.UPCCode});
IF Length (UPC)>0 THEN H1:= InStr(UPC,"-"
IF H1=0 THEN UPC:=UPC ELSE
IF H1>0 THEN UPC := Left(UPC,H1-1)+Mid(UPC,H1+1) ;
IF Length (UPC)>0 THEN H1:= InStr(UPC,"-" ;
IF H1=0 THEN UPC:=UPC ELSE
IF H1>0 THEN UPC := Left(UPC,H1-1)+Mid(UPC,H1+1)
What I have gets the first 2 hyphens, but I need to loop through the text field a variable number of times looking for hyphens. Can someone make a suggestion?
Thanks!
StringVar UPC;
NumberVar H1;
UPC := Trim({InventoryMasterfile.UPCCode});
IF Length (UPC)>0 THEN H1:= InStr(UPC,"-"
IF H1=0 THEN UPC:=UPC ELSE
IF H1>0 THEN UPC := Left(UPC,H1-1)+Mid(UPC,H1+1) ;
IF Length (UPC)>0 THEN H1:= InStr(UPC,"-" ;
IF H1=0 THEN UPC:=UPC ELSE
IF H1>0 THEN UPC := Left(UPC,H1-1)+Mid(UPC,H1+1)
What I have gets the first 2 hyphens, but I need to loop through the text field a variable number of times looking for hyphens. Can someone make a suggestion?
Thanks!