emanfman 17 Newbie Poster

Don't have a link, but this compiles and runs perfectly.

String ^ParseBBCode(String ^OriginalText) {
array<String ^> ^Array = gcnew array<String ^>(13){ "\n", "Hello", "\n", "World", "", "", "", "", "", "", "", "", "" };
String ^ConvertedText;

String ^Line1 = "";

for (int Loop = 0; Loop < 13; Loop++)
{
	ConvertedText += Array[Loop];
}

EDIT: Newline character isn't working. Perhaps help? Maybe '\n'.toString()?

Ancient Dragon commented: nice example code. +17
emanfman 17 Newbie Poster

I saw a major syntax error. Maybe you were thinking Java?

The proper syntax for an if statement is:

if (condition1, condition2, condition3...) {statement1; statement2;}

If it's simpler, here it is on several lines:

if (condition1, condition2, condition3...)
{
statement1;
statement2;
}

If you wanted something to be done if it were evaluated false, just add an else at the end, followed by braced code:

if (condition1, condition2, condition3...)
{
statement1;
statement2;
}
else
{
statement3;
statement4;
}

Notice that the if...else statement doesn't require a semicolon (;) after the braces... it acts like a function.

Try fixing up your code with the right syntax.

Remember - you need the conditions in parentheses (()) and the function in braces({}).

Also, something I just realized is that you have no function for the "if" and the else has no condition.

Hope that helps!