Author Topic: code cleanup  (Read 1256 times)

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
code cleanup
« on: December 23, 2014, 10:01:48 PM »
I've notice that sometimes when I delete parts of my hmi that some code remains , is this normal and what is the best way to clean it up

Darrell

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: code cleanup
« Reply #1 on: December 23, 2014, 10:16:08 PM »
What files are you seeing the code?

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: code cleanup
« Reply #2 on: December 24, 2014, 09:25:33 PM »
If I open up the code view for a button for example , then go back to the design view and delete a  button for example , then go back to the code view, the code for that button is still there , I just wanted to make sure if I delete any element that everything that belongs to it is gone

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: code cleanup
« Reply #3 on: December 24, 2014, 09:53:20 PM »
I think what you are seeing is the event handler code that does not get deleted with the button or other object. If you check the declaration of the subroutine before you delete the button, you should see "Handles Button1.click" at the end of the line. After you delete the button, that piece of code will be removed, but the subroutine is still there.

So if you are no longer using that subroutine, you will have to manually delete it.

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: code cleanup
« Reply #4 on: December 24, 2014, 10:38:49 PM »
thanks, Archie