> >
reccnt= VAL(SUBSTR(fstr,AT(",",fstr,6)+1,AT(",",fstr,7)-AT(",",fstr,6)-1))
> > reccnt= reccnt + VAL(SUBSTR(fstr,AT(",",fstr,5)+1,AT(",",fstr,6)-AT(",",fstr,5)-1))
> >
>
> Well someone should defend the original coders, right?:)
> Except for not having mdot what is wrong with this code? Probably it was written in VFP5 days or earlier and maybe have code checking the types and at least 7 commas oocuring. It looks like a simple parsing code to me.
>
I would say the fact that there are no spaces in the code to separate the commas, the operators or anything, it is not the most readable code I would say.
I think it is each and every coders responsibility to make sure their own code can be easily understood by other members of their team, working in a small team or by yourself really is no excuse. I've looked at code I wrote six, seven, more years ago and been annoyed at myself for not making it more readable, I think I constantly improve so look back at my old code and usually sigh.
This type of parsing was necessary before more helpful functions became available but if written in VFP5 or 6 the coder could have split it up into more lines to help other people maintain it, it made my head hurt when I was trying to read it and that's never good.