Bug with quotes in captions

You need some new stunning features ? Tell us here.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Bug with quotes in captions

Post by MachineCode »

I put the following name for a window caption with the form designer:

Code: Select all

Properties for "<name>"
And the designer made the source code like this:

Code: Select all

Window_0 = OpenWindow(#PB_Any, 0, 0, 920, 530, "Properties for "<name>"", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
And when trying to run it, you get this error:

Code: Select all

Line 7: Boolean comparisons can only be used with test operators like If, While, Repeat. Use Bool() instead.
So, the solution would be for the designer to replace any quotes in captions with Chr(34) in the code only, like so:

Code: Select all

Window_0 = OpenWindow(#PB_Any, 0, 0, 920, 530, "Properties for "+Chr(34)+"<name>"+Chr(34), #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
But the designer still must show only "name" on the window title in the design view, as well as in the caption field, and not show "Chr(34)".

Good luck. :)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Bug with quotes in captions

Post by Polo »

Thanks for the report, for now it doesn't replace anything but that would be a nice addition!
Post Reply