For the complete documentation index, see llms.txt. This page is also available as Markdown.

Check & Fix

Check & Fix finds the mistakes in a VB.NET formula, corrects the usual ones for you and lists, by line, what you still need to correct. It is meant for anyone who writes formulas only now and then.

The button is in the Script Editor when the Language is VB.NET. You are also offered it when Script Watch or Save finds that the formula has a mistake: the message The VB.NET script does not compile: shows the first mistake and asks Open Check & Fix to see every problem by its line and fix the usual mistakes?

Nothing is saved by Check & Fix. The corrected formula goes back to the editor only when you press Apply to editor; then test it and save as usual.

What it corrects for you

  • A block left open: a missing End If, Next, Loop, End While, End Select, End With, End Try, End Sub or End Function.

  • Words written the old way: EndIf, EndSelect, Wend, Else If and the like, in any letter case.

  • A missing Then at the end of an If or ElseIf line.

  • Signs from other languages: ==, !=, &&, ||, a ; at the end of a line, // for a note, a line with only { or }.

  • A field name with a small spelling mistake - for names of 5 letters or more, at most 1 letter wrong (2 for names of 8 letters or more), and only when there is just one field it can be.

  • A working value the formula stores a value in (NAME = ...) but never declared - a Dim line is added for it.

  • The indentation (4 spaces per level) and the letter case of words such as If, Then and End If.

The window

  • The top line sums up the result, for example 2 change(s) made - the script now compiles. Press Apply to editor, then Watch to test it. When something is left, it says how many problems you must fix by hand.

  • What was found lists every point with its Line, What and Status: Fix by hand (you must correct it) first, then Fixed (what was changed for you).

  • Double-click a Fix by hand row to go to its line in the formula.

  • The script after the fixes - you can still change it here, then press Check again to check the formula as it is now shown.

  • Apply to editor puts the formula in the editor; if problems are left, their first line is selected there. Cancel leaves the editor as it was.

  • On the web, on a phone or narrow screen, use Problems and Script at the top to switch between the list and the formula.

Example - a formula with the usual mistakes

Sunita writes this formula, where PF is a field of the screen:

Check & Fix shows:

and lists as Fixed: Then added (lines 1 and 3), the ; removed, == changed to =, Else If written ElseIf, and endif written End If. The top line says 6 change(s) made - the script now compiles. She presses Apply to editor, then Script Watch, then Save.

Problems you correct yourself

Some mistakes need your decision. They are listed as Fix by hand in plain words, for example:

  • this text value has no closing " - end it on this line

  • 'GROSS_SAL' is not a field and was not declared with Dim (check the spelling)

  • this line works out a value but does not store it - write NAME = ...

  • End If has no If before it - check the blocks above