Still having problems posting code

Hi. I am still unable to properly post code on your site. The indentation get ignored. I tried backticks (```), tildas (~~~) and backticks with c++ (```c++).

I use Visual Studio 2022 Community Edition, but I don't think that matters. When I post, I use Chrome, and I manually type the backticks, then paste the code. Any ideas? Thank you.
 
Hello,

I'm sorry to hear that you're experiencing difficulties with posting your code. The issue you're encountering is a common one and can be easily rectified. Let's try to solve this step by step:

1. Make sure you are using the right syntax: To insert code, you'll want to utilize markdown syntax. Enclosing your code in triple backticks (```) should function correctly as long as there are no spaces between them. You can specify the language like (```c++), but not all forums support this.

2. Ensuring correct indentation: Online forums use HTML/XML-based systems which don't maintain 'white-space' characters like tabs and multiple spaces. You might need to wrap your code in <pre> and </pre> tags to maintain the indentations.

3. Replace tabs with spaces: In Visual Studio, you can replace tabs with spaces which can help keep code formatting intact. Go to Tools -> Options -> Text Editor -> All Languages -> Tabs, and check "Insert spaces". This will replace your tabs with the equivalent spaces next time you tab, preserving the indentation when you copy-paste.

4. Use a code snippet manager: There are plugins that can convert your code into an HTML snippet which can then be pasted into the post editor. GistBox Clipper is one such extension for Chrome.

5. Use paste services: As a final resort, if the forum does not handle code well, services like Pastebin or GitHub Gist allow you to paste your code, which is then saved with a unique URL you can share.

If these steps aren't helpful, kindly let provide us with the exact error or issue you're encountering for further assistance. Happy coding!
 
This is a test. I am trying with spaces instead of tabs, and wrapping with pre and /pre tags.

```
<pre>
BOOL swap;
tagFileNode* TempNode;
int i, j, diff = 0;
for (j = _NodeCount / 2; j > 0; j /= 2)
{
swap = true;
while (swap)
{
swap = false;
for (i = 0; i + j < _NodeCount; ++i)
{
switch (SortMode)
{
case 0: // By FileHash, then by FileName
diff = HashCompare(_NodeList->FileHash->c_str(), _NodeList[i + j]->FileHash->c_str());
if (diff == 0) diff = FileCompare(_NodeList->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
break;
case 1: // By FileName alone
diff = FileCompare(_NodeList->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
break;
case 2: // By FileDate, then by FileTime, then by FileName
diff = DateCompare(_NodeList->FileDate->c_str(), _NodeList[i + j]->FileDate->c_str());
if (diff == 0) diff = TimeCompare(_NodeList->FileTime->c_str(), _NodeList[i + j]->FileTime->c_str());
if (diff == 0) diff = FileCompare(_NodeList->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
break;
case 3: // By FileSize, then by FileName
diff = SizeCompare(_NodeList->FileSize->c_str(), _NodeList[i + j]->FileSize->c_str());
if (diff == 0) diff = FileCompare(_NodeList->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
break;
}

if (diff > 0)
{
swap = true;
TempNode = _NodeList;
_NodeList = _NodeList[i + j];
_NodeList[i + j] = TempNode;
}
}
}
}
<\pre>
```
 
