Bug? Warning #20

Bruno.im

Member
Licensed User
Longtime User
View 'TextFieldIP' was added with the designer. You should not initialize it. (warning #20)

If I do not initialize it, I got an error on compiling:

Parsing code. Error
Error parsing program.
Error description: Undeclared variable 'textfieldip' is used before it was assigned any value.
Occurred on line: 32
TextFieldIP.Initialize("TIP")
 

ilan

Expert
Licensed User
Longtime User
have you saved the layout file in designer??

views that was added with designer do not need to be intialized a warning will be shown that this view is not intialized until you saved the layout file in deisigner...
 
Last edited:

Bruno.im

Member
Licensed User
Longtime User
Yes I have saved the layout Files and checked the names. I think I know where the problem is: I have 2 pages, a main page and a preferences Page where I store information: so 2 designer files 1.bal and 2.bal. In Designer I generate Private TextFieldIP As TextField which is on Page2.
What I believe happened is that TextFieldIP is initialized on Page 2 only (see zip file). Thanks for your time.
 

Attachments

  • Warning20.zip
    4 KB · Views: 219

klaus

Expert
Licensed User
Longtime User
It's normal that you get the Warnings !
You have this line in Application_Start
TextFieldIP.Text=My_IP
But haven't yet loaded layout "2"!
Move these two lines to Application_Start before you try to acces TextFieldIP.
Page2.Initialize("Page2")
Page2.RootPanel.LoadLayout("2")
 
Top