How to post code: Use [code] tags, wrap lines, post only relevant parts

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.
Status
Not open for further replies.

Mychaeel

New Member
In this forum, people frequently post code snippets illustrating their problems or their solutions to other people's problems.

Directly pasting code into a posting renders it virtually unreadable though because the forum software (or actually, your web browser) swallows all leading tabs and spaces and thus removes all traces of the code's original indentation.

To prevent that from happening, enclose any code you post in [code] ... [/code] tags like this:

Code:
[b][c[/b][b]ode][/b]
function MyFunction()
{
  local NicoleKidman thisActor;
  foreach AllActors(Class'NicoleKidman', thisActor)
    thisActor.GiveAcademyAward();    
}
[b][/c[/b][b]ode][/b]

While the subject of how to properly indent code is a highly controversial one among coders (at least those who bother to argue about it), they all agree that some kind of indentation to give the source code visual structure is indispensable. Other people are reading your code here on a voluntary basis, so please make it as easy for them as possible.

When you post code, keep the lines short. Code lines aren't wrapped to the browser's window width, so excessively long lines will stretch the entire thread and require readers to scroll horizontally in order to read even normal text between the code. So, please manually wrap very long lines if your code contains any.

Also, only post the relevant parts of your code. Nobody likes digging through pages and pages of your code just to find the place where something "doesn't work." When you post here you should already know at which place, roughly speaking, your problem lies, so please only post as much code as is needed to understand your problem.
 
Status
Not open for further replies.