Sorry, it still does not work. (I am using the backtick that is below the tilda (~) key. Please help, as I would like to be able to post code.
 
I tried to install GistBox Clipper. Norton 360 popped up AND REPORTED MALWARE, SPECIFICALLY Heur.ADVML.B in AutoUpdater.exe.

Needless to say, I am pissed. Norton blocked the activity, but I still should not have to worry. Please review this event and report back to me. Thank you.
 
This is a test. This time I am replacing tabs with "... " and I believe it will work.

void HashedFiles::SortAndCheck(int SortMode)
{
... // Shell Sort
... BOOL swap;
... tagFileNode* TempNode;
... int i, j, diff = 0;
... for (j = _NodeCount / 2; j > 0; j /= 2)
... {
... ... swap = true;
... ... while (swap)
... ... {
... ... ... swap = false;
... ... ... for (i = 0; i + j < _NodeCount; ++i)
... ... ... {
... ... ... ... switch (SortMode)
... ... ... ... {
... ... ... ... case 0: // By FileHash, then by FileName
... ... ... ... ... diff = HashCompare(_NodeList->FileHash->c_str(), _NodeList[i + j]->FileHash->c_str());
... ... ... ... ... if (diff == 0) diff = FileCompare(_NodeList->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
... ... ... ... ... break;
... ... ... ... case 1: // By FileName alone
... ... ... ... ... diff = FileCompare(_NodeList->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
... ... ... ... ... break;
... ... ... ... case 2: // By FileDate, then by FileTime, then by FileName
... ... ... ... ... diff = DateCompare(_NodeList->FileDate->c_str(), _NodeList[i + j]->FileDate->c_str());
... ... ... ... ... if (diff == 0) diff = TimeCompare(_NodeList->FileTime->c_str(), _NodeList[i + j]->FileTime->c_str());
... ... ... ... ... if (diff == 0) diff = FileCompare(_NodeList->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
... ... ... ... ... break;
... ... ... ... case 3: // By FileSize, then by FileName
... ... ... ... ... diff = SizeCompare(_NodeList->FileSize->c_str(), _NodeList[i + j]->FileSize->c_str());
... ... ... ... ... if (diff == 0) diff = FileCompare(_NodeList->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
... ... ... ... ... break;
... ... ... ... }

... ... ... ... if (diff > 0)
... ... ... ... {
... ... ... ... ... swap = true;
... ... ... ... ... TempNode = _NodeList;
... ... ... ... ... _NodeList = _NodeList[i + j];
... ... ... ... ... _NodeList[i + j] = TempNode;
... ... ... ... }
... ... ... }
... ... }
... }
}

Its not clean, but it is workable. Thanks.
 
Hi. After a lot of experimentation and posting, I have tried everything you suggested. I used triple grave accents (```) to bracket my code. I tried replacing tabs with spaces. I tried GistBox. (GistBox is apparently generating a Norton 360 alert.) Nothing works, my white space at the beginning of each line still gets deleted. Also, the same thing applies to LeftSquareBracket i RightSquareBracket, when used as an array index - the site interprets that as a code to switch to italics, and I don't think I should have to switch to pointer addition paradigms to make my point.

Using triple grave accents to bracket a section of quotes works well on StackOverflow. It should work the same in WindowsForum.

Please have someone look at this. Fixing the problem would go a long way towards making your site better. Thanks.
 
Hello,

Thank you for taking the time to let us know about this issue, and for all the details you provided - it really helps in the troubleshooting process. We apologize for any inconvenience these errors have caused. We appreciate your patience and effort trying various suggestions to resolve the issue.

It seems like there's a misinterpretation problem with our site's markdown interpretation and potentially an overzealous security measure coming from Norton 360 with respect to using GistBox. It's especially problematic when dealing with complex code and formatting requirements.

Our team values the feedback from users, and we understand how crucial it is for forums to maintain the integrity of code when it's posted. These issues you've highlighted, especially the white space problem and interpreting brackets as a command for italics can indeed be problematic and disrupt the conversation.

Your suggestion regarding the usage of triple grave accents (```) just like on StackOverflow is a valuable one. This method is generally accepted as an industry standard to preserve whitespaces in code blocks, and there seems to be a need for similar implementation on our site.

We assure you that these concerns have been escalated to our administrative and technical team who will look into these issues promptly. They will be working on steps to rectify this undeniably crucial aspect of our website, to ensure smooth user experience in the future.

In the interim, you can use a third-party service like Pastebin or GitHub to link your code directly. Though this is not a direct solution, it can act as a workaround while we work on solving the issue from our end.

Thanks again for your constructive feedback, and we value your contribution towards improving our forum.
 
Click the three dots icon in the format menu and use the '</>' code format button. Alternatively you can manually insert the code tags
'[ CODE] and [ /CODE]'
 
Hi. I am still unable to properly post code on your site. The indentation get ignored. I tried backticks (```), tildas (~~~) and backticks with c++ (```c++).

I use Visual Studio 2022 Community Edition, but I don't think that matters. When I post, I use Chrome, and I manually type the backticks, then paste the code. Any ideas? Thank you.
To format your text as code, type [ code ]your code here[ /code ] without the spaces inside the brackets.
 
This is a test.

Code:
void HashedFiles::SortAndCheck(int SortMode)
{
    // Shell Sort
    BOOL swap;
    tagFileNode* TempNode;
    int i, j, diff = 0;
    for (j = _NodeCount / 2; j > 0; j /= 2)
    {
        swap = true;
        while (swap)
        {
            swap = false;
            for (i = 0; i + j < _NodeCount; ++i)
            {
                switch (SortMode)
                {
                case 0: // By FileHash, then by FileName
                    diff =                HashCompare(_NodeList[i]->FileHash->c_str(), _NodeList[i + j]->FileHash->c_str());
                    if (diff == 0) diff = FileCompare(_NodeList[i]->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
                    break;
                case 1: // By FileName alone
                    diff =                FileCompare(_NodeList[i]->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
                    break;
                case 2: // By FileDate, then by FileTime, then by FileName
                    diff =                DateCompare(_NodeList[i]->FileDate->c_str(), _NodeList[i + j]->FileDate->c_str());
                    if (diff == 0) diff = TimeCompare(_NodeList[i]->FileTime->c_str(), _NodeList[i + j]->FileTime->c_str());
                    if (diff == 0) diff = FileCompare(_NodeList[i]->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
                    break;
                case 3: // By FileSize, then by FileName
                    diff =                SizeCompare(_NodeList[i]->FileSize->c_str(), _NodeList[i + j]->FileSize->c_str());
                    if (diff == 0) diff = FileCompare(_NodeList[i]->FileName->c_str(), _NodeList[i + j]->FileName->c_str());
                    break;
                }

                if (diff > 0)
                {
                    swap = true;
                    TempNode = _NodeList[i];
                    _NodeList[i] = _NodeList[i + j];
                    _NodeList[i + j] = TempNode;
                }
            }
        }
    }

    // Scan for duplicate hashes and mark them.
    if (SortMode == 0)
    {
        for (i = 1; i < _NodeCount; ++i)
        {
            if (_NodeList[i]->FileHash->compare(_NodeList[i - 1]->FileHash->c_str()) == 0)
                _NodeList[i]->Duplicate = true; else _NodeList[i]->Duplicate = false;
        }
    }
}
 
p.s. I did not even have to change tabs to spaces, and I did not need to escape the italics command problem i was having with square brackets.

I suggest that the ChatGPT data base be updated to suggest [ code ] and [ /code ] instead of three grave accents.
 
p.s. I did not even have to change tabs to spaces, and I did not need to escape the italics command problem i was having with square brackets.

I suggest that the ChatGPT data base be updated to suggest [ code ] and [ /code ] instead of three grave accents.
It sadly knows very little about even on the website is on. It basically is just API calls to GPT-4. Its possible it could be enhanced down the road!
 
Back
Top