VEXcode V5 userpy error for block code

Before the big update, my code was working completely fine and had no issues. After changing nothing other than ports, I keep getting a “userpy” error. Can someone please help? Code is attached.
masterAuton23-24.v5blocks (114.3 KB)

switch the build back to C++, know issue with Python code generation.

3 Likes

As mentioned, this is a known issue. We have a fix for this that will be part of the VEXcode 3.0.4 release. Until that is released, you should change your project to download C++.

One thing to note about the setting. The setting is stored with the project file, so if you change it with your current project then create a new project, the new project will download Python. This does mean that if you have multiple projects, you will need to change each project, but it also means that if you load the project on another computer, you don’t need to worry about changing the setting on that computer.

For those that want to understand why this is happening without looking at the Python code that is generated by VEXcode…

Python requires that conditionals (if, if/else, and if/else-if/else blocks), loops, and functions must have valid code in them. If it does not, it must have the pass statement. Since comments are not commands, if you only have comment blocks, the currently generated code currently has no valid commands for the conditionals and also does not have the pass statement and thus will not run.

The loops and my block definitions do not have this issue due to additional code that is added to the code that is generated from the blocks.

3 Likes