How Hollywood Prints Square Brackets

Report any Hollywood bugs here
Post Reply
PEB
Posts: 569
Joined: Sun Feb 21, 2010 1:28 am

How Hollywood Prints Square Brackets

Post by PEB »

I just discovered an interesting inconsistency with how Hollywood prints square brackets.

In order to avoid the format tag error, double brackets ("[[" and "]]") are needed in the string to make the printed text appear as single brackets ("[" and "]").
*The documentation ("5.3 Strings") states that "\[" and "\]" should work; but that does not seem to work.*

This works as expected:
Print("[[Test]]")
This also works as expected:
Print("[[Test")
But this does NOT work as expected (the brackets print as double instead of single):
Print("Test]]")

Viewed in the framework of some reasonable code, this works as expected:

Code: Select all

SampleStr$="Now is the time for all [[good]] men to come to the aid of their party."
WordsTable$, count=SplitStr(SampleStr$, " ")
For x=1 To count
	NPrint(WordsTable$[x-1])
Next
But if this string is used instead...

SampleStr$="Now is the time for all [[good men]] to come to the aid of their party."

...then the problem becomes apparent.
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How Hollywood Prints Square Brackets

Post by airsoftsoftwair »

Yup, that's definitely a bug. Thanks for reporting!
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How Hollywood Prints Square Brackets

Post by airsoftsoftwair »

Fixed.
Post Reply