6

I asked a question for which the only answer might not have worked under certain circumstances. It certainly worked with me. I marked it correct and added a comment with my modifications.

Was this correct, considering other users might take the answer as is and expect it to work? If not, what would have been the correct approach.

4

Accepting the answer that helped or guided you to the right solution is the correct thing to do.

Depending on the part of the code you modified, it could be helpful to write an answer instead of a comment. This would increase the visibility of your solution, since not all users read the comments, especially the ones that are buried under other comments which don't make your comment visible; it would be also help future users, since they would get the code you used more immediately.

Even in the case you write your own answer, I would keep the other answer as accepted, as that is the answer that helped you to find your own solution.

2

Yes, your approach was correct.

Selecting a particular answer as the 'best' simply indicates that it was the most helpful answer to solve the original poster's problem.

Upvotes/downvotes (and yes, even comments) from other community members are used to signal the general quality of a post; if you ask a question, you should accept the answer that helped you the most with the original problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .