named my components after my family and now i cant delete grandma

Go down

named my components after my family and now i cant delete grandma

· #1

to remember what my buttons do i named them after family

Mom saves, Dad cancels, Grandma opens the settings

i dont need the settings button anymore but when i try to delete Grandma lazarus asks if im sure and i cant do it

Re: named my components after my family and now i cant delete grandma

· #2

This is the most relatable bug report I've ever read.

Re: named my components after my family and now i cant delete grandma

· #3

I've maintained code where the variables were named after someone's cats. One cat had passed. Nobody would touch that function. It still runs in production out of respect.

Pete · thirty years of begin and end "It compiled on my machine."

Re: named my components after my family and now i cant delete grandma

· #4

Two real things here.

First, naming. A component's Name should say what it does, so the code reads on its own:

Instead of Try
Mom SaveButton
Dad CancelButton
Grandma SettingsButton

You rename in the Object Inspector, in the Name property. Lazarus updates the declaration in the form class for you. It does not rename event handlers you already made, so GrandmaClick stays GrandmaClick until you change it yourself.

Second, deleting. Removing a component from the form leaves its event handler in the source if there's code in it. Nothing is lost. It's safe.

Read the error message. Then read it again.

Re: named my components after my family and now i cant delete grandma

· #5

i renamed her to SettingsButton first

then i deleted SettingsButton. that was fine. i didnt feel anything

Re: named my components after my family and now i cant delete grandma

· #6

I NAMED MINE AFTER MY EX-COWORKERS. DELETING IS VERY EASY

sorry

SORRY ABOUT THE CAPS

Re: named my components after my family and now i cant delete grandma

· #7

Renaming before deleting. That's the most emotionally mature refactoring I've seen on this forum.

Forum rules 1 to 10 apply. Yes, to you.

Go up

Sign in to reply