Surely this is a bug.
I've tested the code in Windows 7-64 and Mac Mavericks.
In the code below:
Line 26 is ok but
Line 27 throws the error: XML error: not well-formed (invalid token) (Line: 1)
Code: Select all
; As we embedded xml directly in the source, the encoding of special characters will vary if we are in unicode mode or not.
; So ensure to use the correct one. This is not needed if the XML is read from an external file or directly included
; with IncludeBinary.
;
CompilerIf #PB_Compiler_Unicode
#XmlEncoding = #PB_UTF8
CompilerElse
#XmlEncoding = #PB_Ascii
CompilerEndIf
Runtime Procedure OpenWindowDialog()
ExamineDesktops()
Protected H = DesktopHeight(0)
#Dialog = 0
#Xml = 0
Debug H
XML$ = "<dialogs>" +
"<window id='0' name='First Window' text='First Window' width='600' height='700' " +
" flags= '#PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
" <vbox>"+
" <hbox maxheight='100'>"+
" <empty height='50' />"+
" <button text='>' height='40'/>" +
" <button text='|<' height='40'/>" +
" </hbox>"+
" <empty width='500' height='550'/>"+
" </vbox> "+
"</window>" +
"<window id='1' name='Second Window' text='Second Window' width='200' height='200'" +
" flags='#PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
"" +
"</window>" +
"<window id='2' name='Third Window' text='Third Window' width='200' height='200'" +
" flags='#PB_Window_SystemMenu | #PB_Window_SizeGadget'>" +
"" +
"</window>" +
"</dialogs>"
If CatchXML(#Xml, @XML$, StringByteLength(XML$), 0, #XmlEncoding) And XMLStatus(#Xml) = #PB_XML_Success
If CreateDialog(#Dialog) And OpenXMLDialog(#Dialog, #Xml, "First Window") And
OpenXMLDialog(#Dialog, #Xml, "Second Window") And (OpenXMLDialog(#Dialog, #Xml, "Third Window"))
Debug WindowHeight(0)
Debug WindowWidth(0)
ResizeWindow(0,200,#PB_Ignore,#PB_Ignore,#PB_Ignore)
ResizeWindow(1,200 + WindowWidth(0),#PB_Ignore,#PB_Ignore,#PB_Ignore)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
Else
Debug "Dialog error: " + DialogError(#Dialog)
EndIf
Else
Debug "XML error: " + XMLError(#Xml) + " (Line: " + XMLErrorLine(#Xml) + ")"
EndIf
EndProcedure
OpenWindowDialog()