Change in motor port's cause deletion of program please help

Whenever I change the ports in my program my entire program gets deleted and is replaced with this crap:// To complete the VEXcode V5 Text project upgrade process, please follow the
// steps below.
//
// 1. You can use the Robot Configuration window to recreate your V5 devices
// - including any motors, sensors, 3-wire devices, and controllers.
//
// 2. All previous code located in main.cpp has now been commented out. You
// will need to migrate this code to the new “int main” structure created
// below and keep in mind any new device names you may have set from the
// Robot Configuration window.
//
// If you would like to go back to your original project, a complete backup
// of your original (pre-upgraded) project was created in a backup folder
// inside of this project’s folder.

// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// Controller1 controller
// Drivetrainleftback motor 12
// Drivetrainrightback motor 13
// Drivetrainleftfront motor 1
// Drivetrainrightfront motor 10
// Lift motor 6
// LeftClaw motor 3
// RightClaw motor 9
// Dumper motor 18
// Gyro1 gyro D
// ---- END VEXCODE CONFIGURED DEVICES ----

#include “vex.h”
#include “robot-config.h”

using namespace vex;

/*int main() {

}*/

// /----------------------------------------------------------------------------/
// /* /
// /
Module: main.cpp /
// /
Author: C:\Users\Jennifer /
// /
Created: Wed Sep 25 2019 /
// /
Description: V5 project /
// /
/
// /
----------------------------------------------------------------------------*/

// // ---- START VEXCODE CONFIGURED DEVICES ----
// // Robot Configuration:
// // [Name] [Type] [Port(s)]
//

If possible can you please explain why the heck this happens and a possible way to fix it.

Alright so this has nothing to do with the port changing. It is due to an update of the VEX text coding studio program. If you read the comments at the top of the program it tells you how to fix this. But I will also list some simplified steps below.

Step 1) In coding studio do the following: File → New Window

Step 2) In that new window go to File → New and create a new project

Step 3) Open file explorer on your computer and navigate to the following folder: This PC → Documents → vexcode-projects

Step 4) In this folder navigate to your OLD project folder the one that is having this issue. Inside it there should be a backup folder. Double click on the file that has the .v5code extension. A window will open with your project that does not have all the weird stuff at the top.

Step 5) copy and paste all the code from your the project that was just opened into the NEW project you created.

Then upload the new project to your bot and you will be all set.

1 Like