This is the formula I am using but I get an error - can anyone help me? I am trying to parse out characters that will either begin the field or be at the end of the field.
thanks
booleanVar L := false;
booleanVar R := false;
numberVar Ln := Length ({HChargeAudit.ChargeCode});
numberVar S := 0;
numberVar T := 0;
numberVar i;
for i := 1 to {@CDMCounter} step 1 do
if val({HChargeAudit.ChargeCode}[1]) in (0 to 9) then L = false else L = true;
if val({HChargeAudit.ChargeCode}[Ln]) in (0 to 9) then R = false else R = true;
if not L and not R then S = val({HChargeAudit.ChargeCode});
if not L and R then S = val({HChargeAudit.ChargeCode}[1 to Ln-1]);
if L and not R then S = val({HChargeAudit.ChargeCode}[2 to Ln]);
if L and R then S = val({HChargeAudit.ChargeCode}[2 to Ln-1]);
T = T + S;
{@SumCDMbyGroup} = T;
thanks
booleanVar L := false;
booleanVar R := false;
numberVar Ln := Length ({HChargeAudit.ChargeCode});
numberVar S := 0;
numberVar T := 0;
numberVar i;
for i := 1 to {@CDMCounter} step 1 do
if val({HChargeAudit.ChargeCode}[1]) in (0 to 9) then L = false else L = true;
if val({HChargeAudit.ChargeCode}[Ln]) in (0 to 9) then R = false else R = true;
if not L and not R then S = val({HChargeAudit.ChargeCode});
if not L and R then S = val({HChargeAudit.ChargeCode}[1 to Ln-1]);
if L and not R then S = val({HChargeAudit.ChargeCode}[2 to Ln]);
if L and R then S = val({HChargeAudit.ChargeCode}[2 to Ln-1]);
T = T + S;
{@SumCDMbyGroup} = T;