Understanding code tags

Every time I try to post code a notice pops up about using code tags. Also, every time I try to post code, people jump down my throat about using the proper code tags. I have tried to read what to do concerning code tags, and remain confused. I am not the only one, because I see posts where others are confused also. In "all" of the text books I have read, code tags were done with these //.
I am trying my best to understand this </> exactly what does that means and how is that used in a code tag? I am sick of seeing of seeing people tell me to use the code tag </> how is it used? Do you use <, or > or this/, or all of it? Does it mean I am to use one slash instead of two? Also, where does one use * , where does one use */ ? What other code tags are there? The only way I will understand is through examples, because I have read and do not understand.
Here is how I have been doing it. // Make the code loop.
Please write in the correct code tags to: Make the code loop.
How can I end the notice popping up about using code tags?

Code tags are used so that the code is properly displayed in the forum post you are making or responding to. It has nothing to do with the actual code itself. You are confusing C/C++ comments with code tags. Code tags are for the forum.

For example here is code posted without code tags:

void setup() {

}

void loop() {

}

And cost posted with code tags:

void setup() {
    
}

void loop() {
    
}

All you have to do is highlight the code and click on the </> at the top of the post dialog.

click the "</>" (the "code tags") in the bar above the edit window which creates some highlighted text. replace that text with your code by "pasting"

Here is how I have been doing it. // Make the code loop.
Please write in the correct code tags to: Make the code loop.
How can I end the notice popping up about using code tags?

gcjr I went to the bar above the edit window. All that is above the edit window is the words Sketch and the date and Arduino 1.8.9 See what I mean? Confusing! I can't locate where you are talking about.
ToddL 1962 So all code tags does is highlight in red with the code in order and { and } in the proper places? I still don't know how to get to what I click on to post with code tags. I need to know what to click on and where it is at?

In the IDE, go to the menu bar, "Edit" then "Copy for Forum". Paste into a message you're posting. Done.

In the forum, the </> is the sixth icon from the left on the tool bar.

That is not a code tag. It's a C/C++ language element that ends a comment section.

you're posting the code on this forum.
look for the "</>" on this forum edit window

When you post or respond to a forum post do you not see the </> icon at the top of the post dialog?

Here is how I do it:

  1. Highlight and copy code from the editor
  2. Past code in the forum post or response
  3. Highlight what I just pasted
  4. Click the </> icon

The code tags not only properly formats and highlights the code, it prevents certain patterns in the code from being misinterpreted as formatting codes. For example, bold or italic.

@KeithHilton ,as you have demonstrated some confusion over these "code tags " and the usage , another way to post code to the forum and make people happy is to use ctrl +E keys and post the code between the "tags" when presented as : Preformatted text

code_tags

ToddL 1962 I finally figured out where the </> is located. People kept saying tool bar, edit. I was going to the sketch tools, and sketch edit. It is the in the post or reply window! My G------- how confusing. If code tags are so life and death important why are they so difficult to find? Think about that, I not a stupid person, and I have had a heck of a time trying to find something that should be simple to find.
ToddL 1962 In line one 1. Highlight and copy code from the editor. Where is the editor? When I click on copy for forum a message comes up at the bottom that says---Code formatted for Arduino Forum has been copied to clipboard. I can't find the clip board to do anything else!
After all this help I still doubt that I can post and make people happy with code tags. Can I simply hit </> and build my sketch around what comes up?

Once it's copied to the clipboard , right click on the mouse and paste to
the "code tags" ! :roll_eyes:

Some of this is because of the forum software upgrade. It's taking some time for the published instructions and howto's to catch up...

Yes. how do I get to the clipboard?

In the IDE editor window, right click and:


The code tags will be inserted automatically, then in the forum reply window, put your mouse pointer where you want, right click and paste.

ctrl-X, ctrl-C and ctrl-V

And how long have you been using Windows (or whichever GUI desktop you have)? :slightly_smiling_face:

IDE is the Integrated Development Environment
GUI is the Graphic User Interface
the Clipboard operates in the background and is generally invoked during 'copy/paste' operations via right mouse button "click". or ctrl-C (to copy)and ctrl-V(to paste)

You sure of that? How long have you been using computers?
Have you read
how to get the best out of this forum

more specificity read section 3, - pictures and everything.
https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#3-write-your-post

Actually Grumpy_Mike I am not sure of that! Not sure if I am running a quart low in the head--ha,ha,ha,ha! I am running Windows. Been running Windows since 1998. Built 3 or 4 computers from parts order off of the internet. No training in how to run a computer, or build one, maybe that's my problem. Have made my living building electronics and selling them all over the world close to 30 years. Here is my website www.hiltonelectronics.com Maybe my biggest problem is I am an old guy 78 years old---but I think my all my marbles are still in my head. At least I hope so! I am a Drafted service disabled Vietnam War Marine--and yes I do have PTSD--and---If you don't know what PTSD is look that up.
I am actually afraid to post another code, thinking I will screw up code tags again. Tonight I wrote code for a metronome I am building that prints out to an LCD, and other ports. I suppose I could try to post that code and see if I can do it with code tags. But---like I said, I am afraid to post code again, afraid I will screw up.

1 Like