C christianjeannot Member Licensed User Oct 10, 2020 #1 Hello Community, in the documentation B4X Basic Language / 3.5.1 Scope Process Variables it says To access process global variables in other modules than the module where they were declared their names must have the module name they were declared as a prefix. Click to expand... In module B4XMainPage I use B4X: Copy Sub Class_Globals Private Root As B4XView Private xui As XUI Public MyLanguage As String End Sub In module B4XImprint I tried B4X: Copy If B4XMainPage.MyLanguage = "de" Then Log("Juhu") End If In the Logs I see B4X: Copy B4XImprintPage - <line number>: Undeclared variable 'b4xmainpage' is used before it was assigned any value. I read several search results from the forum but did not get it resolved. What did I miss? Best regards --Christian
Hello Community, in the documentation B4X Basic Language / 3.5.1 Scope Process Variables it says To access process global variables in other modules than the module where they were declared their names must have the module name they were declared as a prefix. Click to expand... In module B4XMainPage I use B4X: Copy Sub Class_Globals Private Root As B4XView Private xui As XUI Public MyLanguage As String End Sub In module B4XImprint I tried B4X: Copy If B4XMainPage.MyLanguage = "de" Then Log("Juhu") End If In the Logs I see B4X: Copy B4XImprintPage - <line number>: Undeclared variable 'b4xmainpage' is used before it was assigned any value. I read several search results from the forum but did not get it resolved. What did I miss? Best regards --Christian
M monki Active Member Licensed User Longtime User Oct 10, 2020 #2 try that B4X: Copy IF B4XPages.MainPage.MyLanguage= "de" Then Log("Juhu") End If monki Upvote 0
C christianjeannot Member Licensed User Oct 11, 2020 #3 Hello monki, many thanks for your answer. It is working Best regards --Christian Upvote 0