Why does this work? Comments inline
Code:
If OpenWindow(0,200,200,300,200,#PB_Window_SystemMenu,"test")
CreateGadgetList(WindowID())
t$="This text goes inside a multiline StringGadget."+Chr(13)+Chr(10)
;a string variable was created -- t$ is equal to the text plus some control characters
;t$ is displayed when the StringGadget is created later on
For r=1 To 10 : t$+Str(r)+Chr(13)+Chr(10) : Next
;text has been created -- but this information shouldn't be displayed
;see further comments after the code
StringGadget(0,10,10,200,100,t$)
;we display t$ at this point when we create the stringgadget
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
That text, t$+Str(r)+Chr(13)+Chr(10), shouldn't be displayed from what I can tell. It's not saved to a variable, so it has to be displayed right then. But, SetGadgetText() isn't used, Print() isn't used . . . from what I can tell, this text shouldn't be displaying. And yet, somehow, it displays. Why? What am I missing?
Thanks.
