Options for pasting procedure code

Pasting code from a MET/CAL procedure or a MET/TEAM data check sometimes does not preserve whitespace, line breaks, or other formatting, resulting in unreadable code in this forum.  Here are two options I have found for sharing code:

Pastebin method

This is the simplest method.  You paste the code that you want to share into a separate website, then share a link to your paste here so readers can view it.

  1. Visit http://pastebin.com
  2. Copy and paste your code into the New Paste window.
  3. Select any Optional Paste Settings, if desired.
  4. Click Submit.
  5. Copy the URL for your paste in your browser's address bar, then paste it here in your post.

Disable rich-text method

This method is more complex, but also allows you to paste your code directly into a comment here so that the code is displayed inline.  It requires you to reveal the HTML tags for your post, and make a simple edit of text between two HTML tags.

  1. Copy the code you want to share to your Windows clipboard.
  2. Start a new discussion or begin making a reply on this forum.
  3. Enter text as a placeholder that's easy to identify.  I usually use something like "zzz".
  4. Select your "zzz" text, open the Styles drop-down menu from the formatting tools, then select the Computer Code style to apply it.
  5. Below this forum's text editor, click the link to Disable rich-text.
  6. Find your "zzz" text among the HTML and paste your code, replacing the "zzz" text.
  7. Click Preview to make sure it appears correctly.

Note: this method requires you to edit the HTML for your post, and some characters are reserved in HTML including the less than (<) or greater than (>) signs and ampersands (&).  If your code contains any of these reserved characters, you must replace them with the valid HTML entity to prevent errors.  Refer to this website for more information and a list of reserved characters with their HTML entities: http://www.w3schools.com/html/html_entities.asp.