GitLab repository: https://gitlab.com/PDStig/vpin-workshop-code-formatter
Here is a simple utility to help you format your table code according to the coding standards of the VPin Workshop. This is still in development, so not all formatting tools have been implemented or thoroughly tested yet.
This utility is not a magic solution for everything; you will likely need to make additional manual edits to your script to make it fully compliant with VPW standards. However, this utility will do 90% of the work for you.
Choose which formatting operations you wish to perform (disabled switches are coming soon):
([{
) nor add a space before the ending brace
()]}
).
Remove unnecessary whitespace
_
between
each word.
Optional
Requires manual editing
Const THIS_IS_A_CONSTANT
If (mode = 4 Or (mode = 6 And ballDrained = False)) And
gameInProgress = True Then AddScore (6 + 3) * bonusX
If mode = 2 Then doSomething()
For i = 0 To 5 : light(i).state = 0 : Next
(not
easily readable)
If mode = 2 Then doSomething() : doSomethingElse()
(not easily readable and may break code auto-formatters due to
a missing "End If" [even though the code would still run
fine])
Dim myVar : myVar = 0 'Comment about myVar
(breaks display of comments for the variable in the IDE
IntelliSense)
' Set myVar = new Doggy
Dim myVar 'Comment for myVar goes here
Sub mySub(mark, bob) 'Comment for mySub goes here