How to post code with formatting in place
zasadat
Posts: 25
I pasted several lines of code, from a .AXS file, into a comment box on this forum. All the tabs were removed, making it hard to read. How do I keep the formatting in place. Additionally/alternatively, how can I upload a .AXS file?
0
Answers
The trick is the "~" Use 3 x ~ to create and end a code block. It does require a carriage return after the ~~~
To attach a file to your post, look at the formatting and edit options at the top of your typing dialog box. The Folder Paper icon is the file attach option.
I do not see the Attachment icon.
I also do not see how the triple tildes create the "code here" box.
FWIW, I am using Google Chrome.
The triple tilde trick is doing the trick.
I do not have the file upload icon that you have highlighted.
Thanks, Chris.
Neither do I.
Just highlight your code, press the format tab and press code.
Just highlight your code, press the format tab and press spoiler.
Thank you! This is what I was looking for. I'd seen the tilde in some of the markdown docs, but never tried the triple tilde. Now, I'm hooked!
Tilde test:
Didn't know about the triple tilde use.
Don't know if you're indenting like advised in the 'AMX style guide*', but if so, it still looks wrong.
*
I tninks it’s the way the forum renders the code cuz my indents are all the same, might be 8 but don’t remember. I line up my braces too but most coder here don’t from what I’ve seen over the years, they follow the norm for other languages which isn’t readable to me. I like a lot of space and put braces where they’re not needed just to create more space. I’ve never bothered to make my code pleasing to anyone but myself since I’m the only one who ever sees it and has to deal with it and these days its not often.
Nice to hear someone else say that. My code is lots of comments, extra spaces, but I still don't know why I don't put the opening curly bracket on the next line. Modifying portions of the code would be easier that way.
But I'm fairly certain the code I write is "end of line" - it's not ever going to be modified or really looked at by anyone but me, and if/when it inevitably gets redone it gets waxed and completely replaced from scratch.
I don't always put away all my laundry either, sometimes I just leave it in a pile on the floor and use it from there.