Hello,
I will try to explain as best I can what happens...
- Visual user object
The visual user object uvo_year declares one private instance variable initialized to 2019 :
private integer ii_year=2019
The function uf_getyear() returns ii_year variable's value :
return(ii_year)
A command button (cb_next) triggers the user event ue_next(), wich is empty.
- Window object
The window w_year declares 2 private instance variables initialized to 9999. One of the variable has the same name as the one declared in uvo_year :
private integer ii_year=9999, ii_year3=9999
The object uvo_year is on the window layout and its name is uo_1. The user event ue_next contains code to store the uo_1 variable ii_year in the 2 window instance variables, and display them :
ii_year = this.uf_getyear()
ii_year3 = this.uf_getyear()
messagebox("init", "ii_year=" + f_string(ii_year) + " - ii_year3=" + f_string(ii_year3))
A command button (cb_disp) displays the content of both variables :
messagebox("button", "ii_year=" + string(ii_year) + " - ii_year3=" + string(ii_year3))
When the uvo_year button is clicked, the messagebox obviously displays the same value for both window variables : 2019.
When the window's command button (cb_disp) is clicked, it's expected that both window variables still have the same value (2019). This is the case when the application runs in Window classic mode, but when it runs in web mode the value ii_year3 is correct (2019) BUT ii_year's value came back to its original value (9999).
It seems like a Powerserver bug to me...
Pierre
Yes, I see the ticket & reply from Zhao Kai that duplicate variable names are not supported in PowerServer Apps, as follows: https://www.appeon.com/support/documents/appeon_online_help/2017/features_help_for_appeon_web/ch14.html
Regards ... Chris