subString Function Error

subString Function Error

I am trying to get a part of a field using substring function. But when execute the function, zoho returns an error.

My function is 

void mediodepago.PegaCobro()
{
RegVisa = FileV [Fecha_de_Proceso == null];
if(RegVisa .count() > 0)
{
for each  Rec in RegVisa
{
sLinea = Rec.Linea;
sFec_Compra = sLinea.subString(71,6);
}
}
}

Linea is a Single Line type.

The error is 

Execution Failed
Error details:
Error occured please contact application owner.

Does anyone know what´s wrong in my function?