Have you tried testing each line in the vlide? To do so, double-click on the outside of a parenthesis, so the entire line is highlighted, then hit the little microscope button on the toolbars. When you get to the error, double-click the function name i.e. getdist and pick the help button. Read up on it and see if you can work it out.